This commit is contained in:
Sjoerd van de Goor 2023-02-07 17:39:44 +01:00
parent c366ec0c40
commit a6ea6fcfb2

View File

@ -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") @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 = ""; 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.") @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) @RegistryListResource(IrisScript.class)
private String spawnerScript = ""; private String spawnerScript = "";
@ -211,6 +214,10 @@ public class IrisEntity extends IrisRegistrant {
} }
} }
if (isSpecialType() && !applySettingsToCustomMobAnyways) {
return ee;
}
if (ee == null) { if (ee == null) {
return null; return null;
} }
@ -442,8 +449,7 @@ public class IrisEntity extends IrisRegistrant {
if (isSpecialType()) { if (isSpecialType()) {
if (specialType.toLowerCase().startsWith("mythicmobs:")) { if (specialType.toLowerCase().startsWith("mythicmobs:")) {
Iris.linkMythicMobs.spawnMob(specialType.substring(11), at); return Iris.linkMythicMobs.spawnMob(specialType.substring(11), at);
return null;
} else { } else {
Iris.warn("Invalid mob type to spawn: '" + specialType + "'!"); Iris.warn("Invalid mob type to spawn: '" + specialType + "'!");
return null; return null;