Skip to content

Commit

Permalink
Merge branch 'main' into localization
Browse files Browse the repository at this point in the history
  • Loading branch information
jonagamerpro1234 authored May 21, 2023
2 parents d9d2b62 + 9d66607 commit 069626b
Show file tree
Hide file tree
Showing 114 changed files with 13,540 additions and 1,886 deletions.
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing Guidelines

Thank you for considering contributing to our project! Feel free to propose improvements, report issues, or add new features. To contribute, please follow these steps:

1. Fork this repository.
2. Clone the fork to your local machine.
3. Create a new branch for your changes: `git checkout -b branch-name`.
4. Make the changes and commit them: `git add .` and `git commit -m "Description of the changes made"`.
5. Push the changes to your fork: `git push origin branch-name`.
6. Create a Pull Request towards the main branch of this repository.

## How to contribute

You can contribute in several ways, including:

- Reporting issues or problems in the code.
- Adding new features.
- Correcting grammar or spelling errors in documentation files.
- Improving code efficiency.

## How to report issues or suggest improvements

If you find any errors or problems in the code, or if you have any suggestions for improving the project, you can inform us by opening an Issue. Please make sure to provide as much detail as possible about the problem or suggestion so that we can address it effectively.

## Contribution guidelines

Before making a contribution, please make sure to review and follow these guidelines:

- All changes must be clearly documented.
- Code must follow existing style conventions.
- You must add tests for any new features you add.

## License

This project is licensed under the **GNU General Public License v3.0**. By contributing to this project, you agree that your contribution will be published under the same license.
81 changes: 1 addition & 80 deletions CustomJoinAndQuitMessagesOld/CustomJoinAndQuitMessagesOld.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<module version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
Expand All @@ -11,83 +11,4 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_11">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.33" level="project" />
<orderEntry type="library" name="Maven: org.bstats:bstats-bukkit:3.0.0" level="project" />
<orderEntry type="library" name="Maven: org.bstats:bstats-base:3.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.discordsrv:discordsrv:1.24.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.dv8tion:JDA:4.3.0_310" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.squareup.okhttp3:okhttp:3.13.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.neovisionaries:nv-websocket-client:2.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: github.scarsz:configuralize:1.3.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.alexheretic:dynamics:4.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.alexheretic:fluent:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-jdk14:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-io:commons-io:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.vdurmont:emoji-java:5.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.json:json:20170516" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.zafarkhaja:java-semver:0.9.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.kevinsawicki:http-request:6.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.minidns:minidns-hla:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.minidns:minidns-dnssec:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.minidns:minidns-client:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.minidns:minidns-core:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.minidns:minidns-iterative-resolver:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springframework:spring-expression:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springframework:spring-core:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springframework:spring-jcl:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: dev.vankka:MCDiscordReserializer:4.2.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: dev.vankka:SimpleAST:2.2.7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-api:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-key:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-api:1.3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-string:1.3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-legacy:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-gson:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-plain:4.9.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-minimessage:4.1.0-20210316.192746" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.luckperms:api:5.4" level="project" />
<orderEntry type="library" name="Maven: com.github.cryptomorin:XSeries:9.1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:EssentialsX:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.papermc:paperlib:1.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:BaseProviders:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:PaperProvider:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:NMSReflectionProvider:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:1_8Provider:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spongepowered:configurate-yaml:4.1.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.14.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.essentialsx:EssentialsXDiscord:2.19.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: club.minnced:discord-webhooks:0.5.6" level="project" />
</component>
</module>
18 changes: 15 additions & 3 deletions CustomJoinAndQuitMessagesOld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</parent>

<artifactId>CustomJoinAndQuitMessagesOld</artifactId>
<version>1.7.6-b1</version>
<version>1.7.10-beta</version>

<properties>
<java.version>11</java.version>
<java.version>8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -97,6 +97,7 @@
<Version>${project.version}</Version>
</manifestEntries>
</archive>
<outputDirectory>C:\Users\Alumno\Documents\Server\1.8\plugins</outputDirectory>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -143,7 +144,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -221,6 +222,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>com.github.LeonMangler</groupId>
<artifactId>SuperVanish</artifactId>
<version>6.2.6-4</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
package jss.customjoinandquitmessages;

import jss.customjoinandquitmessages.commands.CustomJoinAndQuitCmd;
import jss.customjoinandquitmessages.config.*;
import jss.customjoinandquitmessages.hook.HookManager;
import jss.customjoinandquitmessages.listener.JoinListener;
import jss.customjoinandquitmessages.config.ConfigFile;
import jss.customjoinandquitmessages.config.GroupsFile;
import jss.customjoinandquitmessages.config.Lang;
import jss.customjoinandquitmessages.config.PlayerFile;
import jss.customjoinandquitmessages.config.utils.PreConfigLoader;
import jss.customjoinandquitmessages.listener.chat.JoinListener;
import jss.customjoinandquitmessages.listener.TaskLoader;
import jss.customjoinandquitmessages.manager.InventoryView;
import jss.customjoinandquitmessages.utils.*;
import jss.customjoinandquitmessages.listener.chat.QuitListener;
import jss.customjoinandquitmessages.manager.HookManager;
import jss.customjoinandquitmessages.utils.InventoryView;
import jss.customjoinandquitmessages.update.UpdateChecker;
import jss.customjoinandquitmessages.utils.logger.Logger;
import jss.customjoinandquitmessages.utils.Settings;
import jss.customjoinandquitmessages.utils.Util;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -21,14 +30,14 @@ public class CustomJoinAndQuitMessages extends JavaPlugin {

private static CustomJoinAndQuitMessages plugin;
public Metrics metrics;
public boolean useLatestversion;
private final PluginDescriptionFile jss = getDescription();
public String name = this.jss.getName();
public String version = this.jss.getVersion();
private Map<String, Lang> availableLangs = new HashMap<>();
private final ConfigFile configFile = new ConfigFile(this, "config.yml");
private final HookManager hooksManager = new HookManager(this);
private final HookManager hooksManager = new HookManager();
private final PreConfigLoader preConfigLoader = new PreConfigLoader(this);
@SuppressWarnings("unused")
private String updateVersion;
private boolean useLegacyConfig = false;
private ArrayList<InventoryView> inventoryViews;
Expand All @@ -38,6 +47,12 @@ public class CustomJoinAndQuitMessages extends JavaPlugin {
public void onLoad() {
Util.sendLoadTitle(version);
inventoryViews = new ArrayList<>();

File logDirectory = new File(getDataFolder(), "logs");
if (!logDirectory.exists()) {
//noinspection ResultOfMethodCallIgnored
logDirectory.mkdirs();
}
}

public void onEnable() {
Expand All @@ -59,7 +74,7 @@ public void onEnable() {
String cfg = getConfigFile().getConfig().getString("File-Version");
boolean old_cfg = getConfigFile().getConfig().contains("Config.Config-Version");
assert cfg != null;
if (!cfg.equals("3") || old_cfg) {
if (!cfg.equals("4") || old_cfg) {
useLegacyConfig = true;
}

Expand All @@ -69,23 +84,14 @@ public void onEnable() {

groupsFile.saveDefaultConfig();
groupsFile.create();

hooksManager.load();

setupEvents();
setupCommands();

new UpdateChecker(this, UpdateSettings.ID).getUpdateVersion(version -> {
updateVersion = version;
if (this.getDescription().getVersion().equalsIgnoreCase(version)) {
Logger.success("&a" + this.name + " is up to date!");
} else {
Logger.outLine("&5<||" + Util.setLine("&5"));
Logger.warning("&5<||&b" + this.name + " is outdated!");
Logger.warning("&5<||&bNewest version: &a" + version);
Logger.warning("&5<||&bYour version: &d" + UpdateSettings.VERSION);
Logger.warning("&5<||&bUpdate Here on Spigot: &e" + UpdateSettings.URL_PlUGIN[0]);
Logger.outLine("&5<||" + Util.setLine("&5"));
}
});
UpdateChecker updateChecker = new UpdateChecker(this);
updateChecker.sendSpigotUpdate();
}

public void onDisable() {
Expand All @@ -101,6 +107,7 @@ public void setupCommands() {

public void setupEvents() {
new JoinListener();
new QuitListener();
TaskLoader taskLoader = new TaskLoader(this);
taskLoader.onUpdateGroup();
}
Expand All @@ -114,7 +121,7 @@ public void reloadAllFiles() {
}

public Lang Locale() {
return availableLangs.get(Settings.defaultLanguage);
return availableLangs.get(Settings.settings_defaultLanguage);
}

public void setAvailableLocales(HashMap<String, Lang> availableLangs) {
Expand Down Expand Up @@ -144,14 +151,6 @@ public void registerInventory(Player player, String inventoryName) {
}
}

@SuppressWarnings({"SuspiciousListRemoveInLoop", "unused"})
public void unregisterInventory(Player player) {
for (int i = 0; i < inventoryViews.size(); i++) {
if (inventoryViews.get(i).getPlayer().getName().equals(player.getName())) {
inventoryViews.remove(i);
}
}
}

public InventoryView getInventoryView(Player player) {
for (InventoryView inventoryView : inventoryViews) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package jss.customjoinandquitmessages.commands;

public class CommandHandler {
}
Loading

0 comments on commit 069626b

Please sign in to comment.