Skip to content

Commit

Permalink
Add permission to plugin.yml, fix config defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
RhythmicSys committed Jan 17, 2023
1 parent f7f143e commit acbed87
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
31 changes: 15 additions & 16 deletions src/main/java/adhdmc/nerffarms/util/Defaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,32 @@ public class Defaults {
public static void configDefaults() {
FileConfiguration config = NerfFarms.getInstance().getConfig();
config.addDefault("debug", 0);
config.addDefault("only-nerf-hostiles", true);
config.addDefault("whitelisted-mobs", List.of(""));
config.addDefault("blacklisted-mobs", List.of(""));
config.addDefault("modification-type", "BOTH");
config.addDefault("whitelisted-spawn-reasons", List.of("CUSTOM"));
config.addDefault("blacklisted-spawn-reasons", List.of(""));
config.addDefault("blacklisted-below", Arrays.asList("MAGMA_BLOCK", "HONEY_BLOCK", "LAVA"));
config.addDefault("blacklisted-in", Arrays.asList("HONEY_BLOCK", "LAVA", "BUBBLE_COLUMN"));
config.addDefault("allow-projectile-damage", true);
config.addDefault("only-nerf-hostiles", true);
config.addDefault("require-path", true);
config.addDefault("require-open-surroundings", true);
config.addDefault("require-line-of-sight", true);
config.addDefault("skeletons-can-damage-creepers", true);
config.addDefault("withers-can-damage-entities", true);
config.addDefault("frogs-can-eat-slimes", true);
config.addDefault("frogs-can-eat-magma-cubes", true);
config.addDefault("skeletons-can-damage-creepers", true);
config.addDefault("withers-can-damage-entities", true);
config.addDefault("iron-golems-can-damage-entities", false);
config.addDefault("whitelist-mobs-with-weakness", true);
config.addDefault("whitelist-mobs-in-vehicles", false);
config.addDefault("whitelist-named-mobs", false);
config.addDefault("whitelist-leashed-mobs", true);
config.addDefault("modification-type", "BOTH");
config.addDefault("max-distance", 15);
config.addDefault("max-height-difference", 10);
config.addDefault("max-blacklisted-damage-percent", 75);
config.addDefault("whitelisted-mobs", List.of(""));
config.addDefault("blacklisted-mobs", List.of(""));
config.addDefault("blacklisted-damage-types", Arrays.asList("BLOCK_EXPLOSION", "CONTACT", "CRAMMING",
"DRAGON_BREATH", "DROWNING", "DRYOUT", "FALL", "FALLING_BLOCK", "FIRE", "FIRE_TICK", "FREEZE", "HOT_FLOOR",
"LAVA", "LIGHTNING", "SUFFOCATION", "SUICIDE"));
config.addDefault("max-blacklisted-damage-percent", 75);
config.addDefault("whitelist-mobs-with-weakness", true);
config.addDefault("whitelist-mobs-in-vehicles", false);
config.addDefault("whitelist-named-mobs", false);
config.addDefault("whitelist-leashed-mobs", true);
config.addDefault("whitelisted-spawn-reasons", List.of("CUSTOM"));
config.addDefault("blacklisted-spawn-reasons", List.of(""));
config.addDefault("blacklisted-pickups-mob", List.of(""));
config.addDefault("blacklisted-below", Arrays.asList("MAGMA_BLOCK", "HONEY_BLOCK", "LAVA"));
config.addDefault("blacklisted-in", Arrays.asList("HONEY_BLOCK", "LAVA", "BUBBLE_COLUMN"));
}
}
2 changes: 0 additions & 2 deletions src/main/java/adhdmc/nerffarms/util/NFToggles.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public enum NFToggles {
ALLOW_IRON_GOLEM_DAMAGE(false),
//Nerfing checks
REQUIRE_PATH(true),
REQUIRE_OPEN_SURROUNDINGS(true),
REQUIRE_LINE_OF_SIGHT(true),
ALLOW_PROJECTILE_DAMAGE(true),
WHITELIST_WEAKNESS(true),
Expand Down Expand Up @@ -41,7 +40,6 @@ public static void reloadToggles(){
ALLOW_FROG_MAGMA_CUBE_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("frogs-can-eat-magma-cubes"));
ALLOW_IRON_GOLEM_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("iron-golems-can-damage-entities"));
REQUIRE_PATH.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-path"));
REQUIRE_OPEN_SURROUNDINGS.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-open-surroundings"));
REQUIRE_LINE_OF_SIGHT.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("require-line-of-sight"));
ALLOW_PROJECTILE_DAMAGE.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("allow-projectile-damage"));
WHITELIST_WEAKNESS.setEnabled(NerfFarms.getInstance().getConfig().getBoolean("whitelist-mobs-with-weakness"));
Expand Down
13 changes: 8 additions & 5 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@
#only change this if asked
debug: 0

allow-projectile-damage: true

only-nerf-hostiles: true

require-path: true

require-line-of-sight: true

only-nerf-hostiles: true
frogs-can-eat-slimes: true

allow-projectile-damage: true
frogs-can-eat-magma-cubes: true

skeletons-can-damage-creepers: true

withers-can-damage-entities: true

frogs-can-eat-slimes: true

frogs-can-eat-magma-cubes: true
iron-golems-can-damage-entities:

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

blacklisted-spawn-reasons:
#- SPAWNER

blacklisted-pickups-mob:
#- ZOMBIE

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ permissions:
default: op
nerffarms.reload:
description: Allows user to reload the configuration
default: op
nerffarms.bypass:
description: Allows a user to bypass nerf checks, allowing mobs to drop all xp and loot on death when killed by the player
default: op

0 comments on commit acbed87

Please sign in to comment.