Updated EtzCore to 1.3
Moved necessary hooks to non-main classes Added Maven Dependenciesmaster
parent
8ad681d9f7
commit
30960fbceb
56
pom.xml
56
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<groupId>xyz.etztech</groupId>
|
<groupId>xyz.etztech</groupId>
|
||||||
<artifactId>DeluxeGroups</artifactId>
|
<artifactId>DeluxeGroups</artifactId>
|
||||||
<!-- Version is used in plugin.yml -->
|
<!-- Version is used in plugin.yml -->
|
||||||
<version>1.1</version>
|
<version>1.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<!-- Plugin Information -->
|
<!-- Plugin Information -->
|
||||||
|
@ -12,31 +12,6 @@
|
||||||
<description>A plugin used to add group channels to DeluxeChat. (or any chat plugin, really)</description>
|
<description>A plugin used to add group channels to DeluxeChat. (or any chat plugin, really)</description>
|
||||||
<url>http://www.etztech.xyz</url>
|
<url>http://www.etztech.xyz</url>
|
||||||
|
|
||||||
<licenses>
|
|
||||||
<license>
|
|
||||||
<name>Zlib License</name>
|
|
||||||
<url>http://opensource.org/licenses/Zlib</url>
|
|
||||||
<comments>Copyright (c) 2017 EtzTech
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
|
|
||||||
3. This notice may not be removed or altered from any source
|
|
||||||
distribution.</comments>
|
|
||||||
</license>
|
|
||||||
</licenses>
|
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
|
@ -57,21 +32,25 @@
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.13.1-R0.1-SNAPSHOT</version>
|
<version>1.13.1-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dynmap</groupId>
|
<groupId>us.dynmap</groupId>
|
||||||
<artifactId>DynmapCoreAPI</artifactId>
|
<artifactId>dynmap-api</artifactId>
|
||||||
<version>2.0</version>
|
<version>1.9.4</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xyz.etztech</groupId>
|
<groupId>xyz.etztech</groupId>
|
||||||
<artifactId>EtzCore</artifactId>
|
<artifactId>EtzCore</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
<artifactId>commons-lang</artifactId>
|
<artifactId>commons-lang</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,8 +111,8 @@
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>8</source>
|
||||||
<target>1.7</target>
|
<target>8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -151,6 +130,19 @@
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.1.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
|
@ -6,9 +6,9 @@ import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
import org.dynmap.DynmapCommonAPI;
|
|
||||||
import xyz.etztech.core.api.IMinecraftManager;
|
import xyz.etztech.core.api.IMinecraftManager;
|
||||||
|
import xyz.etztech.core.maven.MavenLibrary;
|
||||||
|
import xyz.etztech.core.maven.MavenPlugin;
|
||||||
import xyz.etztech.deluxegroups.command.CommandGroup;
|
import xyz.etztech.deluxegroups.command.CommandGroup;
|
||||||
import xyz.etztech.deluxegroups.command.CommandMain;
|
import xyz.etztech.deluxegroups.command.CommandMain;
|
||||||
import xyz.etztech.deluxegroups.listeners.AsyncPlayerChatListener;
|
import xyz.etztech.deluxegroups.listeners.AsyncPlayerChatListener;
|
||||||
|
@ -20,7 +20,10 @@ import java.io.PrintWriter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class DeluxeGroups extends JavaPlugin {
|
|
||||||
|
@MavenLibrary(group = "us.dynmap", artifact = "dynmap-api", version = "1.9.4", repository = "http://repo.mikeprimm.com/")
|
||||||
|
@MavenLibrary(group = "commons-lang", artifact = "commons-lang", version = "2.6")
|
||||||
|
public class DeluxeGroups extends MavenPlugin {
|
||||||
|
|
||||||
private static DeluxeGroups instance;
|
private static DeluxeGroups instance;
|
||||||
|
|
||||||
|
@ -35,7 +38,7 @@ public class DeluxeGroups extends JavaPlugin {
|
||||||
AsyncPlayerChatListener chatListener;
|
AsyncPlayerChatListener chatListener;
|
||||||
|
|
||||||
// Dynmap API
|
// Dynmap API
|
||||||
private static DynmapCommonAPI dynmap = null;
|
private static Object dynmap = null;
|
||||||
|
|
||||||
// MinecraftManager API
|
// MinecraftManager API
|
||||||
private static IMinecraftManager minecraftManager = null;
|
private static IMinecraftManager minecraftManager = null;
|
||||||
|
@ -43,7 +46,7 @@ public class DeluxeGroups extends JavaPlugin {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void enable() {
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
|
@ -59,9 +62,8 @@ public class DeluxeGroups extends JavaPlugin {
|
||||||
|
|
||||||
// Dynmap integration
|
// Dynmap integration
|
||||||
if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) {
|
if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) {
|
||||||
dynmap = (DynmapCommonAPI) Bukkit.getPluginManager().getPlugin("dynmap");
|
dynmap = Bukkit.getPluginManager().getPlugin("dynmap");
|
||||||
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "IMPORTANT: Disabling Dynmap Game->Web Chat. All web chat will be handled by DeluxeGroups.");
|
DeluxeUtil.setupDynmap(dynmap);
|
||||||
dynmap.setDisableChatToWebProcessing(true);
|
|
||||||
getServer().getPluginManager().registerEvents(new SessionListener(), this);
|
getServer().getPluginManager().registerEvents(new SessionListener(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +89,7 @@ public class DeluxeGroups extends JavaPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void disable() {
|
||||||
log("Saving groups.");
|
log("Saving groups.");
|
||||||
String root;
|
String root;
|
||||||
for (DeluxeGroup group : groups.values()) {
|
for (DeluxeGroup group : groups.values()) {
|
||||||
|
@ -225,7 +227,7 @@ public class DeluxeGroups extends JavaPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DynmapCommonAPI getDynmap() {
|
public static Object getDynmap() {
|
||||||
return dynmap;
|
return dynmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package xyz.etztech.deluxegroups;
|
package xyz.etztech.deluxegroups;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.dynmap.DynmapAPI;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
@ -44,4 +46,9 @@ public class DeluxeUtil {
|
||||||
List<String> no = new ArrayList<>(Arrays.asList("no", "false", "0"));
|
List<String> no = new ArrayList<>(Arrays.asList("no", "false", "0"));
|
||||||
return yes.contains(text) ? true : no.contains(text) ? false : null;
|
return yes.contains(text) ? true : no.contains(text) ? false : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setupDynmap(Object dynmap) {
|
||||||
|
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "IMPORTANT: Disabling Dynmap Game->Web Chat. All web chat will be handled by DeluxeGroups.");
|
||||||
|
((DynmapAPI) dynmap).setDisableChatToWebProcessing(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
import org.dynmap.DynmapAPI;
|
||||||
import org.dynmap.DynmapCommonAPI;
|
import org.dynmap.DynmapCommonAPI;
|
||||||
import xyz.etztech.core.api.IMinecraftManager;
|
import xyz.etztech.core.api.IMinecraftManager;
|
||||||
import xyz.etztech.deluxegroups.DeluxeGroup;
|
import xyz.etztech.deluxegroups.DeluxeGroup;
|
||||||
|
@ -41,7 +42,7 @@ public class AsyncPlayerChatListener implements Listener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DynmapCommonAPI dynmap = DeluxeGroups.getDynmap();
|
DynmapAPI dynmap = (DynmapAPI) DeluxeGroups.getDynmap();
|
||||||
IMinecraftManager minecraftManager = DeluxeGroups.getMinecraftManager();
|
IMinecraftManager minecraftManager = DeluxeGroups.getMinecraftManager();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.dynmap.DynmapAPI;
|
||||||
import org.dynmap.DynmapCommonAPI;
|
import org.dynmap.DynmapCommonAPI;
|
||||||
import xyz.etztech.deluxegroups.DeluxeGroups;
|
import xyz.etztech.deluxegroups.DeluxeGroups;
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ public class SessionListener implements Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleEvent(Player player, boolean loggedIn) {
|
private void handleEvent(Player player, boolean loggedIn) {
|
||||||
DynmapCommonAPI dynmap = DeluxeGroups.getDynmap();
|
DynmapAPI dynmap = (DynmapAPI) DeluxeGroups.getDynmap();
|
||||||
if (dynmap != null) {
|
if (dynmap != null) {
|
||||||
dynmap.postPlayerJoinQuitToWeb(player.getName(), player.getName(), loggedIn);
|
dynmap.postPlayerJoinQuitToWeb(player.getName(), player.getName(), loggedIn);
|
||||||
//dynmap.sendBroadcastToWeb("", player.getName() + " " + (loggedIn ? "joined" : "left") + " the server");
|
//dynmap.sendBroadcastToWeb("", player.getName() + " " + (loggedIn ? "joined" : "left") + " the server");
|
||||||
|
|
Loading…
Reference in New Issue