Skip to content

Commit

Permalink
added disable flight
Browse files Browse the repository at this point in the history
  • Loading branch information
Badbird5907 committed Aug 22, 2022
1 parent 1b7f23c commit 2df3d6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ public static void tag(Player victim, Player attacker) {
victim.sendMessage(StringUtils.format(ConfigValues.getCombatTaggedMessage(), ConfigValues.getCombatTagSeconds() + ""));
if (sendMessageAttacker)
attacker.sendMessage(StringUtils.format(ConfigValues.getCombatTaggedMessage(), ConfigValues.getCombatTagSeconds() + ""));
if (ConfigValues.isDisableFly()) {
victim.setAllowFlight(false);
victim.setFlying(false);
attacker.setAllowFlight(false);
attacker.setFlying(false);
}
}

public static void disconnect(Player player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class ConfigValues {
@Getter
private static boolean enableHologram = true;

@Getter
private static boolean disableFly = false;

@Getter
private static List<String> exemptWorlds;

Expand Down Expand Up @@ -88,6 +91,7 @@ public static void load() {
enableHologram = getConfig().getBoolean("enable-hologram",true);
setDeathMessage = getConfig().getBoolean("set-death-message",true);
exemptWorlds = getConfig().getStringList("exempt-worlds");
disableFly = getConfig().getBoolean("disable.fly",false);
}

public static void reload() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ messages:
blocked-command: '&cYou cannot use that command while in combat.'
exempt-worlds:
- 'world-name-here'
disable:
fly: false
update-check: true

0 comments on commit 2df3d6f

Please sign in to comment.