Add mind control targets blacklist config option
This commit is contained in:
@@ -111,6 +111,11 @@ public final class Settings {
|
||||
* overriding the defaults and the whitelist.
|
||||
*/
|
||||
public String[] summonedCreatureTargetsBlacklist = {"creeper"};
|
||||
/**
|
||||
* <b>[Server-only]</b> List of names of entities which are immune to the mind control spell, in addition to the
|
||||
* defaults.
|
||||
*/
|
||||
public String[] mindControlTargetsBlacklist = {};
|
||||
/** <b>[Server-only]</b> Global damage scaling factor for all player magic damage. */
|
||||
public double playerDamageScale = 1.0f;
|
||||
/** <b>[Server-only]</b> Global damage scaling factor for all npc magic damage. */
|
||||
@@ -497,6 +502,18 @@ public final class Settings {
|
||||
alliesCommandName = property.getString();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "mindControlTargetsBlacklist", new String[]{},
|
||||
"List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mind_control_targets_blacklist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
mindControlTargetsBlacklist = property.getStringList();
|
||||
// Converts all strings in the list to lower case, to ignore case sensitivity, and trims them.
|
||||
for(int i = 0; i < mindControlTargetsBlacklist.length; i++){
|
||||
mindControlTargetsBlacklist[i] = mindControlTargetsBlacklist[i].toLowerCase(Locale.ROOT).trim();
|
||||
}
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(Configuration.CATEGORY_GENERAL, propOrder);
|
||||
|
||||
// Resistances
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
@@ -14,6 +16,7 @@ import electroblob.wizardry.util.SpellModifiers;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.INpc;
|
||||
@@ -143,7 +146,8 @@ public class MindControl extends Spell {
|
||||
/** Returns true if the given entity can be mind controlled (i.e. is not a player, npc, evil wizard or boss). */
|
||||
public static boolean canControl(EntityLivingBase target){
|
||||
return target instanceof EntityLiving && target.isNonBoss() && !(target instanceof INpc)
|
||||
&& !(target instanceof EntityEvilWizard);
|
||||
&& !(target instanceof EntityEvilWizard) && !Arrays.asList(Wizardry.settings.summonedCreatureTargetsBlacklist)
|
||||
.contains(EntityList.getKey(entity.getClass()).toString().toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -697,6 +697,7 @@ config.ebwizardry.cast_command_name=Cast Spell Command Name
|
||||
config.ebwizardry.discoverspell_command_name=Discover Spell Command Name
|
||||
config.ebwizardry.ally_command_name=Set Ally Command Name
|
||||
config.ebwizardry.allies_command_name=View Allies Command Name
|
||||
config.ebwizardry.mind_control_targets_blacklist=Mind Control Targets Blacklist
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire=Mobs Immune To Fire
|
||||
config.ebwizardry.mobs_immune_to_ice=Mobs Immune To Ice
|
||||
@@ -731,6 +732,7 @@ config.ebwizardry.cast_command_name.tooltip=The name of the /cast command. This
|
||||
config.ebwizardry.discoverspell_command_name.tooltip=The name of the /discoverspell command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /discoverspell you would type /magic instead.
|
||||
config.ebwizardry.ally_command_name.tooltip=The name of the /ally command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /ally you would type /magic instead.
|
||||
config.ebwizardry.allies_command_name.tooltip=The name of the /allies command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /allies you would type /magic instead.
|
||||
config.ebwizardry.mind_control_targets_blacklist.tooltip=List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
|
||||
@@ -697,6 +697,7 @@ config.ebwizardry.cast_command_name=Cast Spell Command Name
|
||||
config.ebwizardry.discoverspell_command_name=Discover Spell Command Name
|
||||
config.ebwizardry.ally_command_name=Set Ally Command Name
|
||||
config.ebwizardry.allies_command_name=View Allies Command Name
|
||||
config.ebwizardry.mind_control_targets_blacklist=Mind Control Targets Blacklist
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire=Mobs Immune To Fire
|
||||
config.ebwizardry.mobs_immune_to_ice=Mobs Immune To Ice
|
||||
@@ -731,6 +732,7 @@ config.ebwizardry.cast_command_name.tooltip=The name of the /cast command. This
|
||||
config.ebwizardry.discoverspell_command_name.tooltip=The name of the /discoverspell command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /discoverspell you would type /magic instead.
|
||||
config.ebwizardry.ally_command_name.tooltip=The name of the /ally command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /ally you would type /magic instead.
|
||||
config.ebwizardry.allies_command_name.tooltip=The name of the /allies command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /allies you would type /magic instead.
|
||||
config.ebwizardry.mind_control_targets_blacklist.tooltip=List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
|
||||
Reference in New Issue
Block a user