Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(f fly): Change in the fly faction system #285

Open
wants to merge 1 commit into
base: 1.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/main/java/com/massivecraft/factions/cmd/CmdFly.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
public class CmdFly extends FCommand {

public static final boolean fly = FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight");
private static final boolean flyNeedsUpgrade = FactionsPlugin.getInstance().getConfig().getBoolean("ffly.need-faction-upgrade");
public static List<UUID> falseList = new ArrayList<>();

/**
* @author FactionsUUID Team - Modified By CmdrKittens
* @author FactionsUUID Team - Modified By CmdrKittens and vSKAH
*/


Expand Down Expand Up @@ -56,6 +57,12 @@ private void toggleFlight(final CommandContext context, final boolean toggle, bo
falseList.add(context.fPlayer.getPlayer().getUniqueId());
return;
}

if (flyNeedsUpgrade && context.faction.getUpgrade("Fly") == 0 && !context.fPlayer.isAdminBypassing()) {
context.msg(TL.COMMAND_FLY_NEED_UPGRADE);
return;
}

// Do checks if true
if (!flyTest(context, notify)) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/massivecraft/factions/zcore/util/TL.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ public enum TL {
COMMAND_DISBAND_CONFIRM("&c&l[!]&7 Your Faction has&c {tnt} &7tnt left in the bank, it will be &clost&7 if the faction is &cdisbanded&7. Type&c /f disband &7again within &c10&7 seconds to&c disband&7."),
COMMAND_DISBAND_DESCRIPTION("Disband a faction"),

COMMAND_FLY_NEED_UPGRADE("&c&l[!]&7 You need to upgrade your faction to use this feature."),
COMMAND_FLY_DISABLED("&c&l[!]&7 Sorry, Faction flight is &cdisabled &7on this server."),
COMMAND_FLY_DESCRIPTION("Enter or leave Faction flight mode"),
COMMAND_FLY_CHANGE("&c&l[!]&7 Faction flight has been &c%1$s&7."),
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ffly:
disable-flight-on-generic-damage: false #Any Damage a Player Takes Their Flight Will Be Disabled
disable-flight-on-mob-damage: false #Any Damage a Player Takes From A Mob Their Flight Will Be Disabled
disable-flight-on-player-damage: true
need-faction-upgrade: true #If you want to require a faction upgrade to use fly

# If a player leaves fly (out of territory or took damage)
# how long should they not take fall damage for?
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/configuration/upgrades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fupgrades:
- "Chest"
- "Members"
- "Armor"
- "Fly"
MainMenu:
Rows: 5
Title: '&8&l{faction}''s Upgrade Menu'
Expand Down Expand Up @@ -199,6 +200,21 @@ fupgrades:
- ''
- '&7&o(( Tip: &f&oleft-click&7&o to &c&oupgrade&7&o ))'
Slot: 23
Fly: #When your faction has this upgrade members don't need permission factions.fly to fly in their claims
Max-Level: 1
Cost:
level-1: 1000000
DisplayItem:
Name: '&c&lF Fly'
Type: FEATHER #MUST BE PLAYER_HEAD FOR TEXTURE TO WORK!
Texture: '' #Hash of skull here from minecraft-heads.com
Lore:
- '&7&oAllows &e&ofly&7&o in &c&oclaims&7&o.'
- ''
- '&4&l* &cCost: &f$1,000,000'
- ''
- '&7&o(( Tip: &f&oleft-click&7&o to &c&oupgrade&7&o ))'
Slot: 25
Spawners:
Max-Level: 3
Spawner-Boost:
Expand Down