Grundgerüst für Minecraft Plugin
This commit is contained in:
47
Effekte Challenge V2/pom.xml
Normal file
47
Effekte Challenge V2/pom.xml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://www.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.xonics.ef</groupId>
|
||||||
|
<artifactId>effekte-challenge-v2</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<name>Effekte Challenge V2</name>
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>spigot-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.21.10-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>plugin.yml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.xonics.ef;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import com.xonics.ef.managers.PluginManager;
|
||||||
|
import com.xonics.ef.listeners.PlayerListener;
|
||||||
|
|
||||||
|
public class Effekte Challenge V2 extends JavaPlugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
|
||||||
|
// Initialize managers
|
||||||
|
PluginManager.getInstance().initialize();
|
||||||
|
|
||||||
|
// Register listeners
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||||
|
|
||||||
|
getLogger().info("Effekte Challenge V2 has been enabled!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
getLogger().info("Effekte Challenge V2 has been disabled!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.xonics.ef.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
public class PlayerListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
// Handle player join event
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.xonics.ef.managers;
|
||||||
|
|
||||||
|
public class PluginManager {
|
||||||
|
private static PluginManager instance;
|
||||||
|
|
||||||
|
public static PluginManager getInstance() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new PluginManager();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialize() {
|
||||||
|
// Initialize your managers here
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.xonics.ef.utils;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
|
||||||
|
public class Utils {
|
||||||
|
|
||||||
|
public static String colorize(String msg) {
|
||||||
|
Matcher match = Pattern.compile("#[a-fA-F0-9]{6}").matcher(msg);
|
||||||
|
while (match.find()) {
|
||||||
|
String color = msg.substring(match.start(), match.end());
|
||||||
|
msg = msg.replace(color, String.valueOf(ChatColor.of(color)));
|
||||||
|
match = Pattern.compile("#[a-fA-F0-9]{6}").matcher(msg);
|
||||||
|
}
|
||||||
|
return ChatColor.translateAlternateColorCodes('&', msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add more utility methods here
|
||||||
|
}
|
||||||
5
Effekte Challenge V2/src/main/resources/plugin.yml
Normal file
5
Effekte Challenge V2/src/main/resources/plugin.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
main: com.xonics.ef.Effekte Challenge V2
|
||||||
|
version: 1.0.0-SNAPSHOT
|
||||||
|
name: Effekte Challenge V2
|
||||||
|
author: xonics
|
||||||
|
api-version: 1.13
|
||||||
5
Effekte Challenge V2/target/classes/plugin.yml
Normal file
5
Effekte Challenge V2/target/classes/plugin.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
main: com.xonics.ef.Effekte Challenge V2
|
||||||
|
version: 1.0.0-SNAPSHOT
|
||||||
|
name: Effekte Challenge V2
|
||||||
|
author: xonics
|
||||||
|
api-version: 1.13
|
||||||
Reference in New Issue
Block a user