Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ public final class SettingKey implements SettingHolder {
public static final RoseSetting<Boolean> MISC_INSIGHTS_LOGGING = create("misc-settings.insights-logging-enabled", BOOLEAN, true, "If Insights is installed, should we track stacked block/spawner break/placing?");
public static final RoseSetting<Boolean> MISC_CLEARALL_REMOVE_SINGLE = create("misc-settings.clearall-remove-single", BOOLEAN, false, "Should single mobs be removed with `/rs clearall`?");
public static final RoseSetting<Boolean> MISC_MYTHICMOBS_ALLOW_STACKING = create("misc-settings.mythicmobs-allow-stacking", BOOLEAN, false, "Should mobs owned by MythicMobs be allowed to stack?", "This is recommended to keep set to false unless you specifically only change mob attributes", "Having this disabled will also disable the entity instant-stack setting due to the timing of MythicMob spawns");
public static final RoseSetting<Boolean> MISC_MYTHICMOBS_ALLOW_DISABLE_AI = create("misc-settings.mythicmobs-allow-disable-ai", BOOLEAN, true, "Should RoseStacker be allowed to disable the AI of MythicMobs entities?", "If false, RoseStacker will never disable the AI of a MythicMobs entity,", "even if the entity type is configured with disable-all-mob-ai or spawner disable-mob-ai");
public static final RoseSetting<Boolean> MISC_INFERNALMOBS_ALLOW_STACKING = create("misc-settings.infernalmobs-allow-stacking", BOOLEAN, false, "Should mobs from InfernalMobs be allowed to stack?", "Recommended to keep set to false to not interfere with InfernalMobs");
public static final RoseSetting<Boolean> MISC_LEVELLEDMOBS_ALLOW_STACKING = create("misc-settings.levelledmobs-allow-stacking", BOOLEAN, false, "Should mobs from LevelledMobs be allowed to stack?", "Recommended to keep set to false to not interfere with LevelledMobs");
public static final RoseSetting<Boolean> MISC_SPAWNER_PERSISTENT_COMPATIBILITY = create("misc-settings.spawner-persistent-compatibility", BOOLEAN, true, "Some plugins like Jobs, mcMMO, and RoseLoot store special data for spawner mobs.", "Disabling this will cause the functionality within those plugins to break.", "The individual plugin hooks can be configured separately below");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public static boolean mythicMobsEnabled() {
return mythicMobsEnabled = Bukkit.getPluginManager().isPluginEnabled("MythicMobs");
}

/**
* @param entity the entity to check
* @return true if this entity is a MythicMobs entity, false otherwise
*/
public static boolean isMythicMob(LivingEntity entity) {
return mythicMobsEnabled() && MythicBukkit.inst().getAPIHelper().isMythicMob(entity);
}

/**
* @return true if EpicBosses is enabled, false otherwise
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.rosewood.rosegarden.RosePlugin;
import dev.rosewood.rosestacker.RoseStacker;
import dev.rosewood.rosestacker.config.SettingKey;
import dev.rosewood.rosestacker.hook.NPCsHook;
import dev.rosewood.rosestacker.manager.StackSettingManager;
import dev.rosewood.rosestacker.nms.NMSAdapter;
import dev.rosewood.rosestacker.nms.NMSHandler;
Expand Down Expand Up @@ -42,6 +43,9 @@ public static boolean isUnstackable(Entity entity) {
}

public static void removeEntityAi(LivingEntity entity) {
if (!SettingKey.MISC_MYTHICMOBS_ALLOW_DISABLE_AI.get() && NPCsHook.isMythicMob(entity))
return;

RosePlugin rosePlugin = RoseStacker.getInstance();
PersistentDataContainer dataContainer = entity.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(rosePlugin, NO_AI_METADATA_NAME);
Expand All @@ -65,6 +69,9 @@ public static void applyDisabledAi(LivingEntity entity) {
}

public static void applyDisabledAi(LivingEntity entity, boolean disable) {
if (disable && !SettingKey.MISC_MYTHICMOBS_ALLOW_DISABLE_AI.get() && NPCsHook.isMythicMob(entity))
return;

if (isAiDisabled(entity) || !disable) {
if (SettingKey.SPAWNER_DISABLE_MOB_AI_OPTIONS_REMOVE_GOALS.get() && disable) {
NMSHandler nmsHandler = NMSAdapter.getHandler();
Expand Down