Skip to content

Commit

Permalink
* Fixed all misc clans pro labeling needing resolved.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hempfest committed Nov 8, 2023
1 parent b36c9aa commit 927547c
Show file tree
Hide file tree
Showing 29 changed files with 151 additions and 382 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ An alternative to factions with unique features, modern version support and chun
##### LABYRINTH BUILT.
NEW VERSION SOON

[Click here for wiki](https://github.com/the-h-team/ClansPro/wiki)
[Click here for wiki](https://github.com/the-h-team/Clans/wiki)
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ClansPro</artifactId>
<artifactId>Clans</artifactId>
<groupId>com.github.the-h-team</groupId>
<version>1.5.1</version>
<version>1.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ClansPro</artifactId>
<artifactId>Clans</artifactId>
<groupId>com.github.the-h-team</groupId>
<version>1.5.1</version>
</parent>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.sanctum</groupId>
<artifactId>ClansPro</artifactId>
<version>1.5.1</version>
<artifactId>Clans</artifactId>
<version>1.6.0</version>
<modules>
<module>tether-api</module>
<module>tether-cli</module>
</modules>
<packaging>pom</packaging>

<name>Tether</name>
<url>https://github.com/the-h-team/ClansPro</url>
<url>https://github.com/the-h-team/Clans</url>

<organization>
<name>Sanctum</name>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/github/sanctum/clans/ClansJavaPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void fixDataFolder() {
final String name = getDescription().getName();
final File newDir = new File(pluginsDir.getParentFile().getPath(), name);
// account for both folder names
for (String oldFolderName : new String[]{"ClansPro", "Tether"}) {
for (String oldFolderName : new String[]{"Clans", "Tether"}) {
final File oldDir = new File(pluginsDir.getParentFile().getPath(), oldFolderName);
if (oldDir.renameTo(newDir)) {
getLogger().info("Renamed the old '" + oldFolderName + "' folder to '" + name + "' for you.");
Expand Down Expand Up @@ -240,9 +240,7 @@ public void onDisable() {
});

FileManager heads = getFileList().get("heads", "Configuration/Data", Configurable.Type.JSON);
// FIXME change to "Clans"
// -not doing change right now so i don't break anything
CustomHead.Manager.getHeads().stream().filter(h -> h.category().equals("ClansPro")).forEach(h -> {
CustomHead.Manager.getHeads().stream().filter(h -> h.category().equals("Clans")).forEach(h -> {
heads.write(t -> {
t.set(h.name() + ".name", h.name());
t.set(h.name() + ".custom", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ public boolean load(@NotNull Object o) {
}
};
if (!attempt.load(addon)) {
// FIXME start with "Clans::"
// -not doing change right now so i don't break anything
String key = "ClansPro::" + addon.getName() + ";enable-attempt";
String key = "Clans::" + addon.getName() + ";enable-attempt";
if (TaskMonitor.getLocalInstance().get(key) == null) {
Task t = new Task(key, Task.REPEATABLE, TaskChain.getSynchronous()) {

Expand Down Expand Up @@ -433,9 +431,7 @@ public boolean load(@NotNull Object o) {
}
};
if (!attempt.load(e)) {
// FIXME start with "Clans::"
// -not doing change right now so i don't break anything
String key = "ClansPro::" + e.getName() + ";enable-attempt";
String key = "Clans::" + e.getName() + ";enable-attempt";
if (TaskMonitor.getLocalInstance().get(key) == null) {
Task t = new Task(key, Task.REPEATABLE, TaskChain.getSynchronous()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public void onLoad() {
@Override
public void onEnable() {

// FIXME start with "clans;"
// -not doing change right now so i don't break anything
ClanVentBus.MEDIUM_PRIORITY.subscribeTo(CommandInformationAdaptEvent.class, "clanspro;dynmap-info_adapt", (e, subscription) -> {
ClanVentBus.MEDIUM_PRIORITY.subscribeTo(CommandInformationAdaptEvent.class, "clans;dynmap-info_adapt", (e, subscription) -> {
ClanAddon cycle = ClanAddonQueue.getInstance().get("Dynmap");

if (cycle != null && !cycle.getContext().isActive()) {
Expand All @@ -65,15 +63,11 @@ public void onEnable() {
e.insert("&7|&e) &6/c &bglobe &chide &8[all]");
}).queue();

// FIXME start with "clans;"
// -not doing change right now so i don't break anything
ClanVentBus.MEDIUM_PRIORITY.subscribeTo(AssociateObtainLandEvent.class, "clanspro;dynmap-land_obtain", (event, subscription) -> {
ClanVentBus.MEDIUM_PRIORITY.subscribeTo(AssociateObtainLandEvent.class, "clans;dynmap-land_obtain", (event, subscription) -> {
event.getPlayer().performCommand("c globe show");
}).queue();

// FIXME start with "clans;"
// -not doing change right now so i don't break anything
ClanVentBus.HIGHEST_PRIORITY.subscribeTo(AssociateUnClaimEvent.class, "clanspro;dynmap-land_loss", (event, subscription) -> {
ClanVentBus.HIGHEST_PRIORITY.subscribeTo(AssociateUnClaimEvent.class, "clans;dynmap-land_loss", (event, subscription) -> {
if (!event.isCancelled()) {
event.getPlayer().performCommand("c globe hide");
}
Expand All @@ -85,11 +79,9 @@ public void onEnable() {
public void onDisable() {

ClanVentBus mediumPriority = ClanVentBus.MEDIUM_PRIORITY;
// FIXME start with "clans;" x3 lines
// -not doing change right now so i don't break anything
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clanspro;dynmap-info_adapt").deploy();
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clanspro;dynmap-land_obtain").deploy();
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clanspro;dynmap-land_loss").deploy();
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clans;dynmap-info_adapt").deploy();
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clans;dynmap-land_obtain").deploy();
mediumPriority.unsubscribeFrom(CommandInformationAdaptEvent.class, "clans;dynmap-land_loss").deploy();


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static String getProgressBar(int currentValue, int maxValue, int maxBars)
public boolean player(Player p, String label, String[] args) {

if (args.length == 0) {
// TODO: send help menu
Clan.Associate associate = ClansAPI.getInstance().getAssociate(p).orElse(null);
message()
.append(text(" "))
Expand Down Expand Up @@ -223,7 +222,6 @@ public boolean player(Player p, String label, String[] args) {
Clan.ACTION.sendMessage(p, "&cYour clan is no longer a member of the kingdom.");

if (k.getMembers().size() == 0) {
// TODO: announce kingdom fallen
k.remove(ClanAddonQueue.getInstance().get("Kingdoms"));
Bukkit.getOnlinePlayers().forEach(pl -> Clan.ACTION.sendMessage(pl, "&2[&b" + k.getName() + "&2]&r &c&ohas fallen.."));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public CommandClanAdmin() {
super("clansadmin");
setDescription("Used to modify clan settings.");
setAliases(Arrays.asList("ca", "cla", "clanadmin"));
// FIXME start with "clans" and/or make relative/calculated?
// -not doing change right now so i don't break anything
setPermission("clanspro.admin");
setPermission("clans.admin");
}

private List<String> helpMenu(String label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ public boolean player(Player p, String label, String[] args) {

@Override
public @NotNull String category() {
// FIXME change to "Clans"
// -not doing change right now so i don't break anything
return "ClansPro";
return "Clans";
}
});
sendMessage(p, MessageFormat.format(ClansAPI.getDataInstance().getMessageResponse("cached-head"), cost));
Expand Down Expand Up @@ -149,9 +147,7 @@ public boolean player(Player p, String label, String[] args) {

@Override
public @NotNull String category() {
// FIXME change to "Clans"
// -not doing change right now so i don't break anything
return "ClansPro";
return "Clans";
}
});
sendMessage(p, MessageFormat.format(ClansAPI.getDataInstance().getMessageResponse("cached-head"), 0.0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ public synchronized boolean delete(Clan c) {
if (!m.getRoot().delete()) {
ClansAPI.getInstance().getPlugin().getLogger().warning("- A non existent clan file was attempted to be removed, ignoring...");
}
}).scheduleLater("ClansPro-removal;" + c.getId(), 1L);
// ^FIXME change key to start with "Clans"
// -not doing change right now so i don't break anything
}).scheduleLater("Clans-removal;" + c.getId(), 1L);
return CLANS.remove(c);
} catch (Exception e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,11 @@ public int getPlayerHardcap(Player player) {
if (player == null)
return 0;
for (int i = 1; i < 251; i++) {
// FIXME start with "clans"/make relative/calculated
// -not doing change right now so i don't break anything
if (player.hasPermission("clanspro." + DataManager.Security.getPermission("claim") + ".infinite")) {
if (player.hasPermission("clans." + DataManager.Security.getPermission("claim") + ".infinite")) {
result = -1;
break;
}
// FIXME start with "clans"/make relative/calculated
// -not doing change right now so i don't break anything
if (player.hasPermission("clanspro." + DataManager.Security.getPermission("claim") + "." + i)) {
if (player.hasPermission("clans." + DataManager.Security.getPermission("claim") + "." + i)) {
result = i;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ public Clan.Action<Clan> remove(@NotNull UUID target, boolean silent) {
Bukkit.broadcastMessage(color(getPrefix() + " " + format));
}
API.getClaimManager().refresh();
}).scheduleLater("ClansPro-deletion;" + target, 1);
// ^FIXME change key to start with "Clans"
// -not doing change right now so i don't break anything
}).scheduleLater("Clans-deletion;" + target, 1);
} else {
if (!silent) {
clanIndex.broadcast(MessageFormat.format(ClansAPI.getDataInstance().getMessageResponse("member-leave"), Bukkit.getOfflinePlayer(target).getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

// FIXME update ascii art
/**
* <pre>
* ████████╗███████╗████████╗██╗ ██╗███████╗██████╗
* ╚══██╔══╝██╔════╝╚══██╔══╝██║ ██║██╔════╝██╔══██╗
* ██║ █████╗ ██║ ███████║█████╗ ██████╔╝
* ██║ ██╔══╝ ██║ ██╔══██║██╔══╝ ██╔══██╗
* ██║ ███████╗ ██║ ██║ ██║███████╗██║ ██║
* ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
* ██████ ██ █████ ███ ██ ███████
* ██ ██ ██ ██ ████ ██ ██
* ██ ██ ███████ ██ ██ ██ ███████
* ██ ██ ██ ██ ██ ██ ██ ██
* ██████ ███████ ██ ██ ██ ████ ███████
* <pre>
* Copyright (c) 2023 Sanctum
*/
Expand Down Expand Up @@ -112,7 +110,7 @@ static DataManager getDataInstance() {
Optional<Clan.Associate> getAssociate(String playerName);

/**
* Get the ClansPro file listing.
* Get the Clans file listing.
*
* @return Get's the file collection for the given plugin.
*/
Expand Down
Loading

0 comments on commit 927547c

Please sign in to comment.