@@ -17,14 +17,15 @@ public enum ModType {EXP, DROPS, BOTH, NEITHER}
1717 private static final HashSet <Material > insideBlacklist = new HashSet <>();
1818 private static final HashSet <EntityType > bypassList = new HashSet <>();
1919 private static final HashSet <CreatureSpawnEvent .SpawnReason > spawnReasonList = new HashSet <>();
20- private static final HashSet <EntityDamageEvent .DamageCause > damageCauseWhitelist = new HashSet <>();
21- private static final HashSet <EntityDamageEvent .DamageCause > environmentalDamage = new HashSet <>();
20+ private static final HashSet <EntityDamageEvent .DamageCause > disallowedDamageTypes = new HashSet <>();
2221 private static ModType modType = ModType .NEITHER ;
2322 private static int maxDistance = 0 ;
2423 private static int errorCount = 0 ;
2524 private static int maxDisallowedDamage = 100 ;
2625 private static boolean nerfHostilesOnly = true ;
27- private static boolean requireTargeting = false ;
26+ private static boolean requirePath = false ;
27+ private static boolean requireLineOfSight = false ;
28+ private static boolean requireNoObstructions = false ;
2829 private static boolean debug = false ;
2930
3031 public static void validateConfig () {
@@ -34,25 +35,29 @@ public static void validateConfig() {
3435 insideBlacklist .clear ();
3536 bypassList .clear ();
3637 spawnReasonList .clear ();
37- damageCauseWhitelist .clear ();
38+ disallowedDamageTypes .clear ();
3839 modType = null ;
3940 maxDistance = 0 ;
4041 errorCount = 0 ;
4142 maxDisallowedDamage = 100 ;
4243 nerfHostilesOnly = true ;
43- requireTargeting = false ;
44+ requirePath = false ;
45+ requireLineOfSight = false ;
46+ requireNoObstructions = false ;
4447 debug = false ;
4548 FileConfiguration config = NerfFarms .plugin .getConfig ();
4649 List <String > standStringList = config .getStringList ("blacklisted-below" );
4750 List <String > inStringList = config .getStringList ("blacklisted-in" );
4851 List <String > bypassStringList = config .getStringList ("bypass" );
4952 List <String > spawnReasonStringList = config .getStringList ("blacklisted-spawn-types" );
50- List <String > environmentalDamageList = config .getStringList ("disallowed-damage-types" );
53+ List <String > disallowedDamageTypesList = config .getStringList ("disallowed-damage-types" );
5154 String modificationTypeString = config .getString ("modification-type" );
5255 int maxDistanceInt = config .getInt ("max-distance" );
53- int maxDisallowedDamage = config .getInt ("damage-buffer -percent" );
56+ int maxDisallowedDamage = config .getInt ("max-disallowed-damage -percent" );
5457 boolean nerfHostilesBoolean = config .getBoolean ("only-nerf-hostiles" );
55- boolean requireTargetingBoolean = config .getBoolean ("require-path" );
58+ boolean requirePathBoolean = config .getBoolean ("require-path" );
59+ boolean requireLineOfSightBoolean = config .getBoolean ("require-line-of-sight" );
60+ boolean requireNoObstructionsBoolean = config .getBoolean ("require-no-obstructions" );
5661 boolean debugSetting = config .getBoolean ("debug" );
5762
5863 // Assemble the Stand On BlackList
@@ -109,15 +114,15 @@ public static void validateConfig() {
109114 }
110115
111116 // Generate Environmental Causes
112- for (String type : environmentalDamageList ) {
117+ for (String type : disallowedDamageTypesList ) {
113118 try {
114119 EntityDamageEvent .DamageCause .valueOf (type );
115120 } catch (IllegalArgumentException e ) {
116121 NerfFarms .plugin .getLogger ().warning (type + " is not a valid damage type. Please check that you have entered this correctly." );
117122 errorCount = errorCount + 1 ;
118123 continue ;
119124 }
120- environmentalDamage .add (EntityDamageEvent .DamageCause .valueOf (type ));
125+ disallowedDamageTypes .add (EntityDamageEvent .DamageCause .valueOf (type ));
121126 }
122127
123128 // Determine modType
@@ -146,7 +151,9 @@ public static void validateConfig() {
146151
147152 // Set Booleans
148153 nerfHostilesOnly = nerfHostilesBoolean ;
149- requireTargeting = requireTargetingBoolean ;
154+ requirePath = requirePathBoolean ;
155+ requireLineOfSight = requireLineOfSightBoolean ;
156+ requireNoObstructions = requireNoObstructionsBoolean ;
150157 debug = debugSetting ;
151158 }
152159
@@ -166,8 +173,8 @@ public static Set<CreatureSpawnEvent.SpawnReason> getSpawnReasonList() {
166173 return Collections .unmodifiableSet (spawnReasonList );
167174 }
168175
169- public static Set <EntityDamageEvent .DamageCause > getEnvironmentalDamageSet () {
170- return Collections .unmodifiableSet (environmentalDamage );
176+ public static Set <EntityDamageEvent .DamageCause > getdisallowedDamageTypesSet () {
177+ return Collections .unmodifiableSet (disallowedDamageTypes );
171178 }
172179
173180 /**
@@ -192,8 +199,16 @@ public static boolean isNerfHostilesOnly() {
192199 return nerfHostilesOnly ;
193200 }
194201
195- public static boolean isRequireTargeting () {
196- return requireTargeting ;
202+ public static boolean isRequirePath () {
203+ return requirePath ;
204+ }
205+
206+ public static boolean isRequireLineOfSight () {
207+ return requireLineOfSight ;
208+ }
209+
210+ public static boolean isRequireNoObstructions () {
211+ return requireNoObstructions ;
197212 }
198213
199214 public static boolean isDebug () {
0 commit comments