Skip to content

Commit acbed87

Browse files
committed
Add permission to plugin.yml, fix config defaults
1 parent f7f143e commit acbed87

4 files changed

Lines changed: 26 additions & 23 deletions

File tree

src/main/java/adhdmc/nerffarms/util/Defaults.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,32 @@ public class Defaults {
1010
public static void configDefaults() {
1111
FileConfiguration config = NerfFarms.getInstance().getConfig();
1212
config.addDefault("debug", 0);
13-
config.addDefault("only-nerf-hostiles", true);
14-
config.addDefault("whitelisted-mobs", List.of(""));
15-
config.addDefault("blacklisted-mobs", List.of(""));
16-
config.addDefault("modification-type", "BOTH");
17-
config.addDefault("whitelisted-spawn-reasons", List.of("CUSTOM"));
18-
config.addDefault("blacklisted-spawn-reasons", List.of(""));
19-
config.addDefault("blacklisted-below", Arrays.asList("MAGMA_BLOCK", "HONEY_BLOCK", "LAVA"));
20-
config.addDefault("blacklisted-in", Arrays.asList("HONEY_BLOCK", "LAVA", "BUBBLE_COLUMN"));
2113
config.addDefault("allow-projectile-damage", true);
14+
config.addDefault("only-nerf-hostiles", true);
2215
config.addDefault("require-path", true);
23-
config.addDefault("require-open-surroundings", true);
2416
config.addDefault("require-line-of-sight", true);
25-
config.addDefault("skeletons-can-damage-creepers", true);
26-
config.addDefault("withers-can-damage-entities", true);
2717
config.addDefault("frogs-can-eat-slimes", true);
2818
config.addDefault("frogs-can-eat-magma-cubes", true);
19+
config.addDefault("skeletons-can-damage-creepers", true);
20+
config.addDefault("withers-can-damage-entities", true);
2921
config.addDefault("iron-golems-can-damage-entities", false);
22+
config.addDefault("whitelist-mobs-with-weakness", true);
23+
config.addDefault("whitelist-mobs-in-vehicles", false);
24+
config.addDefault("whitelist-named-mobs", false);
25+
config.addDefault("whitelist-leashed-mobs", true);
26+
config.addDefault("modification-type", "BOTH");
3027
config.addDefault("max-distance", 15);
3128
config.addDefault("max-height-difference", 10);
29+
config.addDefault("max-blacklisted-damage-percent", 75);
30+
config.addDefault("whitelisted-mobs", List.of(""));
31+
config.addDefault("blacklisted-mobs", List.of(""));
3232
config.addDefault("blacklisted-damage-types", Arrays.asList("BLOCK_EXPLOSION", "CONTACT", "CRAMMING",
3333
"DRAGON_BREATH", "DROWNING", "DRYOUT", "FALL", "FALLING_BLOCK", "FIRE", "FIRE_TICK", "FREEZE", "HOT_FLOOR",
3434
"LAVA", "LIGHTNING", "SUFFOCATION", "SUICIDE"));
35-
config.addDefault("max-blacklisted-damage-percent", 75);
36-
config.addDefault("whitelist-mobs-with-weakness", true);
37-
config.addDefault("whitelist-mobs-in-vehicles", false);
38-
config.addDefault("whitelist-named-mobs", false);
39-
config.addDefault("whitelist-leashed-mobs", true);
35+
config.addDefault("whitelisted-spawn-reasons", List.of("CUSTOM"));
36+
config.addDefault("blacklisted-spawn-reasons", List.of(""));
4037
config.addDefault("blacklisted-pickups-mob", List.of(""));
38+
config.addDefault("blacklisted-below", Arrays.asList("MAGMA_BLOCK", "HONEY_BLOCK", "LAVA"));
39+
config.addDefault("blacklisted-in", Arrays.asList("HONEY_BLOCK", "LAVA", "BUBBLE_COLUMN"));
4140
}
4241
}

src/main/java/adhdmc/nerffarms/util/NFToggles.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public enum NFToggles {
1212
ALLOW_IRON_GOLEM_DAMAGE(false),
1313
//Nerfing checks
1414
REQUIRE_PATH(true),
15-
REQUIRE_OPEN_SURROUNDINGS(true),
1615
REQUIRE_LINE_OF_SIGHT(true),
1716
ALLOW_PROJECTILE_DAMAGE(true),
1817
WHITELIST_WEAKNESS(true),
@@ -41,7 +40,6 @@ public static void reloadToggles(){
4140
ALLOW_FROG_MAGMA_CUBE_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("frogs-can-eat-magma-cubes"));
4241
ALLOW_IRON_GOLEM_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("iron-golems-can-damage-entities"));
4342
REQUIRE_PATH.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-path"));
44-
REQUIRE_OPEN_SURROUNDINGS.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-open-surroundings"));
4543
REQUIRE_LINE_OF_SIGHT.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-line-of-sight"));
4644
ALLOW_PROJECTILE_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("allow-projectile-damage"));
4745
WHITELIST_WEAKNESS.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("whitelist-mobs-with-weakness"));

src/main/resources/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,23 @@
1717
#only change this if asked
1818
debug: 0
1919

20+
allow-projectile-damage: true
21+
22+
only-nerf-hostiles: true
23+
2024
require-path: true
2125

2226
require-line-of-sight: true
2327

24-
only-nerf-hostiles: true
28+
frogs-can-eat-slimes: true
2529

26-
allow-projectile-damage: true
30+
frogs-can-eat-magma-cubes: true
2731

2832
skeletons-can-damage-creepers: true
2933

3034
withers-can-damage-entities: true
3135

32-
frogs-can-eat-slimes: true
33-
34-
frogs-can-eat-magma-cubes: true
36+
iron-golems-can-damage-entities:
3537

3638
#Conditions where a mob should not be nerfed, even if it was previously marked to be nerfed
3739
whitelist-mobs-with-weakness: true
@@ -81,6 +83,7 @@ whitelisted-spawn-reasons:
8183

8284
blacklisted-spawn-reasons:
8385
#- SPAWNER
86+
8487
blacklisted-pickups-mob:
8588
#- ZOMBIE
8689

src/main/resources/plugin.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ permissions:
1515
default: op
1616
nerffarms.reload:
1717
description: Allows user to reload the configuration
18+
default: op
19+
nerffarms.bypass:
20+
description: Allows a user to bypass nerf checks, allowing mobs to drop all xp and loot on death when killed by the player
1821
default: op

0 commit comments

Comments
 (0)