Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Updated GitHub repository. Merged PR from @TechnicallyCoded. Modified…
Browse files Browse the repository at this point in the history
… PR to fix infinite loop. Refactored base package names from `xyz.gamlin` to `me.loving11ish`. Added new server version checking system. Cleaned up some debug statements. Added firing of PlayerPointsAwardedEvent when clan is null. Fixed API issue with PlayerPointsAwardedEvent. Added new teleport delay bypass permission `clanslite.bypass.homedelay`. Added descriptions to all permission nodes. Added new PAPI placeholder `%clansLite_pluginVersion%`. Added new PAPI placeholder `%clansLite_pluginAuthor%`. Added new PAPI placeholder `%clansLite_baseServerVersion%`. Added new PAPI placeholder `%clansLite_serverPackage%`. Updated maven-compiler-plugin to `3.11.0`. Fixed plugin not loading on version below 1.17. Changed plugin version to `1.4.0`.
  • Loading branch information
BuildTools committed Sep 19, 2023
1 parent 12f01ae commit 95d465b
Show file tree
Hide file tree
Showing 87 changed files with 611 additions and 432 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>xyz.gamlin</groupId>
<groupId>me.loving11ish</groupId>
<artifactId>ClansLite</artifactId>
<version>1.4.0-PRERELEASE-01</version>
<version>1.4.0</version>
<packaging>jar</packaging>

<name>ClansLite</name>

<description>A simple and lightweight Clans plugin for Minecraft.</description>
<properties>
<java.version>17</java.version>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>https://www.spigotmc.org/resources/clanslite.97163/</url>
<build>
<defaultGoal>clean package</defaultGoal>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.11.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -38,11 +38,11 @@
<relocations>
<relocation>
<pattern>io.papermc.lib</pattern>
<shadedPattern>xyz.gamlin.clans.paperlib</shadedPattern> <!-- Replace this -->
<shadedPattern>me.loving11ish.clans.paperlib</shadedPattern> <!-- Replace this -->
</relocation>
<relocation>
<pattern>com.tcoded.folialib</pattern>
<shadedPattern>xyz.gamlin.clans.folialib</shadedPattern>
<shadedPattern>me.loving11ish.clans.folialib</shadedPattern>
</relocation>
</relocations>
</configuration>
Expand Down Expand Up @@ -78,7 +78,7 @@
</repository>
<repository>
<id>opencollab-snapshot</id>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
<url>https://repo.opencollab.dev/main/</url>
</repository>
<repository>
<id>devmart-other</id>
Expand Down Expand Up @@ -118,7 +118,7 @@
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>api</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.2.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.gamlin.clans;
package me.loving11ish.clans;

import com.rylinaux.plugman.api.PlugManAPI;
import com.tcoded.folialib.FoliaLib;
Expand All @@ -11,21 +11,21 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.geysermc.floodgate.api.FloodgateApi;
import xyz.gamlin.clans.commands.*;
import xyz.gamlin.clans.commands.commandTabCompleters.ChestCommandTabCompleter;
import xyz.gamlin.clans.commands.commandTabCompleters.ClanAdminTabCompleter;
import xyz.gamlin.clans.commands.commandTabCompleters.ClanCommandTabCompleter;
import xyz.gamlin.clans.expansions.PlayerClanExpansion;
import xyz.gamlin.clans.files.ClanGUIFileManager;
import xyz.gamlin.clans.files.ClansFileManager;
import xyz.gamlin.clans.files.MessagesFileManager;
import xyz.gamlin.clans.files.UsermapFileManager;
import xyz.gamlin.clans.listeners.*;
import xyz.gamlin.clans.menuSystem.PlayerMenuUtility;
import xyz.gamlin.clans.menuSystem.paginatedMenu.ClanListGUI;
import xyz.gamlin.clans.updateSystem.JoinEvent;
import xyz.gamlin.clans.updateSystem.UpdateChecker;
import xyz.gamlin.clans.utils.*;
import me.loving11ish.clans.commands.*;
import me.loving11ish.clans.commands.commandTabCompleters.ChestCommandTabCompleter;
import me.loving11ish.clans.commands.commandTabCompleters.ClanAdminTabCompleter;
import me.loving11ish.clans.commands.commandTabCompleters.ClanCommandTabCompleter;
import me.loving11ish.clans.expansions.PlaceholderAPIClanExpansion;
import me.loving11ish.clans.files.ClanGUIFileManager;
import me.loving11ish.clans.files.ClansFileManager;
import me.loving11ish.clans.files.MessagesFileManager;
import me.loving11ish.clans.files.UsermapFileManager;
import me.loving11ish.clans.listeners.*;
import me.loving11ish.clans.menuSystem.PlayerMenuUtility;
import me.loving11ish.clans.menuSystem.paginatedMenu.ClanListGUI;
import me.loving11ish.clans.updateSystem.JoinEvent;
import me.loving11ish.clans.updateSystem.UpdateChecker;
import me.loving11ish.clans.utils.*;

import java.io.IOException;
import java.util.HashMap;
Expand All @@ -37,12 +37,14 @@ public final class Clans extends JavaPlugin {

ConsoleCommandSender console = Bukkit.getConsoleSender();

private final PluginDescriptionFile pluginsendMessage = getDescription();
private final String pluginVersion = pluginsendMessage.getVersion();
private final PluginDescriptionFile pluginInfo = getDescription();
private final String pluginVersion = pluginInfo.getVersion();
private FoliaLib foliaLib = new FoliaLib(this);

private static Clans plugin;
private static FloodgateApi floodgateApi;
private static VersionCheckerUtils versionCheckerUtils;
private static boolean chestsEnabled = false;
public MessagesFileManager messagesFileManager;
public ClansFileManager clansFileManager;
public ClanGUIFileManager clanGUIFileManager;
Expand All @@ -57,12 +59,11 @@ public final class Clans extends JavaPlugin {
public void onEnable() {
//Plugin startup logic
plugin = this;
versionCheckerUtils = new VersionCheckerUtils();
versionCheckerUtils.setVersion();

//Server version compatibility check
if (!(Bukkit.getServer().getVersion().contains("1.13")||Bukkit.getServer().getVersion().contains("1.14")||
Bukkit.getServer().getVersion().contains("1.15")||Bukkit.getServer().getVersion().contains("1.16")||
Bukkit.getServer().getVersion().contains("1.17")||Bukkit.getServer().getVersion().contains("1.18")||
Bukkit.getServer().getVersion().contains("1.19")||Bukkit.getServer().getVersion().contains("1.20"))){
if (versionCheckerUtils.getVersion() < 13){
console.sendMessage(ColorUtils.translateColorCodes("&4-------------------------------------------"));
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &4Your server version is: &d" + Bukkit.getServer().getVersion()));
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &4This plugin is only supported on the Minecraft versions listed below:"));
Expand Down Expand Up @@ -202,17 +203,28 @@ public void onEnable() {
this.getServer().getPluginManager().registerEvents(new PlayerMessageEvent(), this);
this.getServer().getPluginManager().registerEvents(new PlayerDamageEvent(), this);
this.getServer().getPluginManager().registerEvents(new PlayerKillEvent(), this);
this.getServer().getPluginManager().registerEvents(new ChestBreakEvent(), this);
this.getServer().getPluginManager().registerEvents(new ChestOpenEvent(), this);
this.getServer().getPluginManager().registerEvents(new JoinEvent(), this);
this.getServer().getPluginManager().registerEvents(new MenuEvent(), this);
if (versionCheckerUtils.getVersion() >= 14) {
this.getServer().getPluginManager().registerEvents(new ChestBreakEvent(), this);
this.getServer().getPluginManager().registerEvents(new ChestOpenEvent(), this);
chestsEnabled = getConfig().getBoolean("protections.chests.enabled");
if (chestsEnabled){
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &3Chest protection system enabled!"));
}else {
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &cChest protection system disabled!"));
}
}else {
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &cYour current server version does not support PersistentDataContainers!"));
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &cChest protection system disabled!"));
}

//Update banned tags list
ClanCommand.updateBannedTagsList();

//Register PlaceHolderAPI hooks
if (Bukkit.getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")||isPlaceholderAPIEnabled()){
new PlayerClanExpansion().register();
new PlaceholderAPIClanExpansion().register();
console.sendMessage(ColorUtils.translateColorCodes("-------------------------------------------"));
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &3PlaceholderAPI found!"));
console.sendMessage(ColorUtils.translateColorCodes("&6ClansLite: &3External placeholders enabled!"));
Expand Down Expand Up @@ -378,6 +390,7 @@ public void onDisable() {

plugin = null;
floodgateApi = null;
versionCheckerUtils = null;
messagesFileManager = null;
clansFileManager = null;
clanGUIFileManager = null;
Expand Down Expand Up @@ -453,4 +466,12 @@ public static Clans getPlugin() {
public static FloodgateApi getFloodgateApi() {
return floodgateApi;
}

public static VersionCheckerUtils getVersionCheckerUtils() {
return versionCheckerUtils;
}

public static boolean isChestsEnabled() {
return chestsEnabled;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ChestBuyEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Chest;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Chest;
import me.loving11ish.clans.models.Clan;

public class ChestLockEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.Location;
import org.bukkit.entity.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanAllyAddEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanAllyRemoveEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.ClanPlayer;
import me.loving11ish.clans.models.ClanPlayer;

public class ClanChatSpyToggledEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanCreateEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanEnemyAddEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanEnemyRemoveEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanFriendlyFireAttackEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanHomeCreateEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanHomeDeleteEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanHomePreTeleportEvent extends Event implements Cancellable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import me.loving11ish.clans.models.Clan;

public class ClanHomeTeleportEvent extends Event {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.OfflinePlayer;
import org.bukkit.event.Event;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.gamlin.clans.api;
package me.loving11ish.clans.api;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xyz.gamlin.clans.models.Clan;
import xyz.gamlin.clans.models.ClanPlayer;
import me.loving11ish.clans.models.Clan;
import me.loving11ish.clans.models.ClanPlayer;

public class ClanPointsAddedEvent extends Event {

Expand Down
Loading

0 comments on commit 95d465b

Please sign in to comment.