HCFactions [100% FREE] IDEAS NEEDED

Status
This thread has been locked.

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
You heard right, a free HCF plugin.

So I've had this plugin for a while now, worked on it on and off and I was feeling kind of nice and wanted to share this with everyone.

Features
* Factions
* DTR
* Leaders/Captains/Members
* System Factions
* Land Claiming
* Claiming Wands
* Faction Money hooked into vault for easy access

We all know what HCF is so I'm not going to bother explaining it on here. The source code is all up on GitHub.

Things to Note
This was something that I started a while ago. Some of the code may not be as efficient or pretty as others. I went and cleaned some things up today, but there are still things that I want to change simply because I found better ways of doing it. If you want to leave suggestions please post them under the 'issues' section on GitHub and I will try and take a look at them.

Spigot Link: https://www.spigotmc.org/resources/hcfactions.46717/
GitHub: https://github.com/Irantwomiles/Factions
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
I am a well known Spigot member and as far as I know, free resources do not need to be approved so you must be posting it on premium (btw the wait line is a few days) yet it is on GitHub...? Are you doing something similar to what FactionsUUID did?
Hmm, that weird I'll double check spigot. And what do you mean about factionsuuid
 

BrettPlays

YouTuber & MC Creator BrettPlayMC on Spigot
Premium
Feedback score
21
Posts
1,768
Reactions
768
Resources
4
Hmm, that weird I'll double check spigot. And what do you mean about factionsuuid
FactionsUUID is a premium Spigot plugin but is free to download on GitHub or Jenkins. The developer put it on Spigot as a premium resource so the people that wanted to could support him.
Though, I HIGHLY suggest using Legacy Factions now as a lot of people including me like it:
https://www.spigotmc.org/resources/legacyfactions.40122/
 

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
Yea, I never said it's a core though. Let me know if you should change anything code wise.
You did when I read the title. (Assuming you've since then changed it)...

I'll look at it.
 

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
You did when I read the title. (Assuming you've since then changed it)...

I'll look at it.
Might have misread, anyways its not suppose to be hcf core.[DOUBLEPOST=1504446034][/DOUBLEPOST]
FactionsUUID is a premium Spigot plugin but is free to download on GitHub or Jenkins. The developer put it on Spigot as a premium resource so the people that wanted to could support him.
Though, I HIGHLY suggest using Legacy Factions now as a lot of people including me like it:
https://www.spigotmc.org/resources/legacyfactions.40122/
Oh I see. idk I might. I haven't put too much work into this, and there are already couple places that I think should be improved. For now it'll be completely free and if anyone wants to help me out they can just pm me.[DOUBLEPOST=1504446418][/DOUBLEPOST]https://www.spigotmc.org/resources/hcfactions.46717/

BrettPlays you were right. I had put the resource as a standalone for some reason and that required review. I uploaded it under Bukkit and the link should be working now.[DOUBLEPOST=1504457337][/DOUBLEPOST]Update:

Added death message to config
Moved some methods to Utils class
added world to the config for system factions
 
Last edited:

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
I know this is free and all, but this code looks like it was written by a guy with no java experience whatsoever.

It just looks messy imo.
 

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
How would you go about it, or could you provide an example of a cleaner way of doing something that I've implemented.
You've put all faction subcommands inside one executor, "customlisteners" should just be called events (standard practice), add some database support (Redis DAOs aren't hard, checkout my open source HCF core or my economy system for examples), Instead of holding String UUIDs just hold the object since you can compare UUIDs but strings are a pain in the ass sometimes, You don't need a boolean called "raidable" just check if the dtr is below 0, hold claims in an object and use the Redis DAO system I mentioned beforehand to save and load them (it serialises the class using GSON and loads it through the same way, easier for expansion), instead of holding captains in a separate list create an enum with the faction roles and store that data inside a hashmap keyed by the member's uuid, do you really need a seperate faction system for systemfactions..?

That's all I can see through a quick analysis, I'd be happy to go through it with you on a skype call or whatever.
 

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
You've put all faction subcommands inside one executor, "customlisteners" should just be called events (standard practice), add some database support (Redis DAOs aren't hard, checkout my open source HCF core or my economy system for examples), Instead of holding String UUIDs just hold the object since you can compare UUIDs but strings are a pain in the ass sometimes, You don't need a boolean called "raidable" just check if the dtr is below 0, hold claims in an object and use the Redis DAO system I mentioned beforehand to save and load them (it serialises the class using GSON and loads it through the same way, easier for expansion), instead of holding captains in a separate list create an enum with the faction roles and store that data inside a hashmap keyed by the member's uuid, do you really need a seperate faction system for systemfactions..?

That's all I can see through a quick analysis, I'd be happy to go through it with you on a skype call or whatever.
Alright thanks. I can't do the database because my pc is broken and only have a mac and its just a pain to use. But I'll look at the rest.
 

Marto

Feedback score
1
Posts
18
Reactions
6
Resources
0
I looked through your code and saw you did some extra steps for detecting claim movements. I used WorldEdit CuboidSelections for a game I made a while back (the teams were preset so you would have to attach a CuboidSelection object to each faction and then loop through all factions). Here you go. I think it might interest you. Also please let me know if you would consider this method inefficient.

Code:
//CommandManager class
public static Location blueSpawn = new Location(Bukkit.getServer().getWorld("flat"), 0.5, 5, 314.5, 180, 0);
    public static Location redSpawn = new Location(Bukkit.getServer().getWorld("flat"), 0.5, 5, -314.5, 0, 0);
    static Location red1 = new Location(Bukkit.getServer().getWorld("flat"), -14, 0, -300);
    static Location red2 = new Location(Bukkit.getServer().getWorld("flat"), 14, 256, -328);
    static Location blue1 = new Location(Bukkit.getServer().getWorld("flat"), 14, 0, 300);
    static Location blue2 = new Location(Bukkit.getServer().getWorld("flat"), -14, 256, 328);
    static Location koth1 = new Location(Bukkit.getServer().getWorld("flat"), -22, 0, -22);
    static Location koth2 = new Location(Bukkit.getServer().getWorld("flat"), 22, 256, 22);
    static Location cap1 = new Location(Bukkit.getServer().getWorld("flat"), 8.7, 0, 8.7);
    static Location cap2 = new Location(Bukkit.getServer().getWorld("flat"), -7.7, 256, -7.7);
    public static CuboidSelection red = new CuboidSelection(Bukkit.getServer().getWorld("flat"), red1, red2);
    public static CuboidSelection blue = new CuboidSelection(Bukkit.getServer().getWorld("flat"), blue1, blue2);
    public static CuboidSelection koth = new CuboidSelection(Bukkit.getServer().getWorld("flat"), koth1, koth2);
    public static CuboidSelection cap = new CuboidSelection(Bukkit.getServer().getWorld("flat"), cap1, cap2);

//EventManager class
@EventHandler
    public void onPlayerMove(PlayerMoveEvent e) {
        if (GameState.getState() != GameState.IN_GAME)
            return;
        if (CommandManager.blue.contains(e.getTo()) && !(CommandManager.blue.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are now in " + ChatColor.BLUE + "Blue" + ChatColor.YELLOW
                    + "'s territory!");
        } else if (CommandManager.blue.contains(e.getFrom()) && !(CommandManager.blue.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.BLUE + "Blue"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.red.contains(e.getTo()) && !(CommandManager.red.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(
                    ChatColor.YELLOW + "You are now in " + ChatColor.RED + "Red" + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.red.contains(e.getFrom()) && !(CommandManager.red.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.RED + "Red"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.koth.contains(e.getTo()) && !(CommandManager.koth.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are now in " + ChatColor.LIGHT_PURPLE + "KOTH"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.koth.contains(e.getFrom()) && !(CommandManager.koth.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.LIGHT_PURPLE + "KOTH"
                    + ChatColor.YELLOW + "'s territory!");
//koth code below
 

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
I looked through your code and saw you did some extra steps for detecting claim movements. I used WorldEdit CuboidSelections for a game I made a while back (the teams were preset so you would have to attach a CuboidSelection object to each faction and then loop through all factions). Here you go. I think it might interest you. Also please let me know if you would consider this method inefficient.

Code:
//CommandManager class
public static Location blueSpawn = new Location(Bukkit.getServer().getWorld("flat"), 0.5, 5, 314.5, 180, 0);
    public static Location redSpawn = new Location(Bukkit.getServer().getWorld("flat"), 0.5, 5, -314.5, 0, 0);
    static Location red1 = new Location(Bukkit.getServer().getWorld("flat"), -14, 0, -300);
    static Location red2 = new Location(Bukkit.getServer().getWorld("flat"), 14, 256, -328);
    static Location blue1 = new Location(Bukkit.getServer().getWorld("flat"), 14, 0, 300);
    static Location blue2 = new Location(Bukkit.getServer().getWorld("flat"), -14, 256, 328);
    static Location koth1 = new Location(Bukkit.getServer().getWorld("flat"), -22, 0, -22);
    static Location koth2 = new Location(Bukkit.getServer().getWorld("flat"), 22, 256, 22);
    static Location cap1 = new Location(Bukkit.getServer().getWorld("flat"), 8.7, 0, 8.7);
    static Location cap2 = new Location(Bukkit.getServer().getWorld("flat"), -7.7, 256, -7.7);
    public static CuboidSelection red = new CuboidSelection(Bukkit.getServer().getWorld("flat"), red1, red2);
    public static CuboidSelection blue = new CuboidSelection(Bukkit.getServer().getWorld("flat"), blue1, blue2);
    public static CuboidSelection koth = new CuboidSelection(Bukkit.getServer().getWorld("flat"), koth1, koth2);
    public static CuboidSelection cap = new CuboidSelection(Bukkit.getServer().getWorld("flat"), cap1, cap2);

//EventManager class
@EventHandler
    public void onPlayerMove(PlayerMoveEvent e) {
        if (GameState.getState() != GameState.IN_GAME)
            return;
        if (CommandManager.blue.contains(e.getTo()) && !(CommandManager.blue.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are now in " + ChatColor.BLUE + "Blue" + ChatColor.YELLOW
                    + "'s territory!");
        } else if (CommandManager.blue.contains(e.getFrom()) && !(CommandManager.blue.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.BLUE + "Blue"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.red.contains(e.getTo()) && !(CommandManager.red.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(
                    ChatColor.YELLOW + "You are now in " + ChatColor.RED + "Red" + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.red.contains(e.getFrom()) && !(CommandManager.red.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.RED + "Red"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.koth.contains(e.getTo()) && !(CommandManager.koth.contains(e.getFrom()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are now in " + ChatColor.LIGHT_PURPLE + "KOTH"
                    + ChatColor.YELLOW + "'s territory!");
        } else if (CommandManager.koth.contains(e.getFrom()) && !(CommandManager.koth.contains(e.getTo()))) {
            e.getPlayer().sendMessage(ChatColor.YELLOW + "You are no longer in " + ChatColor.LIGHT_PURPLE + "KOTH"
                    + ChatColor.YELLOW + "'s territory!");
//koth code below
Hey thanks for the reply. I've tried using worldedit for selections before and I would always come across problems when it came to saving/loading the cuboid, which is mainly why I used my own. I'm sure what you posted works just fine, I'm just not that familiar with WorldEdit to use it.
 

Marto

Feedback score
1
Posts
18
Reactions
6
Resources
0
Hey thanks for the reply. I've tried using worldedit for selections before and I would always come across problems when it came to saving/loading the cuboid, which is mainly why I used my own. I'm sure what you posted works just fine, I'm just not that familiar with WorldEdit to use it.
Ah ok. Good luck with your projects. Looks good. :)
 

BrianGrug

Full time failure
Supreme
Feedback score
56
Posts
1,473
Reactions
995
Resources
1
are we allowed to make forks and release etc [ not to sell ] ?
*Developer releases something for free
*Other devs: Can we sell forks of this?
And that's how iHCF went down kids
 

Saferoom

Meme machine
Premium
Feedback score
8
Posts
340
Reactions
116
Resources
0
ily <3
 

Irantwomiles

Check my signature for a new Practice plugin
Premium
Feedback score
3
Posts
1,263
Reactions
570
Resources
0
I've been kind of bored since my PC is being repaired and I've started work on a new addition to this called FactionsExtra.

Features:
- Add potion effects to your claim using Faction Money.
- Add traps to base using Faction Money.
- Add Protection wall when faction goes raidable using Faction Money.
(More will be added as I think of more, or people suggest things)
- Note this is a separate plugin so you can easily remove it to disable it from your server.

Price
- I will always keep the core Factions part available for free, but I do want some kind of return on the time
I have spent on this.
- $8 for FactionsExtra

When?
- Not really sure yet, school is top priority so whenever I have time I will work on this side project.
- It's not that big of a plugin since I've done the "hard" part with Factions and I have a really good base that I can use to go off of to add features fairly easily.

Coming later
- I want to add a side plugin for Kits as well (Bard, Archer, Miner). Not sure if it will be paid yet, but that is something I'm planning on adding.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
So I found a few errors. When disbanding a faction it says %faction% instead of the faction, and sometimes there are a few issues where it doesn't send msgs.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
Ok, I will take a look. Also what do you mean it doesn't send messages
it doesn't exactly send things, quite minor but it mit no look great. i.e when I do /sf create it doesn't send a msg like usage: /sf create <name>. quite minor things like that, but I guess its up to you if u wanna fix it.
 
Status
This thread has been locked.
Top