-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from 778b/5-11-version
1.1 version
- Loading branch information
Showing
42 changed files
with
848 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ plugins { | |
} | ||
|
||
group = 'io.github.lofrol' | ||
version = '1.0' | ||
version = '1.1' | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...o/github/lofrol/UselessClan/ClanCommands/Commands/AdminCommands/treasureAdminCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.github.lofrol.UselessClan.ClanCommands.Commands.AdminCommands; | ||
|
||
import io.github.lofrol.UselessClan.ClanCommands.Commands.CommandBase; | ||
import io.github.lofrol.UselessClan.ClanObjects.Clan; | ||
import io.github.lofrol.UselessClan.UselessClan; | ||
import io.github.lofrol.UselessClan.Utils.ChatSender; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class treasureAdminCommand extends CommandBase { | ||
@Override | ||
public boolean havePermission(CommandSender sender) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NotNull String commandDescription() { | ||
return "Description.Admin.treasure"; | ||
} | ||
|
||
|
||
@Override | ||
public boolean executeCommand(CommandSender sender, String[] args) { | ||
if (args.length == 1) { | ||
ChatSender.MessageTo(sender, "&4UselessClan","You forgot about clan %name, use /ClAd home %name, %name = name of clan"); | ||
} | ||
else { | ||
Clan findedClan = UselessClan.getMainManager().getServerClans().get(args[1]); | ||
if (findedClan == null) { | ||
ChatSender.MessageTo(sender, "&4UselessClan","&cThis clan didnt exist!"); | ||
return false; | ||
} | ||
if (sender instanceof Player tempPlayer) tempPlayer.teleport(findedClan.getTreasureClan()); | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...o/github/lofrol/UselessClan/ClanCommands/Commands/CommandsManager/PluginClanCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.github.lofrol.UselessClan.ClanCommands.Commands.CommandsManager; | ||
|
||
import io.github.lofrol.UselessClan.ClanCommands.Commands.CommandBase; | ||
import io.github.lofrol.UselessClan.ClanCommands.Commands.DefaultCommands.*; | ||
import io.github.lofrol.UselessClan.ClanCommands.Commands.PlayerCommandBase; | ||
import io.github.lofrol.UselessClan.ClanCommands.Commands.PluginCommands.reloadGeneralCommand; | ||
import io.github.lofrol.UselessClan.ClanCommands.Commands.PluginCommands.versionUserCommand; | ||
import io.github.lofrol.UselessClan.ClanObjects.Clan; | ||
import io.github.lofrol.UselessClan.ClanObjects.EClanRole; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Map; | ||
|
||
import static java.util.Map.entry; | ||
|
||
public class PluginClanCommands { | ||
private static final Map<String, CommandBase> ClanCommands = Map.ofEntries( | ||
entry("version", new versionUserCommand()), | ||
entry("reload", new reloadGeneralCommand()) | ||
); | ||
|
||
public static CommandBase getCommand(String key) { | ||
return ClanCommands.get(key); | ||
} | ||
|
||
public static @NotNull Collection<PlayerCommandBase> getExecutableCommands(Player tempPlayer, Clan senderClan, EClanRole senderRole) { | ||
Collection<PlayerCommandBase> tempCommandArray = new ArrayList<>(); | ||
for (CommandBase tempBase : ClanCommands.values()) { | ||
if (tempBase instanceof PlayerCommandBase tempPlayerCommand) { | ||
if (tempPlayerCommand.havePermission(tempPlayer, senderClan, senderRole)) { | ||
tempCommandArray.add(tempPlayerCommand); | ||
} | ||
} | ||
} | ||
return tempCommandArray; | ||
} | ||
} |
Oops, something went wrong.