Skip to content

Commit 4b66002

Browse files
committed
Hopefully should work now
1 parent c1bf490 commit 4b66002

4 files changed

Lines changed: 162 additions & 137 deletions

File tree

src/main/java/adhdmc/nerffarms/NerfFarms.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public final class NerfFarms extends JavaPlugin {
1717
public static NerfFarms plugin;
1818
public final MiniMessage miniMessage = MiniMessage.miniMessage();
19-
public final String version = "0.0.8";
19+
public final String version = "0.0.9";
2020

2121
@Override
2222
public void onEnable() {
@@ -45,9 +45,11 @@ private void configDefaults() {
4545
config.addDefault("blacklisted-spawn-types", List.of("CUSTOM"));
4646
config.addDefault("blacklisted-below", Arrays.asList("MAGMA_BLOCK", "HONEY_BLOCK", "LAVA"));
4747
config.addDefault("blacklisted-in", Arrays.asList("HONEY_BLOCK", "LAVA", "BUBBLE_COLUMN"));
48+
config.addDefault("allow-projectile-damage", true);
4849
config.addDefault("require-path", false);
4950
config.addDefault("require-line-of-sight", false);
50-
config.addDefault("require-no-obstructions", false);
51+
config.addDefault("skeletons-can-damage-creepers", true);
52+
config.addDefault("withers-can-damage-entities", true);
5153
config.addDefault("max-distance", 15);
5254
config.addDefault("disallowed-damage-types", Arrays.asList("FALL", "FALLING_BLOCK", "LAVA", "DROWNING"));
5355
config.addDefault("max-disallowed-damage-percent", 75);

src/main/java/adhdmc/nerffarms/config/ConfigParser.java

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public enum ModType {EXP, DROPS, BOTH, NEITHER}
2525
private static boolean nerfHostilesOnly = true;
2626
private static boolean requirePath = false;
2727
private static boolean requireLineOfSight = false;
28-
private static boolean requireNoObstructions = false;
28+
private static boolean allowProjectileDamage = true;
29+
private static boolean skeletonsDamageCreepers = true;
30+
private static boolean withersDamageEntities = true;
2931
private static boolean debug = false;
3032

3133
public static void validateConfig() {
@@ -43,7 +45,9 @@ public static void validateConfig() {
4345
nerfHostilesOnly = true;
4446
requirePath = false;
4547
requireLineOfSight = false;
46-
requireNoObstructions = false;
48+
allowProjectileDamage = true;
49+
skeletonsDamageCreepers = true;
50+
withersDamageEntities = true;
4751
debug = false;
4852
FileConfiguration config = NerfFarms.plugin.getConfig();
4953
List<String> standStringList = config.getStringList("blacklisted-below");
@@ -57,7 +61,9 @@ public static void validateConfig() {
5761
boolean nerfHostilesBoolean = config.getBoolean("only-nerf-hostiles");
5862
boolean requirePathBoolean = config.getBoolean("require-path");
5963
boolean requireLineOfSightBoolean = config.getBoolean("require-line-of-sight");
60-
boolean requireNoObstructionsBoolean = config.getBoolean("require-no-obstructions");
64+
boolean allowProjectileDamageBoolean = config.getBoolean("allow-projectile-damage");
65+
boolean skeletonsDamageCreepersBoolean = config.getBoolean("skeletons-can-damage-creepers");
66+
boolean withersDamageEntitiesBoolean = config.getBoolean("withers-can-damage-entities");
6167
boolean debugSetting = config.getBoolean("debug");
6268

6369
// Assemble the Stand On BlackList
@@ -153,7 +159,9 @@ public static void validateConfig() {
153159
nerfHostilesOnly = nerfHostilesBoolean;
154160
requirePath = requirePathBoolean;
155161
requireLineOfSight = requireLineOfSightBoolean;
156-
requireNoObstructions = requireNoObstructionsBoolean;
162+
allowProjectileDamage = allowProjectileDamageBoolean;
163+
skeletonsDamageCreepers = skeletonsDamageCreepersBoolean;
164+
withersDamageEntities = withersDamageEntitiesBoolean;
157165
debug = debugSetting;
158166
}
159167

@@ -206,9 +214,16 @@ public static boolean isRequirePath() {
206214
public static boolean isRequireLineOfSight() {
207215
return requireLineOfSight;
208216
}
217+
public static boolean isAllowProjectileDamage() {
218+
return allowProjectileDamage;
219+
}
220+
221+
public static boolean isSkeletonsDamageCreepers() {
222+
return skeletonsDamageCreepers;
223+
}
209224

210-
public static boolean isRequireNoObstructions() {
211-
return requireNoObstructions;
225+
public static boolean isWithersDamageEntities() {
226+
return withersDamageEntities;
212227
}
213228

214229
public static boolean isDebug() {

0 commit comments

Comments
 (0)