Skip to content

Commit 8d19be4

Browse files
committed
reup
1 parent 864677b commit 8d19be4

File tree

147 files changed

+16846
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+16846
-1
lines changed

.github/workflows/maven.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Java CI with Maven
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: maven
25+
26+
- name: Build with Maven
27+
run: mvn -B package --file pom.xml
28+
29+
- run: mkdir artifact && cp target/*.jar artifact
30+
31+
- name: Release
32+
uses: softprops/action-gh-release@v1
33+
with:
34+
tag_name: v.${{ github.run_number }}
35+
files: /home/runner/work/plugin/plugin/artifact/plugin-1.0-fat.jar

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.class
2+
3+
*.jar
4+
*.war
5+
*.nar
6+
*.ear
7+
*.zip
8+
*.tar.gz
9+
*.rar
10+
11+
*target/
12+
*data/
13+
14+
*.vscode/

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
# plugin
1+
# plugin
2+
Server side plugin with Spigot / PaperMC & Javacord
3+
<a href=""><img src="https://img.shields.io/github/commit-activity/m/Altherneum/plugin?color=red&style=for-the-badge"></a>
4+
<a href=""><img src="https://img.shields.io/github/last-commit/Altherneum/plugin?color=red&style=for-the-badge"></a>
5+
<br>
6+
<a href=""><img src="https://img.shields.io/github/stars/Altherneum?color=red&style=for-the-badge"></a>
7+
<a href=""><img src="https://img.shields.io/github/stars/Altherneum/plugin?color=red&label=repo%20stars&style=for-the-badge"></a>
8+
<a href=""><img src="https://img.shields.io/github/contributors/Altherneum/plugin?style=for-the-badge"></a>
9+
<br>
10+
<a href=""><img src="https://img.shields.io/github/languages/code-size/Altherneum/plugin?color=red"></a>
11+
<a href=""><img src="https://img.shields.io/github/repo-size/Altherneum/plugin?color=red"></a>
12+
13+
- [Tableau](https://github.com/orgs/Altherneum/projects/3/)
14+
- [Issues](https://github.com/Altherneum/plugin/issues)
15+
- [Commits](https://github.com/Altherneum/plugin/commits/main)
16+
- [Latest release](https://github.com/Altherneum/plugin/releases/latest)
17+
- [Releases](https://github.com/Altherneum/plugin/releases)

pom.xml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>altherneum.fr</groupId>
8+
<artifactId>plugin</artifactId>
9+
<version>1.0</version>
10+
11+
<properties>
12+
<maven.compiler.source>17</maven.compiler.source>
13+
<maven.compiler.target>17</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<repositories>
18+
<repository>
19+
<id>papermc</id>
20+
<url>https://repo.papermc.io/repository/maven-public/</url>
21+
</repository>
22+
</repositories>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>io.papermc.paper</groupId>
27+
<artifactId>paper-api</artifactId>
28+
<version>1.20.2-R0.1-SNAPSHOT</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
32+
<dependency>
33+
<groupId>org.javacord</groupId>
34+
<artifactId>javacord</artifactId>
35+
<version>3.5.0</version>
36+
<type>pom</type>
37+
</dependency>
38+
</dependencies>
39+
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-shade-plugin</artifactId>
45+
<version>3.2.3</version>
46+
<configuration>
47+
<shadedArtifactAttached>true</shadedArtifactAttached>
48+
<shadedClassifierName>fat</shadedClassifierName>
49+
<transformers>
50+
<transformer
51+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
52+
<manifestEntries>
53+
<Main-Class>altherneum.fr.main.main</Main-Class>
54+
</manifestEntries>
55+
</transformer>
56+
</transformers>
57+
<filters>
58+
<filter>
59+
<artifact>*:*</artifact>
60+
<excludes>
61+
<exclude>META-INF/*.SF</exclude>
62+
<exclude>META-INF/*.DSA</exclude>
63+
<exclude>META-INF/*.RSA</exclude>
64+
</excludes>
65+
</filter>
66+
</filters>
67+
</configuration>
68+
<executions>
69+
<execution>
70+
<phase>package</phase>
71+
<goals>
72+
<goal>shade</goal>
73+
</goals>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
</project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package altherneum.fr.chat;
2+
3+
import org.bukkit.OfflinePlayer;
4+
import org.bukkit.configuration.file.FileConfiguration;
5+
import org.bukkit.configuration.file.YamlConfiguration;
6+
import org.bukkit.entity.Player;
7+
8+
import altherneum.fr.system.dateAPI;
9+
import altherneum.fr.system.getDataStorage;
10+
11+
import java.io.File;
12+
import java.io.IOException;
13+
import java.util.List;
14+
15+
public class chatLogger {
16+
public static File chatFile(OfflinePlayer offlinePlayer) throws IOException {
17+
File file = getDataStorage.chatFile(offlinePlayer);
18+
if (!file.exists()) {
19+
file.createNewFile();
20+
}
21+
return file;
22+
}
23+
24+
public static FileConfiguration playerFileConfiguration(OfflinePlayer offlinePlayer) throws IOException {
25+
return YamlConfiguration.loadConfiguration(chatFile(offlinePlayer));
26+
}
27+
28+
@SuppressWarnings("deprecation")
29+
public static void LogData(Player player, String string) throws IOException {
30+
FileConfiguration fileConfiguration = playerFileConfiguration(player);
31+
List<String> Messages = fileConfiguration.getStringList(
32+
dateAPI.now().getYear() + 1900 + "." + (dateAPI.now().getMonth() + 1) + "." + dateAPI.now().getDate());
33+
Messages.add(dateAPI.now().getHours() + ":" + dateAPI.now().getMinutes() + ":" + dateAPI.now().getSeconds()
34+
+ " : " + string);
35+
fileConfiguration.set(
36+
dateAPI.now().getYear() + 1900 + "." + (dateAPI.now().getMonth() + 1) + "." + dateAPI.now().getDate(),
37+
Messages);
38+
fileConfiguration.save(chatFile(player));
39+
}
40+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package altherneum.fr.chat;
2+
3+
import net.md_5.bungee.api.chat.TextComponent;
4+
import org.bukkit.Bukkit;
5+
import org.bukkit.OfflinePlayer;
6+
import org.bukkit.configuration.file.FileConfiguration;
7+
import org.bukkit.configuration.file.YamlConfiguration;
8+
import org.bukkit.entity.Player;
9+
import org.bukkit.event.EventHandler;
10+
import org.bukkit.event.Listener;
11+
import org.bukkit.event.player.AsyncPlayerChatEvent;
12+
13+
import altherneum.fr.system.getDataStorage;
14+
import altherneum.fr.system.security;
15+
import altherneum.fr.text.lang;
16+
import altherneum.fr.text.playerLang;
17+
import altherneum.fr.text.textTranslation;
18+
19+
import javax.security.auth.login.LoginException;
20+
21+
import java.io.File;
22+
import java.io.IOException;
23+
import java.text.ParseException;
24+
25+
public class playerChat implements Listener {
26+
@EventHandler
27+
public void onPlayerChat(AsyncPlayerChatEvent e)
28+
throws IOException, ParseException, LoginException, InterruptedException {
29+
TextComponent message = new TextComponent();
30+
message.setText("§r §7>>§r " + e.getMessage());
31+
chatLogger.LogData(e.getPlayer(), e.getMessage());
32+
if (security.isObsoletSecurity(e.getPlayer(), security.SecurityList.Mute)
33+
&& security.isObsoletSecurity(e.getPlayer(), security.SecurityList.Swear)) {
34+
for (Player receiver : Bukkit.getOnlinePlayers()) {
35+
if (!getDataStorage.playerFileConfiguration(receiver).getBoolean("chatSetting")) {
36+
receiver.getPlayer().spigot().sendMessage(playerTextHover.getHover(e.getPlayer(), receiver),
37+
message);
38+
}
39+
}
40+
Bukkit.getServer().getLogger()
41+
.info(e.getPlayer().getUniqueId() + " : " + e.getPlayer().getName() + " : " + e.getMessage());
42+
} else {
43+
lang.languages lang = playerLang.getPlayerLang(e.getPlayer());
44+
e.getPlayer().sendMessage(textTranslation.mute(lang));
45+
// send Bonus & date until remove
46+
}
47+
e.setCancelled(true);
48+
}
49+
50+
public static void toggleChatSetting(OfflinePlayer offlinePlayer) throws IOException {
51+
File file = getDataStorage.playerFile(offlinePlayer);
52+
FileConfiguration fileConfiguration = YamlConfiguration.loadConfiguration(file);
53+
if (getDataStorage.playerFileConfiguration(offlinePlayer).getBoolean("chatSetting")) {
54+
fileConfiguration.set("chatSetting", null);
55+
} else {
56+
fileConfiguration.set("chatSetting", true);
57+
}
58+
fileConfiguration.save(file);
59+
}
60+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package altherneum.fr.chat;
2+
3+
import net.md_5.bungee.api.chat.ClickEvent;
4+
import net.md_5.bungee.api.chat.ComponentBuilder;
5+
import net.md_5.bungee.api.chat.HoverEvent;
6+
import net.md_5.bungee.api.chat.TextComponent;
7+
import org.bukkit.OfflinePlayer;
8+
9+
import altherneum.fr.text.lang;
10+
import altherneum.fr.text.playerLang;
11+
import altherneum.fr.text.textTranslation;
12+
13+
import java.io.IOException;
14+
import java.text.ParseException;
15+
16+
public class playerTextHover {
17+
@SuppressWarnings("deprecation")
18+
public static TextComponent getHover(OfflinePlayer offlinePlayer, OfflinePlayer viewer)
19+
throws IOException, ParseException {
20+
TextComponent PlayerComponent = new TextComponent();
21+
PlayerComponent.setText("[ " + prefixTag.prefixTag(offlinePlayer) + "§6" + offlinePlayer.getName() + " §r]");
22+
String hover = "";
23+
hover = hover.concat(" \n ");
24+
hover = hover.concat("§6§lUUID§r: " + offlinePlayer.getUniqueId());
25+
hover = hover.concat(" \n ");
26+
lang.languages lang = playerLang.getPlayerLang(viewer);
27+
hover = hover.concat(textTranslation.clickPlayerInfo(lang));
28+
hover = hover.concat(" \n ");
29+
ComponentBuilder hoverText = new ComponentBuilder(hover);
30+
PlayerComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText.create()));
31+
PlayerComponent
32+
.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/profil " + offlinePlayer.getName()));
33+
return PlayerComponent;
34+
}
35+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package altherneum.fr.chat;
2+
3+
import org.bukkit.OfflinePlayer;
4+
5+
import altherneum.fr.menu.shop.specials.bonus.bonus;
6+
import altherneum.fr.system.tags;
7+
8+
import java.io.IOException;
9+
import java.text.ParseException;
10+
11+
public class prefixTag {
12+
public static String prefixTag(OfflinePlayer offlinePlayer) throws IOException, ParseException {
13+
String prefix = "";
14+
15+
if (tags.hasTags(offlinePlayer, tags.TagsList.Admin)) {
16+
prefix += "";
17+
} else if (tags.hasTags(offlinePlayer, tags.TagsList.Creatif)
18+
|| tags.hasTags(offlinePlayer, tags.TagsList.Builder)
19+
|| tags.hasTags(offlinePlayer, tags.TagsList.Build)) {
20+
prefix += "";
21+
} else if (tags.hasTags(offlinePlayer, tags.TagsList.Messages)
22+
|| tags.hasTags(offlinePlayer, tags.TagsList.Moderation)) {
23+
prefix += "";
24+
} else if (tags.hasTags(offlinePlayer, tags.TagsList.Beta)
25+
|| tags.hasTags(offlinePlayer, tags.TagsList.Test)) {
26+
prefix += "";
27+
} else if (tags.hasTags(offlinePlayer, tags.TagsList.Joueur)) {
28+
prefix += "";
29+
}
30+
31+
if (tags.hasTags(offlinePlayer, tags.TagsList.YouTube)) {
32+
prefix += "";
33+
}
34+
35+
if (!bonus.isObsoletBonus(offlinePlayer, bonus.BonusList.VIPPlus)) {
36+
prefix += "";
37+
} else if (!bonus.isObsoletBonus(offlinePlayer, bonus.BonusList.VIP)) {
38+
prefix += "";
39+
}
40+
41+
if (tags.hasTags(offlinePlayer, tags.TagsList.Survie)) {
42+
prefix += "";
43+
}
44+
45+
return prefix;
46+
}
47+
48+
public static String prefixTagDiscord(OfflinePlayer offlinePlayer) throws IOException, ParseException {
49+
String prefix = "";
50+
if (tags.hasTags(offlinePlayer, tags.TagsList.Admin)) {
51+
prefix += "\uD83D\uDC51";
52+
}
53+
if (tags.hasTags(offlinePlayer, tags.TagsList.Creatif)
54+
|| tags.hasTags(offlinePlayer, tags.TagsList.Builder)
55+
|| tags.hasTags(offlinePlayer, tags.TagsList.Build)
56+
|| tags.hasTags(offlinePlayer, tags.TagsList.Messages)
57+
|| tags.hasTags(offlinePlayer, tags.TagsList.Moderation)) {
58+
prefix += "\uD83D\uDC77";
59+
}
60+
if (tags.hasTags(offlinePlayer, tags.TagsList.Beta)
61+
|| tags.hasTags(offlinePlayer, tags.TagsList.Test)) {
62+
prefix += "\uD83D\uDEA7";
63+
}
64+
if (!bonus.isObsoletBonus(offlinePlayer, bonus.BonusList.VIP)
65+
|| !bonus.isObsoletBonus(offlinePlayer, bonus.BonusList.VIPPlus)) {
66+
prefix += "\uD83C\uDF1F";
67+
}
68+
prefix += " ";
69+
return prefix;
70+
}
71+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package altherneum.fr.commands.admin.entity;
2+
3+
import org.bukkit.command.Command;
4+
import org.bukkit.command.CommandExecutor;
5+
import org.bukkit.command.CommandSender;
6+
import org.bukkit.entity.Player;
7+
8+
import altherneum.fr.commands.api.isAdmin;
9+
10+
public class armorStand implements CommandExecutor {
11+
@Override
12+
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
13+
try {
14+
if (isAdmin.isAdmin(sender)) {
15+
String nom = "";
16+
for (String s : args) {
17+
nom = nom.concat(s);
18+
nom = nom.concat(" ");
19+
}
20+
altherneum.fr.entity.armorStand.Summon(((Player) sender).getLocation(), nom);
21+
}
22+
return true;
23+
} catch (Exception e) {
24+
return false;
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)