diff --git a/bukkit/pom.xml b/bukkit/pom.xml
new file mode 100644
index 000000000..50dd3a05c
--- /dev/null
+++ b/bukkit/pom.xml
@@ -0,0 +1,51 @@
+
+
+
+ viaversion
+ us.myles
+ 1.0.0-ALPHA-16w38a
+
+ 4.0.0
+
+ viaversion-bukkit
+
+
+
+ 1.8.8-R0.1-SNAPSHOT
+
+
+
+
+
+ us.myles
+ viaversion-common
+ 1.0.0-ALPHA-16w38a
+ provided
+
+
+
+
+ org.bukkit
+ bukkit
+ ${bukkitVersion}
+ provided
+ true
+
+
+ junit
+ junit
+
+
+ gson
+ com.google.code.gson
+
+
+ persistence-api
+ javax.persistence
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/us/myles/ViaVersion/ViaConfig.java b/bukkit/src/main/java/us/myles/ViaVersion/ViaConfig.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/ViaConfig.java
rename to bukkit/src/main/java/us/myles/ViaVersion/ViaConfig.java
diff --git a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java b/bukkit/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java
similarity index 93%
rename from src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java
rename to bukkit/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java
index 8471af2b2..0b72d9560 100644
--- a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java
+++ b/bukkit/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java
@@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import us.myles.ViaVersion.api.Pair;
+import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.ViaVersion;
import us.myles.ViaVersion.api.ViaVersionAPI;
import us.myles.ViaVersion.api.boss.BossBar;
@@ -20,14 +21,15 @@ import us.myles.ViaVersion.api.boss.BossColor;
import us.myles.ViaVersion.api.boss.BossStyle;
import us.myles.ViaVersion.api.command.ViaVersionCommand;
import us.myles.ViaVersion.api.data.UserConnection;
+import us.myles.ViaVersion.api.platform.ViaPlatform;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
import us.myles.ViaVersion.boss.ViaBossBar;
+import us.myles.ViaVersion.bukkit.BukkitCommandHandler;
import us.myles.ViaVersion.classgenerator.ClassGenerator;
-import us.myles.ViaVersion.commands.ViaCommandHandler;
import us.myles.ViaVersion.handlers.ViaVersionInitializer;
+import us.myles.ViaVersion.listeners.UpdateListener;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
-import us.myles.ViaVersion.update.UpdateListener;
import us.myles.ViaVersion.update.UpdateUtil;
import us.myles.ViaVersion.util.ConcurrentList;
import us.myles.ViaVersion.util.ListWrapper;
@@ -42,12 +44,12 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
+public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI, ViaPlatform {
private final Map portedPlayers = new ConcurrentHashMap<>();
private List injectedFutures = new ArrayList<>();
private List> injectedLists = new ArrayList<>();
- private ViaCommandHandler commandHandler;
+ private BukkitCommandHandler commandHandler;
private boolean debug = false;
private boolean compatSpigotBuild = false;
private boolean spigot = true;
@@ -74,6 +76,9 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
public void onLoad() {
// Config magic
conf = new ViaConfig(this);
+ // Init platform
+ Via.init(this);
+ // For compatibility
ViaVersion.setInstance(this);
// Handle reloads
@@ -118,7 +123,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
if (lateBind)
injectPacketHandler();
if (conf.isCheckForUpdates())
- UpdateUtil.sendUpdateMessage(this);
+ UpdateUtil.sendUpdateMessage();
// Gather version :)
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
@@ -136,9 +141,9 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
});
- Bukkit.getPluginManager().registerEvents(new UpdateListener(this), this);
+ Bukkit.getPluginManager().registerEvents(new UpdateListener(), this);
- getCommand("viaversion").setExecutor(commandHandler = new ViaCommandHandler());
+ getCommand("viaversion").setExecutor(commandHandler = new BukkitCommandHandler());
getCommand("viaversion").setTabCompleter(commandHandler);
// Register Protocol Listeners
@@ -527,4 +532,48 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
}
return false;
}
+
+ @Override
+ public String getPlatformName() {
+ return "Bukkit";
+ }
+
+ @Override
+ public String getPluginVersion() {
+ return getDescription().getVersion();
+ }
+
+ @Override
+ public void runAsync(Runnable runnable) {
+ getServer().getScheduler().runTaskAsynchronously(this, runnable);
+ }
+
+ @Override
+ public void runSync(Runnable runnable) {
+ getServer().getScheduler().runTask(this, runnable);
+ }
+
+ @Override
+ public void sendMessage(UUID uuid, String message) {
+ Player player = Bukkit.getPlayer(uuid);
+ if (player != null) {
+ player.sendMessage(message);
+ }
+ }
+
+ @Override
+ public boolean kickPlayer(UUID uuid, String message) {
+ Player player = Bukkit.getPlayer(uuid);
+ if (player != null) {
+ player.kickPlayer(message);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isPluginEnabled() {
+ return Bukkit.getPluginManager().getPlugin("ViaVersion").isEnabled();
+ }
}
diff --git a/src/main/java/us/myles/ViaVersion/api/ViaListener.java b/bukkit/src/main/java/us/myles/ViaVersion/api/ViaListener.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/ViaListener.java
rename to bukkit/src/main/java/us/myles/ViaVersion/api/ViaListener.java
diff --git a/src/main/java/us/myles/ViaVersion/api/ViaVersion.java b/bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersion.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/api/ViaVersion.java
rename to bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersion.java
index a6fee1ad8..99655a2fe 100644
--- a/src/main/java/us/myles/ViaVersion/api/ViaVersion.java
+++ b/bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersion.java
@@ -1,19 +1,19 @@
-package us.myles.ViaVersion.api;
-
-import lombok.Getter;
-import org.apache.commons.lang.Validate;
-import us.myles.ViaVersion.ViaVersionPlugin;
-
-public class ViaVersion {
-
- @Getter
- private static ViaVersionAPI instance;
- @Getter
- private static ViaVersionConfig config;
-
- public static void setInstance(ViaVersionPlugin plugin) {
- Validate.isTrue(instance == null, "Instance is already set");
- ViaVersion.instance = plugin;
- ViaVersion.config = plugin.getConf();
- }
-}
+package us.myles.ViaVersion.api;
+
+import lombok.Getter;
+import org.apache.commons.lang.Validate;
+import us.myles.ViaVersion.ViaVersionPlugin;
+
+@Deprecated
+public class ViaVersion {
+ @Getter
+ private static ViaVersionAPI instance;
+ @Getter
+ private static ViaVersionConfig config;
+
+ public static void setInstance(ViaVersionPlugin plugin) {
+ Validate.isTrue(instance == null, "Instance is already set");
+ ViaVersion.instance = plugin;
+ ViaVersion.config = plugin.getConf();
+ }
+}
diff --git a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java b/bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java
rename to bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java
index fb3d77466..939109d17 100644
--- a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java
+++ b/bukkit/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java
@@ -1,143 +1,144 @@
-package us.myles.ViaVersion.api;
-
-import io.netty.buffer.ByteBuf;
-import org.bukkit.entity.Player;
-import us.myles.ViaVersion.api.boss.BossBar;
-import us.myles.ViaVersion.api.boss.BossColor;
-import us.myles.ViaVersion.api.boss.BossStyle;
-import us.myles.ViaVersion.api.command.ViaVersionCommand;
-import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
-
-import java.util.SortedSet;
-import java.util.UUID;
-
-public interface ViaVersionAPI {
- /**
- * Is the player connection modified by ViaVersion?
- *
- * @param player Bukkit player object
- * @return True if the client is modified (At the moment it also means version 1.9 and higher)
- * @deprecated As of 0.9.9, because all players are ported use {@link #getPlayerVersion(Player)}
- */
- boolean isPorted(Player player);
-
- /**
- * Get protocol number from a player
- * Will also retrieve version from ProtocolSupport if it's being used.
- *
- * @param player Bukkit player object
- * @return Protocol ID, For example (47=1.8-1.8.8, 107=1.9, 108=1.9.1)
- */
- int getPlayerVersion(Player player);
-
- /**
- * Get protocol number from a player
- *
- * @param uuid UUID of a player
- * @return Protocol ID, For example (47=1.8-1.8.8, 107=1.9, 108=1.9.1)
- */
- int getPlayerVersion(UUID uuid);
-
- /**
- * Is player using 1.9?
- *
- * @param playerUUID UUID of a player
- * @return True if the client is on 1.9
- * @deprecated As of 0.9.9, because all players are ported use {@link #getPlayerVersion(UUID)}
- */
- @Deprecated
- boolean isPorted(UUID playerUUID);
-
- /**
- * Get the version of the plugin
- *
- * @return Plugin version
- */
- String getVersion();
-
- /**
- * Send a raw packet to the player (Use new IDs)
- *
- * @param player The player to send packet
- * @param packet The packet, you need a VarInt ID then the packet contents.
- * @throws IllegalArgumentException If not on 1.9 throws IllegalArg
- */
- void sendRawPacket(Player player, ByteBuf packet) throws IllegalArgumentException;
-
- /**
- * Send a raw packet to the player (Use new IDs)
- *
- * @param uuid The uuid from the player to send packet
- * @param packet The packet, you need a VarInt ID then the packet contents.
- * @throws IllegalArgumentException If not on 1.9 throws IllegalArg
- */
- void sendRawPacket(UUID uuid, ByteBuf packet) throws IllegalArgumentException;
-
- /**
- * Create a new bossbar instance
- *
- * @param title The title
- * @param color The color
- * @param style The style
- * @return Bossbar instance
- */
- BossBar createBossBar(String title, BossColor color, BossStyle style);
-
- /**
- * Create a new bossbar instance
- *
- * @param title The title
- * @param health Number between 0 and 1
- * @param color The color
- * @param style The style
- * @return Bossbar instance
- */
- BossBar createBossBar(String title, float health, BossColor color, BossStyle style);
-
- /**
- * Get if global debug is enabled
- *
- * @return true if debug is enabled
- */
- boolean isDebug();
-
- /**
- * Get ViaVersions command handler
- *
- * @return command handler
- */
- ViaVersionCommand getCommandHandler();
-
- /**
- * Get if this version is a compatibility build for spigot.
- * Eg. 1.9.1 / 1.9.2 allow certain versions to connect
- *
- * @return True if it is
- */
- boolean isCompatSpigotBuild();
-
- /**
- * Get the supported protocol versions
- * This method removes any blocked protocol versions.
- *
- * @return a list of protocol versions
- * @see ProtocolRegistry#getSupportedVersions() for full list.
- */
- SortedSet getSupportedVersions();
-
- /**
- * Gets if the server uses spigot
- *
- * Note: Will only work after ViaVersion load
- *
- * @return True if spigot
- */
- boolean isSpigot();
-
- /**
- * Gets if protocol support is also being used.
- *
- * @return True if it is being used.
- */
- boolean isProtocolSupport();
-}
+package us.myles.ViaVersion.api;
+
+import io.netty.buffer.ByteBuf;
+import org.bukkit.entity.Player;
+import us.myles.ViaVersion.api.boss.BossBar;
+import us.myles.ViaVersion.api.boss.BossColor;
+import us.myles.ViaVersion.api.boss.BossStyle;
+import us.myles.ViaVersion.api.command.ViaVersionCommand;
+import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
+
+import java.util.SortedSet;
+import java.util.UUID;
+
+@Deprecated
+public interface ViaVersionAPI {
+ /**
+ * Is the player connection modified by ViaVersion?
+ *
+ * @param player Bukkit player object
+ * @return True if the client is modified (At the moment it also means version 1.9 and higher)
+ * @deprecated As of 0.9.9, because all players are ported use {@link #getPlayerVersion(Player)}
+ */
+ boolean isPorted(Player player);
+
+ /**
+ * Get protocol number from a player
+ * Will also retrieve version from ProtocolSupport if it's being used.
+ *
+ * @param player Bukkit player object
+ * @return Protocol ID, For example (47=1.8-1.8.8, 107=1.9, 108=1.9.1)
+ */
+ int getPlayerVersion(Player player);
+
+ /**
+ * Get protocol number from a player
+ *
+ * @param uuid UUID of a player
+ * @return Protocol ID, For example (47=1.8-1.8.8, 107=1.9, 108=1.9.1)
+ */
+ int getPlayerVersion(UUID uuid);
+
+ /**
+ * Is player using 1.9?
+ *
+ * @param playerUUID UUID of a player
+ * @return True if the client is on 1.9
+ * @deprecated As of 0.9.9, because all players are ported use {@link #getPlayerVersion(UUID)}
+ */
+ @Deprecated
+ boolean isPorted(UUID playerUUID);
+
+ /**
+ * Get the version of the plugin
+ *
+ * @return Plugin version
+ */
+ String getVersion();
+
+ /**
+ * Send a raw packet to the player (Use new IDs)
+ *
+ * @param player The player to send packet
+ * @param packet The packet, you need a VarInt ID then the packet contents.
+ * @throws IllegalArgumentException If not on 1.9 throws IllegalArg
+ */
+ void sendRawPacket(Player player, ByteBuf packet) throws IllegalArgumentException;
+
+ /**
+ * Send a raw packet to the player (Use new IDs)
+ *
+ * @param uuid The uuid from the player to send packet
+ * @param packet The packet, you need a VarInt ID then the packet contents.
+ * @throws IllegalArgumentException If not on 1.9 throws IllegalArg
+ */
+ void sendRawPacket(UUID uuid, ByteBuf packet) throws IllegalArgumentException;
+
+ /**
+ * Create a new bossbar instance
+ *
+ * @param title The title
+ * @param color The color
+ * @param style The style
+ * @return Bossbar instance
+ */
+ BossBar createBossBar(String title, BossColor color, BossStyle style);
+
+ /**
+ * Create a new bossbar instance
+ *
+ * @param title The title
+ * @param health Number between 0 and 1
+ * @param color The color
+ * @param style The style
+ * @return Bossbar instance
+ */
+ BossBar createBossBar(String title, float health, BossColor color, BossStyle style);
+
+ /**
+ * Get if global debug is enabled
+ *
+ * @return true if debug is enabled
+ */
+ boolean isDebug();
+
+ /**
+ * Get ViaVersions command handler
+ *
+ * @return command handler
+ */
+ ViaVersionCommand getCommandHandler();
+
+ /**
+ * Get if this version is a compatibility build for spigot.
+ * Eg. 1.9.1 / 1.9.2 allow certain versions to connect
+ *
+ * @return True if it is
+ */
+ boolean isCompatSpigotBuild();
+
+ /**
+ * Get the supported protocol versions
+ * This method removes any blocked protocol versions.
+ *
+ * @return a list of protocol versions
+ * @see ProtocolRegistry#getSupportedVersions() for full list.
+ */
+ SortedSet getSupportedVersions();
+
+ /**
+ * Gets if the server uses spigot
+ *
+ * Note: Will only work after ViaVersion load
+ *
+ * @return True if spigot
+ */
+ boolean isSpigot();
+
+ /**
+ * Gets if protocol support is also being used.
+ *
+ * @return True if it is being used.
+ */
+ boolean isProtocolSupport();
+}
diff --git a/src/main/java/us/myles/ViaVersion/boss/ViaBossBar.java b/bukkit/src/main/java/us/myles/ViaVersion/boss/ViaBossBar.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/boss/ViaBossBar.java
rename to bukkit/src/main/java/us/myles/ViaVersion/boss/ViaBossBar.java
diff --git a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandHandler.java
new file mode 100644
index 000000000..a5b0a6d64
--- /dev/null
+++ b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandHandler.java
@@ -0,0 +1,21 @@
+package us.myles.ViaVersion.bukkit;
+
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.TabExecutor;
+import us.myles.ViaVersion.commands.ViaCommandHandler;
+
+import java.util.List;
+
+public class BukkitCommandHandler extends ViaCommandHandler implements CommandExecutor, TabExecutor {
+ @Override
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+ return onCommand(new BukkitCommandSender(sender), args);
+ }
+
+ @Override
+ public List onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
+ return onTabComplete(new BukkitCommandSender(sender), args);
+ }
+}
diff --git a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandSender.java b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandSender.java
new file mode 100644
index 000000000..64dbf26b6
--- /dev/null
+++ b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/BukkitCommandSender.java
@@ -0,0 +1,20 @@
+package us.myles.ViaVersion.bukkit;
+
+import lombok.AllArgsConstructor;
+import org.bukkit.command.CommandSender;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
+
+@AllArgsConstructor
+public class BukkitCommandSender implements ViaCommandSender {
+ private CommandSender sender;
+
+ @Override
+ public boolean hasPermission(String permission) {
+ return sender.hasPermission(permission);
+ }
+
+ @Override
+ public void sendMessage(String msg) {
+ sender.sendMessage(msg);
+ }
+}
diff --git a/src/main/java/us/myles/ViaVersion/classgenerator/BasicHandlerConstructor.java b/bukkit/src/main/java/us/myles/ViaVersion/classgenerator/BasicHandlerConstructor.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/classgenerator/BasicHandlerConstructor.java
rename to bukkit/src/main/java/us/myles/ViaVersion/classgenerator/BasicHandlerConstructor.java
diff --git a/src/main/java/us/myles/ViaVersion/classgenerator/ClassGenerator.java b/bukkit/src/main/java/us/myles/ViaVersion/classgenerator/ClassGenerator.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/classgenerator/ClassGenerator.java
rename to bukkit/src/main/java/us/myles/ViaVersion/classgenerator/ClassGenerator.java
diff --git a/src/main/java/us/myles/ViaVersion/classgenerator/HandlerConstructor.java b/bukkit/src/main/java/us/myles/ViaVersion/classgenerator/HandlerConstructor.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/classgenerator/HandlerConstructor.java
rename to bukkit/src/main/java/us/myles/ViaVersion/classgenerator/HandlerConstructor.java
diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java
rename to bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaDecodeHandler.java
diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java
rename to bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaEncodeHandler.java
diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaPacketHandler.java b/bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaPacketHandler.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/handlers/ViaPacketHandler.java
rename to bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaPacketHandler.java
diff --git a/src/main/java/us/myles/ViaVersion/handlers/ViaVersionInitializer.java b/bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaVersionInitializer.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/handlers/ViaVersionInitializer.java
rename to bukkit/src/main/java/us/myles/ViaVersion/handlers/ViaVersionInitializer.java
diff --git a/src/main/java/us/myles/ViaVersion/update/UpdateListener.java b/bukkit/src/main/java/us/myles/ViaVersion/listeners/UpdateListener.java
similarity index 68%
rename from src/main/java/us/myles/ViaVersion/update/UpdateListener.java
rename to bukkit/src/main/java/us/myles/ViaVersion/listeners/UpdateListener.java
index 965e142ac..c71921d88 100644
--- a/src/main/java/us/myles/ViaVersion/update/UpdateListener.java
+++ b/bukkit/src/main/java/us/myles/ViaVersion/listeners/UpdateListener.java
@@ -1,23 +1,19 @@
-package us.myles.ViaVersion.update;
-
-import lombok.RequiredArgsConstructor;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerJoinEvent;
-import us.myles.ViaVersion.ViaVersionPlugin;
-import us.myles.ViaVersion.api.ViaVersion;
-
-@RequiredArgsConstructor
-public class UpdateListener implements Listener {
-
- private final ViaVersionPlugin plugin;
-
- @EventHandler
- public void onJoin(PlayerJoinEvent e) {
- if (e.getPlayer().hasPermission("viaversion.update")
- && ViaVersion.getConfig().isCheckForUpdates()) {
- UpdateUtil.sendUpdateMessage(e.getPlayer().getUniqueId(), plugin);
- }
- }
-
-}
+package us.myles.ViaVersion.listeners;
+
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerJoinEvent;
+import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.update.UpdateUtil;
+
+public class UpdateListener implements Listener {
+
+ @EventHandler
+ public void onJoin(PlayerJoinEvent e) {
+ if (e.getPlayer().hasPermission("viaversion.update")
+ && ViaVersion.getConfig().isCheckForUpdates()) {
+ UpdateUtil.sendUpdateMessage(e.getPlayer().getUniqueId());
+ }
+ }
+
+}
diff --git a/src/main/java/us/myles/ViaVersion/util/Configuration.java b/bukkit/src/main/java/us/myles/ViaVersion/util/Configuration.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/Configuration.java
rename to bukkit/src/main/java/us/myles/ViaVersion/util/Configuration.java
diff --git a/src/main/java/us/myles/ViaVersion/util/ProtocolSupportUtil.java b/bukkit/src/main/java/us/myles/ViaVersion/util/ProtocolSupportUtil.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/ProtocolSupportUtil.java
rename to bukkit/src/main/java/us/myles/ViaVersion/util/ProtocolSupportUtil.java
diff --git a/src/main/java/us/myles/ViaVersion/util/ReflectionUtil.java b/bukkit/src/main/java/us/myles/ViaVersion/util/ReflectionUtil.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/ReflectionUtil.java
rename to bukkit/src/main/java/us/myles/ViaVersion/util/ReflectionUtil.java
diff --git a/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml
similarity index 100%
rename from src/main/resources/config.yml
rename to bukkit/src/main/resources/config.yml
diff --git a/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml
similarity index 100%
rename from src/main/resources/plugin.yml
rename to bukkit/src/main/resources/plugin.yml
diff --git a/bungee/pom.xml b/bungee/pom.xml
new file mode 100644
index 000000000..613d7bb07
--- /dev/null
+++ b/bungee/pom.xml
@@ -0,0 +1,23 @@
+
+
+
+ viaversion
+ us.myles
+ 1.0.0-ALPHA-16w38a
+
+ 4.0.0
+
+ viaversion-bungee
+
+
+
+
+ net.md-5
+ bungeecord-api
+ 1.9-SNAPSHOT
+ provided
+
+
+
\ No newline at end of file
diff --git a/src/main/java/us/myles/ViaVersion/Bungee.java b/bungee/src/main/java/us/myles/ViaVersion/Bungee.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/Bungee.java
rename to bungee/src/main/java/us/myles/ViaVersion/Bungee.java
diff --git a/src/main/resources/bungee.yml b/bungee/src/main/resources/bungee.yml
similarity index 100%
rename from src/main/resources/bungee.yml
rename to bungee/src/main/resources/bungee.yml
diff --git a/common/pom.xml b/common/pom.xml
new file mode 100644
index 000000000..a8efbad02
--- /dev/null
+++ b/common/pom.xml
@@ -0,0 +1,14 @@
+
+
+
+ viaversion
+ us.myles
+ 1.0.0-ALPHA-16w38a
+
+ 4.0.0
+
+ viaversion-common
+
+
\ No newline at end of file
diff --git a/src/main/java/us/myles/ViaVersion/api/PacketWrapper.java b/common/src/main/java/us/myles/ViaVersion/api/PacketWrapper.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/PacketWrapper.java
rename to common/src/main/java/us/myles/ViaVersion/api/PacketWrapper.java
diff --git a/src/main/java/us/myles/ViaVersion/api/Pair.java b/common/src/main/java/us/myles/ViaVersion/api/Pair.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/Pair.java
rename to common/src/main/java/us/myles/ViaVersion/api/Pair.java
diff --git a/common/src/main/java/us/myles/ViaVersion/api/Via.java b/common/src/main/java/us/myles/ViaVersion/api/Via.java
new file mode 100644
index 000000000..06d2461d6
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/api/Via.java
@@ -0,0 +1,15 @@
+package us.myles.ViaVersion.api;
+
+import lombok.Getter;
+import org.apache.commons.lang.Validate;
+import us.myles.ViaVersion.api.platform.ViaPlatform;
+
+public class Via {
+ @Getter
+ private static ViaPlatform platform;
+
+ public static void init(ViaPlatform platform) {
+ Validate.isTrue(platform == null, "Platform is already set");
+ Via.platform = platform;
+ }
+}
diff --git a/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java b/common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java
rename to common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java
diff --git a/src/main/java/us/myles/ViaVersion/api/boss/BossBar.java b/common/src/main/java/us/myles/ViaVersion/api/boss/BossBar.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/boss/BossBar.java
rename to common/src/main/java/us/myles/ViaVersion/api/boss/BossBar.java
diff --git a/src/main/java/us/myles/ViaVersion/api/boss/BossColor.java b/common/src/main/java/us/myles/ViaVersion/api/boss/BossColor.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/boss/BossColor.java
rename to common/src/main/java/us/myles/ViaVersion/api/boss/BossColor.java
diff --git a/src/main/java/us/myles/ViaVersion/api/boss/BossFlag.java b/common/src/main/java/us/myles/ViaVersion/api/boss/BossFlag.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/boss/BossFlag.java
rename to common/src/main/java/us/myles/ViaVersion/api/boss/BossFlag.java
diff --git a/src/main/java/us/myles/ViaVersion/api/boss/BossStyle.java b/common/src/main/java/us/myles/ViaVersion/api/boss/BossStyle.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/boss/BossStyle.java
rename to common/src/main/java/us/myles/ViaVersion/api/boss/BossStyle.java
diff --git a/common/src/main/java/us/myles/ViaVersion/api/command/ViaCommandSender.java b/common/src/main/java/us/myles/ViaVersion/api/command/ViaCommandSender.java
new file mode 100644
index 000000000..8dacd6526
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/api/command/ViaCommandSender.java
@@ -0,0 +1,6 @@
+package us.myles.ViaVersion.api.command;
+
+public interface ViaCommandSender {
+ public boolean hasPermission(String permission);
+ public void sendMessage(String msg);
+}
diff --git a/src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java b/common/src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java
similarity index 85%
rename from src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java
rename to common/src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java
index 000b97d6e..86df89e65 100644
--- a/src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java
+++ b/common/src/main/java/us/myles/ViaVersion/api/command/ViaSubCommand.java
@@ -1,6 +1,5 @@
package us.myles.ViaVersion.api.command;
-import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.commands.ViaCommandHandler;
import java.util.Collections;
@@ -47,7 +46,7 @@ public abstract class ViaSubCommand {
* @param args Arguments
* @return command executed succesfully if false, show usage
*/
- public abstract boolean execute(CommandSender sender, String[] args);
+ public abstract boolean execute(ViaCommandSender sender, String[] args);
/**
* Yay, possibility to implement tab-completion
@@ -56,7 +55,7 @@ public abstract class ViaSubCommand {
* @param args args
* @return tab complete possibilities
*/
- public List onTabComplete(CommandSender sender, String[] args) {
+ public List onTabComplete(ViaCommandSender sender, String[] args) {
return Collections.emptyList();
}
@@ -71,7 +70,7 @@ public abstract class ViaSubCommand {
* @param message string message
* @param args optional objects
*/
- public void sendMessage(CommandSender sender, String message, Object... args) {
+ public void sendMessage(ViaCommandSender sender, String message, Object... args) {
ViaCommandHandler.sendMessage(sender, message, args);
}
}
diff --git a/src/main/java/us/myles/ViaVersion/api/command/ViaVersionCommand.java b/common/src/main/java/us/myles/ViaVersion/api/command/ViaVersionCommand.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/command/ViaVersionCommand.java
rename to common/src/main/java/us/myles/ViaVersion/api/command/ViaVersionCommand.java
diff --git a/src/main/java/us/myles/ViaVersion/api/data/StoredObject.java b/common/src/main/java/us/myles/ViaVersion/api/data/StoredObject.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/data/StoredObject.java
rename to common/src/main/java/us/myles/ViaVersion/api/data/StoredObject.java
diff --git a/src/main/java/us/myles/ViaVersion/api/data/UserConnection.java b/common/src/main/java/us/myles/ViaVersion/api/data/UserConnection.java
similarity index 87%
rename from src/main/java/us/myles/ViaVersion/api/data/UserConnection.java
rename to common/src/main/java/us/myles/ViaVersion/api/data/UserConnection.java
index 28ddac8c1..a22f77f2a 100644
--- a/src/main/java/us/myles/ViaVersion/api/data/UserConnection.java
+++ b/common/src/main/java/us/myles/ViaVersion/api/data/UserConnection.java
@@ -5,9 +5,8 @@ import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandler;
import io.netty.channel.socket.SocketChannel;
import lombok.Data;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
+import net.md_5.bungee.api.ChatColor;
+import us.myles.ViaVersion.api.ViaVersion;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import java.util.Map;
@@ -145,18 +144,15 @@ public class UserConnection {
pendingDisconnect = true;
if (get(ProtocolInfo.class).getUuid() != null) {
final UUID uuid = get(ProtocolInfo.class).getUuid();
- if (Bukkit.getPlayer(uuid) != null) {
- Bukkit.getScheduler().runTask(Bukkit.getPluginManager().getPlugin("ViaVersion"), new Runnable() {
- @Override
- public void run() {
- Player player = Bukkit.getPlayer(uuid);
- if (player != null)
- player.kickPlayer(ChatColor.translateAlternateColorCodes('&', reason));
+ ViaVersion.getPlatform().runSync(new Runnable() {
+ @Override
+ public void run() {
+ if (!ViaVersion.getPlatform().kickPlayer(uuid, ChatColor.translateAlternateColorCodes('&', reason))) {
+ getChannel().close(); // =)
}
- });
- return;
- }
+ }
+ });
}
- getChannel().close(); // =)
+
}
}
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/Position.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/Position.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/Position.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/Position.java
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/Chunk.java
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/ChunkSection.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/ChunkSection.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/chunks/ChunkSection.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/ChunkSection.java
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/NibbleArray.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/NibbleArray.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/chunks/NibbleArray.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/NibbleArray.java
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/item/Item.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/item/Item.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/item/Item.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/item/Item.java
diff --git a/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/Metadata.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/Metadata.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/minecraft/metadata/Metadata.java
rename to common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/Metadata.java
diff --git a/common/src/main/java/us/myles/ViaVersion/api/platform/ViaPlatform.java b/common/src/main/java/us/myles/ViaVersion/api/platform/ViaPlatform.java
new file mode 100644
index 000000000..f72e85438
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/api/platform/ViaPlatform.java
@@ -0,0 +1,22 @@
+package us.myles.ViaVersion.api.platform;
+
+import java.util.UUID;
+import java.util.logging.Logger;
+
+public interface ViaPlatform {
+ public Logger getLogger();
+
+ public String getPlatformName();
+
+ public String getPluginVersion();
+
+ public void runAsync(Runnable runnable);
+
+ public void runSync(Runnable runnable);
+
+ public void sendMessage(UUID uuid, String message);
+
+ public boolean kickPlayer(UUID uuid, String message);
+
+ public boolean isPluginEnabled();
+}
diff --git a/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java
rename to common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java
diff --git a/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java
rename to common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java
index cf0b03385..fc43208df 100644
--- a/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java
+++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolPipeline.java
@@ -1,9 +1,9 @@
package us.myles.ViaVersion.api.protocol;
-import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.ViaVersion;
import us.myles.ViaVersion.api.data.UserConnection;
+import us.myles.ViaVersion.api.platform.ViaPlatform;
import us.myles.ViaVersion.packets.Direction;
import us.myles.ViaVersion.packets.PacketType;
import us.myles.ViaVersion.packets.State;
@@ -109,12 +109,12 @@ public class ProtocolPipeline extends Protocol {
}
}
String name = packet + "[" + userConnection.get(ProtocolInfo.class).getProtocolVersion() + "]";
- ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
+ ViaPlatform platform = ViaVersion.getPlatform();
String actualUsername = packetWrapper.user().get(ProtocolInfo.class).getUsername();
String username = actualUsername != null ? actualUsername + " " : "";
- plugin.getLogger().log(Level.INFO, "{0}{1}: {2} {3} -> {4} [{5}] Value: {6}",
+ platform.getLogger().log(Level.INFO, "{0}{1}: {2} {3} -> {4} [{5}] Value: {6}",
new Object[]{
username,
direction,
diff --git a/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
similarity index 98%
rename from src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
rename to common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
index d8349fc25..59016e270 100644
--- a/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
+++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java
@@ -2,8 +2,8 @@ package us.myles.ViaVersion.api.protocol;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-import org.bukkit.Bukkit;
import us.myles.ViaVersion.api.Pair;
+import us.myles.ViaVersion.api.ViaVersion;
import us.myles.ViaVersion.protocols.base.BaseProtocol;
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2TO1_9_3_4;
@@ -61,7 +61,7 @@ public class ProtocolRegistry {
registryMap.get(version).put(output, protocol);
}
- if (Bukkit.getPluginManager().getPlugin("ViaVersion").isEnabled()) {
+ if (ViaVersion.getPlatform().isPluginEnabled()) {
protocol.registerListeners();
refreshVersions();
} else {
diff --git a/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java
rename to common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/PacketHandler.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/PacketHandler.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/PacketHandler.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/PacketHandler.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/PacketRemapper.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/PacketRemapper.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/PacketRemapper.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/PacketRemapper.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/TypeRemapper.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/TypeRemapper.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/TypeRemapper.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/TypeRemapper.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/ValueCreator.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/ValueCreator.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/ValueCreator.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/ValueCreator.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/ValueReader.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/ValueReader.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/ValueReader.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/ValueReader.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/ValueTransformer.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/ValueTransformer.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/ValueTransformer.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/ValueTransformer.java
diff --git a/src/main/java/us/myles/ViaVersion/api/remapper/ValueWriter.java b/common/src/main/java/us/myles/ViaVersion/api/remapper/ValueWriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/remapper/ValueWriter.java
rename to common/src/main/java/us/myles/ViaVersion/api/remapper/ValueWriter.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/ByteBufReader.java b/common/src/main/java/us/myles/ViaVersion/api/type/ByteBufReader.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/ByteBufReader.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/ByteBufReader.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/ByteBufWriter.java b/common/src/main/java/us/myles/ViaVersion/api/type/ByteBufWriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/ByteBufWriter.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/ByteBufWriter.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/PartialType.java b/common/src/main/java/us/myles/ViaVersion/api/type/PartialType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/PartialType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/PartialType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/Type.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/Type.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/TypeConverter.java b/common/src/main/java/us/myles/ViaVersion/api/type/TypeConverter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/TypeConverter.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/TypeConverter.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/ArrayType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/ArrayType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/ArrayType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/ArrayType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/BooleanType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/BooleanType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/BooleanType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/BooleanType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/ByteType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/ByteType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/ByteType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/ByteType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/DoubleType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/DoubleType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/DoubleType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/DoubleType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/FloatType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/FloatType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/FloatType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/FloatType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/IntType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/IntType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/IntType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/IntType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/LongType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/LongType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/LongType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/LongType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/RemainingBytesType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/RemainingBytesType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/RemainingBytesType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/RemainingBytesType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/ShortType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/ShortType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/ShortType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/ShortType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/StringType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/StringType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/StringType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/StringType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/UUIDType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/UUIDType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/UUIDType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/UUIDType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedByteType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedByteType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/UnsignedByteType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedByteType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedShortType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedShortType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/UnsignedShortType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/UnsignedShortType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/VarIntType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/VarIntType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/VarIntType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/VarIntType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/VoidType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/VoidType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/VoidType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/VoidType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/BaseChunkType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/BaseChunkType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/BaseChunkType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/BaseChunkType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/EulerAngleType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/EulerAngleType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/EulerAngleType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/EulerAngleType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemArrayType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemArrayType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemArrayType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemArrayType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/ItemType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaListTypeTemplate.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaListTypeTemplate.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaListTypeTemplate.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaListTypeTemplate.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaTypeTemplate.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaTypeTemplate.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaTypeTemplate.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/MetaTypeTemplate.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/NBTType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/NBTType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/NBTType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/NBTType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptPositionType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptPositionType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptPositionType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptPositionType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptUUIDType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptUUIDType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptUUIDType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/OptUUIDType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/PositionType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/PositionType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/PositionType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/PositionType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/VectorType.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/VectorType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/minecraft/VectorType.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/minecraft/VectorType.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_8Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_8Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_8Type.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_8Type.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_9Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_9Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_9Type.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/Metadata1_9Type.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_8Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_8Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_8Type.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_8Type.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_9Type.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_9Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_9Type.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/MetadataList1_9Type.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_8.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_8.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_8.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_8.java
diff --git a/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_9.java b/common/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_9.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_9.java
rename to common/src/main/java/us/myles/ViaVersion/api/type/types/version/Types1_9.java
diff --git a/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java b/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
similarity index 83%
rename from src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
rename to common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
index c67230529..9423b1837 100644
--- a/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
@@ -1,20 +1,17 @@
package us.myles.ViaVersion.commands;
import lombok.NonNull;
+import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang.Validate;
-import org.bukkit.ChatColor;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandExecutor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.command.TabCompleter;
-import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.Via;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.api.command.ViaVersionCommand;
import us.myles.ViaVersion.commands.defaultsubs.*;
import java.util.*;
-public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, TabCompleter {
+public abstract class ViaCommandHandler implements ViaVersionCommand {
private Map commandMap;
public ViaCommandHandler() {
@@ -44,8 +41,7 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
return commandMap.get(name.toLowerCase());
}
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String arg, String[] args) {
+ public boolean onCommand(ViaCommandSender sender, String[] args) {
if (args.length == 0) {
showHelp(sender);
return false;
@@ -70,8 +66,7 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
return result;
}
- @Override
- public List onTabComplete(CommandSender sender, Command command, String arg, String[] args) {
+ public List onTabComplete(ViaCommandSender sender, String[] args) {
Set allowed = calculateAllowedCommands(sender);
List output = new ArrayList<>();
@@ -103,20 +98,20 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
return output;
}
- public void showHelp(CommandSender sender) {
+ public void showHelp(ViaCommandSender sender) {
Set allowed = calculateAllowedCommands(sender);
if (allowed.size() == 0) {
sender.sendMessage(color("&cYou are not allowed to use this command!"));
return;
}
- sender.sendMessage(color("&aViaVersion &c" + ViaVersion.getInstance().getVersion()));
+ sender.sendMessage(color("&aViaVersion &c" + Via.getPlatform().getPluginVersion()));
sender.sendMessage(color("&6Commands:"));
for (ViaSubCommand cmd : allowed)
sender.sendMessage(color(String.format("&2/viaversion %s &7- &6%s", cmd.usage(), cmd.description())));
allowed.clear();
}
- private Set calculateAllowedCommands(CommandSender sender) {
+ private Set calculateAllowedCommands(ViaCommandSender sender) {
Set cmds = new HashSet<>();
for (ViaSubCommand sub : commandMap.values())
if (hasPermission(sender, sub.permission()))
@@ -124,7 +119,7 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
return cmds;
}
- private boolean hasPermission(CommandSender sender, String permission) {
+ private boolean hasPermission(ViaCommandSender sender, String permission) {
return permission == null || sender.hasPermission(permission);
}
@@ -148,7 +143,7 @@ public class ViaCommandHandler implements ViaVersionCommand, CommandExecutor, Ta
return string;
}
- public static void sendMessage(@NonNull CommandSender sender, String message, Object... args) {
+ public static void sendMessage(@NonNull ViaCommandSender sender, String message, Object... args) {
sender.sendMessage(color(args == null ? message : String.format(message, args)));
}
}
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java
similarity index 88%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java
index 0217f12d8..dee8f5331 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/AutoTeamSubCmd.java
@@ -1,8 +1,8 @@
package us.myles.ViaVersion.commands.defaultsubs;
-import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
public class AutoTeamSubCmd extends ViaSubCommand {
@@ -17,7 +17,7 @@ public class AutoTeamSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
boolean newValue = !ViaVersion.getConfig().isAutoTeam();
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java
similarity index 85%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java
index 931ac7282..997f5670d 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DebugSubCmd.java
@@ -3,6 +3,7 @@ package us.myles.ViaVersion.commands.defaultsubs;
import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
public class DebugSubCmd extends ViaSubCommand {
@@ -17,7 +18,7 @@ public class DebugSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
plugin.setDebug(!plugin.isDebug());
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java
similarity index 87%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java
index 8701d9f6f..309b1a85c 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DisplayLeaksSubCmd.java
@@ -2,6 +2,7 @@ package us.myles.ViaVersion.commands.defaultsubs;
import io.netty.util.ResourceLeakDetector;
import org.bukkit.command.CommandSender;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
public class DisplayLeaksSubCmd extends ViaSubCommand {
@@ -16,7 +17,7 @@ public class DisplayLeaksSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
if (ResourceLeakDetector.getLevel() != ResourceLeakDetector.Level.ADVANCED)
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED);
else
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java
similarity index 87%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java
index f99936c0d..b35ecf382 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DontBugMeSubCmd.java
@@ -3,6 +3,7 @@ package us.myles.ViaVersion.commands.defaultsubs;
import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
public class DontBugMeSubCmd extends ViaSubCommand {
@@ -17,7 +18,7 @@ public class DontBugMeSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
boolean newValue = !ViaVersion.getConfig().isCheckForUpdates();
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java
index 03ad3472d..adb108ff7 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/DumpSubCmd.java
@@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.dump.DumpTemplate;
@@ -40,7 +41,7 @@ public class DumpSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(final CommandSender sender, String[] args) {
+ public boolean execute(final ViaCommandSender sender, String[] args) {
VersionInfo version = new VersionInfo(
Bukkit.getServer().getVersion(),
Bukkit.getServer().getBukkitVersion(),
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java
similarity index 84%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java
index 40f936107..6f674c18f 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/HelpSubCmd.java
@@ -3,6 +3,7 @@ package us.myles.ViaVersion.commands.defaultsubs;
import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.commands.ViaCommandHandler;
@@ -18,7 +19,7 @@ public class HelpSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
((ViaCommandHandler) plugin.getCommandHandler()).showHelp(sender);
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java
similarity index 92%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java
index 2c85a6de6..53c4047e1 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ListSubCmd.java
@@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
@@ -26,7 +27,7 @@ public class ListSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
Map> playerVersions = new TreeMap<>(new Comparator() {
@Override
public int compare(ProtocolVersion o1, ProtocolVersion o2) {
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java
similarity index 94%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java
index d2e7bc186..6cf98ae8e 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/PPSSubCmd.java
@@ -5,6 +5,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
@@ -28,7 +29,7 @@ public class PPSSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
Map> playerVersions = new HashMap<>();
int totalPackets = 0;
int clients = 0;
diff --git a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java
similarity index 84%
rename from src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java
rename to common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java
index 9a25e6c13..b919e4ab8 100644
--- a/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/defaultsubs/ReloadSubCmd.java
@@ -1,8 +1,8 @@
package us.myles.ViaVersion.commands.defaultsubs;
-import org.bukkit.command.CommandSender;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.ViaVersion;
+import us.myles.ViaVersion.api.command.ViaCommandSender;
import us.myles.ViaVersion.api.command.ViaSubCommand;
public class ReloadSubCmd extends ViaSubCommand {
@@ -17,7 +17,7 @@ public class ReloadSubCmd extends ViaSubCommand {
}
@Override
- public boolean execute(CommandSender sender, String[] args) {
+ public boolean execute(ViaCommandSender sender, String[] args) {
ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance();
plugin.getConf().generateConfig();
diff --git a/src/main/java/us/myles/ViaVersion/dump/DumpTemplate.java b/common/src/main/java/us/myles/ViaVersion/dump/DumpTemplate.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/dump/DumpTemplate.java
rename to common/src/main/java/us/myles/ViaVersion/dump/DumpTemplate.java
diff --git a/src/main/java/us/myles/ViaVersion/dump/PluginInfo.java b/common/src/main/java/us/myles/ViaVersion/dump/PluginInfo.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/dump/PluginInfo.java
rename to common/src/main/java/us/myles/ViaVersion/dump/PluginInfo.java
diff --git a/src/main/java/us/myles/ViaVersion/dump/VersionInfo.java b/common/src/main/java/us/myles/ViaVersion/dump/VersionInfo.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/dump/VersionInfo.java
rename to common/src/main/java/us/myles/ViaVersion/dump/VersionInfo.java
diff --git a/src/main/java/us/myles/ViaVersion/exception/CancelException.java b/common/src/main/java/us/myles/ViaVersion/exception/CancelException.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/exception/CancelException.java
rename to common/src/main/java/us/myles/ViaVersion/exception/CancelException.java
diff --git a/src/main/java/us/myles/ViaVersion/exception/InformativeException.java b/common/src/main/java/us/myles/ViaVersion/exception/InformativeException.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/exception/InformativeException.java
rename to common/src/main/java/us/myles/ViaVersion/exception/InformativeException.java
diff --git a/src/main/java/us/myles/ViaVersion/packets/Direction.java b/common/src/main/java/us/myles/ViaVersion/packets/Direction.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/packets/Direction.java
rename to common/src/main/java/us/myles/ViaVersion/packets/Direction.java
diff --git a/src/main/java/us/myles/ViaVersion/packets/PacketType.java b/common/src/main/java/us/myles/ViaVersion/packets/PacketType.java
similarity index 98%
rename from src/main/java/us/myles/ViaVersion/packets/PacketType.java
rename to common/src/main/java/us/myles/ViaVersion/packets/PacketType.java
index 43bb5cf0c..9aade55b8 100644
--- a/src/main/java/us/myles/ViaVersion/packets/PacketType.java
+++ b/common/src/main/java/us/myles/ViaVersion/packets/PacketType.java
@@ -1,208 +1,208 @@
-package us.myles.ViaVersion.packets;
-
-import java.util.HashMap;
-
-@Deprecated
-public enum PacketType {
- /* Handshake serverbound */
- HANDSHAKE(State.HANDSHAKE, Direction.INCOMING, 0x00), // Mapped
- /* Login serverbound */
- LOGIN_START(State.LOGIN, Direction.INCOMING, 0x00), // Mapped
- LOGIN_ENCRYPTION_RESPONSE(State.LOGIN, Direction.INCOMING, 0x01), // Mapped
- /* Login clientbound */
- LOGIN_DISCONNECT(State.LOGIN, Direction.OUTGOING, 0x00), // Mapped
- LOGIN_ENCRYPTION_REQUEST(State.LOGIN, Direction.OUTGOING, 0x01), // Mapped
- LOGIN_SUCCESS(State.LOGIN, Direction.OUTGOING, 0x02), // Mapped
- LOGIN_SETCOMPRESSION(State.LOGIN, Direction.OUTGOING, 0x03), // Mapped
-
- /* Status serverbound */
- STATUS_REQUEST(State.STATUS, Direction.INCOMING, 0x00), // Mapped
- STATUS_PING(State.STATUS, Direction.INCOMING, 0x01), // Mapped
- /* Status clientbound */
- STATUS_RESPONSE(State.STATUS, Direction.OUTGOING, 0x00),
- STATUS_PONG(State.STATUS, Direction.OUTGOING, 0x01),
- /* Play serverbound */
- PLAY_TP_CONFIRM(State.PLAY, Direction.INCOMING, -1, 0x00), // Mapped
- PLAY_TAB_COMPLETE_REQUEST(State.PLAY, Direction.INCOMING, 0x14, 0x01), // Mapped
- PLAY_CHAT_MESSAGE_CLIENT(State.PLAY, Direction.INCOMING, 0x01, 0x02), // Mapped
- PLAY_CLIENT_STATUS(State.PLAY, Direction.INCOMING, 0x16, 0x03), // Mapped
- PLAY_CLIENT_SETTINGS(State.PLAY, Direction.INCOMING, 0x15, 0x04), // Mapped
- PLAY_CONFIRM_TRANS(State.PLAY, Direction.INCOMING, 0x0F, 0x05), // Mapped
- PLAY_ENCHANT_ITEM(State.PLAY, Direction.INCOMING, 0x11, 0x06), // Mapped
- PLAY_CLICK_WINDOW(State.PLAY, Direction.INCOMING, 0x0E, 0x07), // Mapped
- PLAY_CLOSE_WINDOW_REQUEST(State.PLAY, Direction.INCOMING, 0x0D, 0x08), // Mapped
- PLAY_PLUGIN_MESSAGE_REQUEST(State.PLAY, Direction.INCOMING, 0x17, 0x09),
- PLAY_USE_ENTITY(State.PLAY, Direction.INCOMING, 0x02, 0x0A), // Mapped
- PLAY_KEEP_ALIVE_REQUEST(State.PLAY, Direction.INCOMING, 0x00, 0x0B), // Mapped
- PLAY_PLAYER_POSITION_REQUEST(State.PLAY, Direction.INCOMING, 0x04, 0x0C), // Mapped
- PLAY_PLAYER_POSITION_LOOK_REQUEST(State.PLAY, Direction.INCOMING, 0x06, 0x0D), // Mapped
- PLAY_PLAYER_LOOK_REQUEST(State.PLAY, Direction.INCOMING, 0x05, 0x0E), // Mapped
- PLAY_PLAYER(State.PLAY, Direction.INCOMING, 0x03, 0x0F), // Mapped
- PLAY_VEHICLE_MOVE_REQUEST(State.PLAY, Direction.INCOMING, -1, 0x10), // Mapped
- PLAY_STEER_BOAT(State.PLAY, Direction.INCOMING, -1, 0x11), // Mapped
- PLAY_PLAYER_ABILITIES_REQUEST(State.PLAY, Direction.INCOMING, 0x13, 0x12), // Mapped
- PLAY_PLAYER_DIGGING(State.PLAY, Direction.INCOMING, 0x07, 0x13), // Mapped
- PLAY_ENTITY_ACTION(State.PLAY, Direction.INCOMING, 0x0B, 0x14), // Mapped
- PLAY_STEER_VEHICLE(State.PLAY, Direction.INCOMING, 0x0C, 0x15), // Mapped
-
- PLAY_RESOURCE_PACK_STATUS(State.PLAY, Direction.INCOMING, 0x19, 0x16), // Mapped
- PLAY_HELD_ITEM_CHANGE_REQUEST(State.PLAY, Direction.INCOMING, 0x09, 0x17), // Mapped
-
- PLAY_CREATIVE_INVENTORY_ACTION(State.PLAY, Direction.INCOMING, 0x10, 0x18), // Mapped
- PLAY_UPDATE_SIGN_REQUEST(State.PLAY, Direction.INCOMING, 0x12, 0x19), // Mapped
- PLAY_ANIMATION_REQUEST(State.PLAY, Direction.INCOMING, 0x0A, 0x1A), // Mapped
- PLAY_SPECTATE(State.PLAY, Direction.INCOMING, 0x18, 0x1B), // Mapped
- PLAY_PLAYER_BLOCK_PLACEMENT(State.PLAY, Direction.INCOMING, 0x08, 0x1C), // Mapped
- PLAY_USE_ITEM(State.PLAY, Direction.INCOMING, -1, 0x1D), // Mapped
- /* Play clientbound */
- PLAY_SPAWN_OBJECT(State.PLAY, Direction.OUTGOING, 0x0E, 0x00), // Mapped
- PLAY_SPAWN_XP_ORB(State.PLAY, Direction.OUTGOING, 0x11, 0x01), // Mapped
- PLAY_SPAWN_GLOBAL_ENTITY(State.PLAY, Direction.OUTGOING, 0x2C, 0x02), // Mapped
- PLAY_SPAWN_MOB(State.PLAY, Direction.OUTGOING, 0x0F, 0x03), // Mapped
- PLAY_SPAWN_PAINTING(State.PLAY, Direction.OUTGOING, 0x10, 0x04), // Mapped
- PLAY_SPAWN_PLAYER(State.PLAY, Direction.OUTGOING, 0x0C, 0x05), // Mapped
-
- PLAY_ANIMATION(State.PLAY, Direction.OUTGOING, 0x0B, 0x06), // Mapped
- PLAY_STATS(State.PLAY, Direction.OUTGOING, 0x37, 0x07), // Mapped
-
- PLAY_BLOCK_BREAK_ANIMATION(State.PLAY, Direction.OUTGOING, 0x25, 0x08), // Mapped
- PLAY_UPDATE_BLOCK_ENTITY(State.PLAY, Direction.OUTGOING, 0x35, 0x09), // Mapped
- PLAY_BLOCK_ACTION(State.PLAY, Direction.OUTGOING, 0x24, 0x0A), // Mapped
- PLAY_BLOCK_CHANGE(State.PLAY, Direction.OUTGOING, 0x23, 0x0B), // Mapped
-
- PLAY_BOSS_BAR(State.PLAY, Direction.OUTGOING, -1, 0x0C),
- PLAY_SERVER_DIFFICULTY(State.PLAY, Direction.OUTGOING, 0x41, 0x0D), // Mapped
- PLAY_TAB_COMPLETE(State.PLAY, Direction.OUTGOING, 0x3A, 0x0E), // Mapped
- PLAY_CHAT_MESSAGE(State.PLAY, Direction.OUTGOING, 0x02, 0x0F), // Mapped
- PLAY_MULTI_BLOCK_CHANGE(State.PLAY, Direction.OUTGOING, 0x22, 0x10), // Mapped
- PLAY_CONFIRM_TRANSACTION(State.PLAY, Direction.OUTGOING, 0x32, 0x11), // Mapped
- PLAY_CLOSE_WINDOW(State.PLAY, Direction.OUTGOING, 0x2E, 0x12), // Mapped
- PLAY_OPEN_WINDOW(State.PLAY, Direction.OUTGOING, 0x2D, 0x13), // Mapped
- PLAY_WINDOW_ITEMS(State.PLAY, Direction.OUTGOING, 0x30, 0x14), // Mapped
- PLAY_WINDOW_PROPERTY(State.PLAY, Direction.OUTGOING, 0x31, 0x15), // Mapped
- PLAY_SET_SLOT(State.PLAY, Direction.OUTGOING, 0x2F, 0x16), // Mapped
- PLAY_SET_COOLDOWN(State.PLAY, Direction.OUTGOING, -1, 0x17),
- PLAY_PLUGIN_MESSAGE(State.PLAY, Direction.OUTGOING, 0x3F, 0x18), // Mapped
- PLAY_NAMED_SOUND_EFFECT(State.PLAY, Direction.OUTGOING, 0x29, 0x19), // Mapped
- PLAY_DISCONNECT(State.PLAY, Direction.OUTGOING, 0x40, 0x1A), // Mapped
- PLAY_ENTITY_STATUS(State.PLAY, Direction.OUTGOING, 0x1A, 0x1B), // Mapped
- PLAY_EXPLOSION(State.PLAY, Direction.OUTGOING, 0x27, 0x1C), // Mapped
- PLAY_UNLOAD_CHUNK(State.PLAY, Direction.OUTGOING, -1, 0x1D),
- PLAY_CHANGE_GAME_STATE(State.PLAY, Direction.OUTGOING, 0x2B, 0x1E),
- PLAY_KEEP_ALIVE(State.PLAY, Direction.OUTGOING, 0x00, 0x1F), // Mapped
- PLAY_CHUNK_DATA(State.PLAY, Direction.OUTGOING, 0x21, 0x20), // Mapped
- PLAY_EFFECT(State.PLAY, Direction.OUTGOING, 0x28, 0x21), // Mapped
- PLAY_PARTICLE(State.PLAY, Direction.OUTGOING, 0x2A, 0x22), // Mapped
- PLAY_JOIN_GAME(State.PLAY, Direction.OUTGOING, 0x01, 0x23), // Mapped
- PLAY_MAP(State.PLAY, Direction.OUTGOING, 0x34, 0x24), // Mapped
- PLAY_ENTITY_RELATIVE_MOVE(State.PLAY, Direction.OUTGOING, 0x15, 0x25), // Mapped
- PLAY_ENTITY_LOOK_MOVE(State.PLAY, Direction.OUTGOING, 0x17, 0x26), // Mapped
- PLAY_ENTITY_LOOK(State.PLAY, Direction.OUTGOING, 0x16, 0x27), // Mapped
- PLAY_ENTITY(State.PLAY, Direction.OUTGOING, 0x14, 0x28), // Mapped
- PLAY_VEHICLE_MOVE(State.PLAY, Direction.OUTGOING, -1, 0x29),
- PLAY_OPEN_SIGN_EDITOR(State.PLAY, Direction.OUTGOING, 0x36, 0x2A), // Mapped
- PLAY_PLAYER_ABILITIES(State.PLAY, Direction.OUTGOING, 0x39, 0x2B), // Mapped
- PLAY_COMBAT_EVENT(State.PLAY, Direction.OUTGOING, 0x42, 0x2C), // Mapped
- PLAY_PLAYER_LIST_ITEM(State.PLAY, Direction.OUTGOING, 0x38, 0x2D), // Mapped
- PLAY_PLAYER_POSITION_LOOK(State.PLAY, Direction.OUTGOING, 0x08, 0x2E), // Mapped
- PLAY_USE_BED(State.PLAY, Direction.OUTGOING, 0x0A, 0x2F), // Mapped
- PLAY_DESTROY_ENTITIES(State.PLAY, Direction.OUTGOING, 0x13, 0x30), // Mapped
- PLAY_REMOVE_ENTITY_EFFECT(State.PLAY, Direction.OUTGOING, 0x1E, 0x31), // Mapped
- PLAY_RESOURCE_PACK_SEND(State.PLAY, Direction.OUTGOING, 0x48, 0x32), // Mapped
- PLAY_RESPAWN(State.PLAY, Direction.OUTGOING, 0x07, 0x33), // Mapped
- PLAY_ENTITY_HEAD_LOOK(State.PLAY, Direction.OUTGOING, 0x19, 0x34), // Mapped
- PLAY_WORLD_BORDER(State.PLAY, Direction.OUTGOING, 0x44, 0x35), // Mapped
- PLAY_CAMERA(State.PLAY, Direction.OUTGOING, 0x43, 0x36), // Mapped
- PLAY_HELD_ITEM_CHANGE(State.PLAY, Direction.OUTGOING, 0x09, 0x37), // Mapped
- PLAY_DISPLAY_SCOREBOARD(State.PLAY, Direction.OUTGOING, 0x3D, 0x38), // Mapped
- PLAY_ENTITY_METADATA(State.PLAY, Direction.OUTGOING, 0x1C, 0x39), // Mapped
- PLAY_ATTACH_ENTITY(State.PLAY, Direction.OUTGOING, 0x1B, 0x3A), // Mapped
- PLAY_ENTITY_VELOCITY(State.PLAY, Direction.OUTGOING, 0x12, 0x3B), // Mapped
- PLAY_ENTITY_EQUIPMENT(State.PLAY, Direction.OUTGOING, 0x04, 0x3C), // Mapped
- PLAY_SET_XP(State.PLAY, Direction.OUTGOING, 0x1F, 0x3D), // Mapped
- PLAY_UPDATE_HEALTH(State.PLAY, Direction.OUTGOING, 0x06, 0x3E), // Mapped
- PLAY_SCOREBOARD_OBJ(State.PLAY, Direction.OUTGOING, 0x3B, 0x3F), // Mapped
- PLAY_SET_PASSENGERS(State.PLAY, Direction.OUTGOING, -1, 0x40),
- PLAY_TEAM(State.PLAY, Direction.OUTGOING, 0x3E, 0x41), // Mapped
- PLAY_UPDATE_SCORE(State.PLAY, Direction.OUTGOING, 0x3C, 0x42), // Mapped
- PLAY_SPAWN_POSITION(State.PLAY, Direction.OUTGOING, 0x05, 0x43), // Mapped
- PLAY_TIME_UPDATE(State.PLAY, Direction.OUTGOING, 0x03, 0x44), // Mapped
- PLAY_TITLE(State.PLAY, Direction.OUTGOING, 0x45, 0x45), // Mapped
- PLAY_UPDATE_SIGN(State.PLAY, Direction.OUTGOING, 0x33, 0x46), // Mapped
- PLAY_SOUND_EFFECT(State.PLAY, Direction.OUTGOING, -1, 0x47),
- PLAY_PLAYER_LIST_HEADER_FOOTER(State.PLAY, Direction.OUTGOING, 0x47, 0x48), // Mapped
- PLAY_COLLECT_ITEM(State.PLAY, Direction.OUTGOING, 0x0D, 0x49), // Mapped
- PLAY_ENTITY_TELEPORT(State.PLAY, Direction.OUTGOING, 0x18, 0x4A), // Mapped
- PLAY_ENTITY_PROPERTIES(State.PLAY, Direction.OUTGOING, 0x20, 0x4B), // Mapped
- PLAY_ENTITY_EFFECT(State.PLAY, Direction.OUTGOING, 0x1D, 0x4C), // Mapped
-
- PLAY_MAP_CHUNK_BULK(State.PLAY, Direction.OUTGOING, 0x26, -1),
- PLAY_SET_COMPRESSION(State.PLAY, Direction.OUTGOING, 0x46, -1),
- PLAY_UPDATE_ENTITY_NBT(State.PLAY, Direction.OUTGOING, 0x49, -1);
-
- private static HashMap oldids = new HashMap<>();
- private static HashMap newids = new HashMap<>();
-
- static {
- for (PacketType pt : PacketType.values()) {
- oldids.put(toShort((short) pt.getPacketID(), (short) pt.getDirection().ordinal(), (short) pt.getState().ordinal()), pt);
- newids.put(toShort((short) pt.getNewPacketID(), (short) pt.getDirection().ordinal(), (short) pt.getState().ordinal()), pt);
- }
- }
-
- private State state;
- private Direction direction;
- private int packetID;
- private int newPacketID = -1;
-
- PacketType(State state, Direction direction, int packetID) {
- this.state = state;
- this.direction = direction;
- this.packetID = packetID;
- this.newPacketID = packetID;
- }
-
- PacketType(State state, Direction direction, int packetID, int newPacketID) {
- this.state = state;
- this.direction = direction;
- this.packetID = packetID;
- this.newPacketID = newPacketID;
- }
-
- public static PacketType findNewPacket(State state, Direction direction, int id) {
- return newids.get(toShort((short) id, (short) direction.ordinal(), (short) state.ordinal()));
- }
-
- public static PacketType findOldPacket(State state, Direction direction, int id) {
- return oldids.get(toShort((short) id, (short) direction.ordinal(), (short) state.ordinal()));
- }
-
- public static PacketType getIncomingPacket(State state, int id) {
- return findNewPacket(state, Direction.INCOMING, id);
- }
-
- public static PacketType getOutgoingPacket(State state, int id) {
- return findOldPacket(state, Direction.OUTGOING, id);
- }
-
- private static short toShort(short id, short direction, short state) {
- return (short) ((id & 0x00FF) | (direction << 8) & 0x0F00 | (state << 12) & 0xF000);
- }
-
- public State getState() {
- return state;
- }
-
- public Direction getDirection() {
- return direction;
- }
-
- public int getPacketID() {
- return packetID;
- }
-
- public int getNewPacketID() {
- return newPacketID;
- }
-
-}
+package us.myles.ViaVersion.packets;
+
+import java.util.HashMap;
+
+@Deprecated
+public enum PacketType {
+ /* Handshake serverbound */
+ HANDSHAKE(State.HANDSHAKE, Direction.INCOMING, 0x00), // Mapped
+ /* Login serverbound */
+ LOGIN_START(State.LOGIN, Direction.INCOMING, 0x00), // Mapped
+ LOGIN_ENCRYPTION_RESPONSE(State.LOGIN, Direction.INCOMING, 0x01), // Mapped
+ /* Login clientbound */
+ LOGIN_DISCONNECT(State.LOGIN, Direction.OUTGOING, 0x00), // Mapped
+ LOGIN_ENCRYPTION_REQUEST(State.LOGIN, Direction.OUTGOING, 0x01), // Mapped
+ LOGIN_SUCCESS(State.LOGIN, Direction.OUTGOING, 0x02), // Mapped
+ LOGIN_SETCOMPRESSION(State.LOGIN, Direction.OUTGOING, 0x03), // Mapped
+
+ /* Status serverbound */
+ STATUS_REQUEST(State.STATUS, Direction.INCOMING, 0x00), // Mapped
+ STATUS_PING(State.STATUS, Direction.INCOMING, 0x01), // Mapped
+ /* Status clientbound */
+ STATUS_RESPONSE(State.STATUS, Direction.OUTGOING, 0x00),
+ STATUS_PONG(State.STATUS, Direction.OUTGOING, 0x01),
+ /* Play serverbound */
+ PLAY_TP_CONFIRM(State.PLAY, Direction.INCOMING, -1, 0x00), // Mapped
+ PLAY_TAB_COMPLETE_REQUEST(State.PLAY, Direction.INCOMING, 0x14, 0x01), // Mapped
+ PLAY_CHAT_MESSAGE_CLIENT(State.PLAY, Direction.INCOMING, 0x01, 0x02), // Mapped
+ PLAY_CLIENT_STATUS(State.PLAY, Direction.INCOMING, 0x16, 0x03), // Mapped
+ PLAY_CLIENT_SETTINGS(State.PLAY, Direction.INCOMING, 0x15, 0x04), // Mapped
+ PLAY_CONFIRM_TRANS(State.PLAY, Direction.INCOMING, 0x0F, 0x05), // Mapped
+ PLAY_ENCHANT_ITEM(State.PLAY, Direction.INCOMING, 0x11, 0x06), // Mapped
+ PLAY_CLICK_WINDOW(State.PLAY, Direction.INCOMING, 0x0E, 0x07), // Mapped
+ PLAY_CLOSE_WINDOW_REQUEST(State.PLAY, Direction.INCOMING, 0x0D, 0x08), // Mapped
+ PLAY_PLUGIN_MESSAGE_REQUEST(State.PLAY, Direction.INCOMING, 0x17, 0x09),
+ PLAY_USE_ENTITY(State.PLAY, Direction.INCOMING, 0x02, 0x0A), // Mapped
+ PLAY_KEEP_ALIVE_REQUEST(State.PLAY, Direction.INCOMING, 0x00, 0x0B), // Mapped
+ PLAY_PLAYER_POSITION_REQUEST(State.PLAY, Direction.INCOMING, 0x04, 0x0C), // Mapped
+ PLAY_PLAYER_POSITION_LOOK_REQUEST(State.PLAY, Direction.INCOMING, 0x06, 0x0D), // Mapped
+ PLAY_PLAYER_LOOK_REQUEST(State.PLAY, Direction.INCOMING, 0x05, 0x0E), // Mapped
+ PLAY_PLAYER(State.PLAY, Direction.INCOMING, 0x03, 0x0F), // Mapped
+ PLAY_VEHICLE_MOVE_REQUEST(State.PLAY, Direction.INCOMING, -1, 0x10), // Mapped
+ PLAY_STEER_BOAT(State.PLAY, Direction.INCOMING, -1, 0x11), // Mapped
+ PLAY_PLAYER_ABILITIES_REQUEST(State.PLAY, Direction.INCOMING, 0x13, 0x12), // Mapped
+ PLAY_PLAYER_DIGGING(State.PLAY, Direction.INCOMING, 0x07, 0x13), // Mapped
+ PLAY_ENTITY_ACTION(State.PLAY, Direction.INCOMING, 0x0B, 0x14), // Mapped
+ PLAY_STEER_VEHICLE(State.PLAY, Direction.INCOMING, 0x0C, 0x15), // Mapped
+
+ PLAY_RESOURCE_PACK_STATUS(State.PLAY, Direction.INCOMING, 0x19, 0x16), // Mapped
+ PLAY_HELD_ITEM_CHANGE_REQUEST(State.PLAY, Direction.INCOMING, 0x09, 0x17), // Mapped
+
+ PLAY_CREATIVE_INVENTORY_ACTION(State.PLAY, Direction.INCOMING, 0x10, 0x18), // Mapped
+ PLAY_UPDATE_SIGN_REQUEST(State.PLAY, Direction.INCOMING, 0x12, 0x19), // Mapped
+ PLAY_ANIMATION_REQUEST(State.PLAY, Direction.INCOMING, 0x0A, 0x1A), // Mapped
+ PLAY_SPECTATE(State.PLAY, Direction.INCOMING, 0x18, 0x1B), // Mapped
+ PLAY_PLAYER_BLOCK_PLACEMENT(State.PLAY, Direction.INCOMING, 0x08, 0x1C), // Mapped
+ PLAY_USE_ITEM(State.PLAY, Direction.INCOMING, -1, 0x1D), // Mapped
+ /* Play clientbound */
+ PLAY_SPAWN_OBJECT(State.PLAY, Direction.OUTGOING, 0x0E, 0x00), // Mapped
+ PLAY_SPAWN_XP_ORB(State.PLAY, Direction.OUTGOING, 0x11, 0x01), // Mapped
+ PLAY_SPAWN_GLOBAL_ENTITY(State.PLAY, Direction.OUTGOING, 0x2C, 0x02), // Mapped
+ PLAY_SPAWN_MOB(State.PLAY, Direction.OUTGOING, 0x0F, 0x03), // Mapped
+ PLAY_SPAWN_PAINTING(State.PLAY, Direction.OUTGOING, 0x10, 0x04), // Mapped
+ PLAY_SPAWN_PLAYER(State.PLAY, Direction.OUTGOING, 0x0C, 0x05), // Mapped
+
+ PLAY_ANIMATION(State.PLAY, Direction.OUTGOING, 0x0B, 0x06), // Mapped
+ PLAY_STATS(State.PLAY, Direction.OUTGOING, 0x37, 0x07), // Mapped
+
+ PLAY_BLOCK_BREAK_ANIMATION(State.PLAY, Direction.OUTGOING, 0x25, 0x08), // Mapped
+ PLAY_UPDATE_BLOCK_ENTITY(State.PLAY, Direction.OUTGOING, 0x35, 0x09), // Mapped
+ PLAY_BLOCK_ACTION(State.PLAY, Direction.OUTGOING, 0x24, 0x0A), // Mapped
+ PLAY_BLOCK_CHANGE(State.PLAY, Direction.OUTGOING, 0x23, 0x0B), // Mapped
+
+ PLAY_BOSS_BAR(State.PLAY, Direction.OUTGOING, -1, 0x0C),
+ PLAY_SERVER_DIFFICULTY(State.PLAY, Direction.OUTGOING, 0x41, 0x0D), // Mapped
+ PLAY_TAB_COMPLETE(State.PLAY, Direction.OUTGOING, 0x3A, 0x0E), // Mapped
+ PLAY_CHAT_MESSAGE(State.PLAY, Direction.OUTGOING, 0x02, 0x0F), // Mapped
+ PLAY_MULTI_BLOCK_CHANGE(State.PLAY, Direction.OUTGOING, 0x22, 0x10), // Mapped
+ PLAY_CONFIRM_TRANSACTION(State.PLAY, Direction.OUTGOING, 0x32, 0x11), // Mapped
+ PLAY_CLOSE_WINDOW(State.PLAY, Direction.OUTGOING, 0x2E, 0x12), // Mapped
+ PLAY_OPEN_WINDOW(State.PLAY, Direction.OUTGOING, 0x2D, 0x13), // Mapped
+ PLAY_WINDOW_ITEMS(State.PLAY, Direction.OUTGOING, 0x30, 0x14), // Mapped
+ PLAY_WINDOW_PROPERTY(State.PLAY, Direction.OUTGOING, 0x31, 0x15), // Mapped
+ PLAY_SET_SLOT(State.PLAY, Direction.OUTGOING, 0x2F, 0x16), // Mapped
+ PLAY_SET_COOLDOWN(State.PLAY, Direction.OUTGOING, -1, 0x17),
+ PLAY_PLUGIN_MESSAGE(State.PLAY, Direction.OUTGOING, 0x3F, 0x18), // Mapped
+ PLAY_NAMED_SOUND_EFFECT(State.PLAY, Direction.OUTGOING, 0x29, 0x19), // Mapped
+ PLAY_DISCONNECT(State.PLAY, Direction.OUTGOING, 0x40, 0x1A), // Mapped
+ PLAY_ENTITY_STATUS(State.PLAY, Direction.OUTGOING, 0x1A, 0x1B), // Mapped
+ PLAY_EXPLOSION(State.PLAY, Direction.OUTGOING, 0x27, 0x1C), // Mapped
+ PLAY_UNLOAD_CHUNK(State.PLAY, Direction.OUTGOING, -1, 0x1D),
+ PLAY_CHANGE_GAME_STATE(State.PLAY, Direction.OUTGOING, 0x2B, 0x1E),
+ PLAY_KEEP_ALIVE(State.PLAY, Direction.OUTGOING, 0x00, 0x1F), // Mapped
+ PLAY_CHUNK_DATA(State.PLAY, Direction.OUTGOING, 0x21, 0x20), // Mapped
+ PLAY_EFFECT(State.PLAY, Direction.OUTGOING, 0x28, 0x21), // Mapped
+ PLAY_PARTICLE(State.PLAY, Direction.OUTGOING, 0x2A, 0x22), // Mapped
+ PLAY_JOIN_GAME(State.PLAY, Direction.OUTGOING, 0x01, 0x23), // Mapped
+ PLAY_MAP(State.PLAY, Direction.OUTGOING, 0x34, 0x24), // Mapped
+ PLAY_ENTITY_RELATIVE_MOVE(State.PLAY, Direction.OUTGOING, 0x15, 0x25), // Mapped
+ PLAY_ENTITY_LOOK_MOVE(State.PLAY, Direction.OUTGOING, 0x17, 0x26), // Mapped
+ PLAY_ENTITY_LOOK(State.PLAY, Direction.OUTGOING, 0x16, 0x27), // Mapped
+ PLAY_ENTITY(State.PLAY, Direction.OUTGOING, 0x14, 0x28), // Mapped
+ PLAY_VEHICLE_MOVE(State.PLAY, Direction.OUTGOING, -1, 0x29),
+ PLAY_OPEN_SIGN_EDITOR(State.PLAY, Direction.OUTGOING, 0x36, 0x2A), // Mapped
+ PLAY_PLAYER_ABILITIES(State.PLAY, Direction.OUTGOING, 0x39, 0x2B), // Mapped
+ PLAY_COMBAT_EVENT(State.PLAY, Direction.OUTGOING, 0x42, 0x2C), // Mapped
+ PLAY_PLAYER_LIST_ITEM(State.PLAY, Direction.OUTGOING, 0x38, 0x2D), // Mapped
+ PLAY_PLAYER_POSITION_LOOK(State.PLAY, Direction.OUTGOING, 0x08, 0x2E), // Mapped
+ PLAY_USE_BED(State.PLAY, Direction.OUTGOING, 0x0A, 0x2F), // Mapped
+ PLAY_DESTROY_ENTITIES(State.PLAY, Direction.OUTGOING, 0x13, 0x30), // Mapped
+ PLAY_REMOVE_ENTITY_EFFECT(State.PLAY, Direction.OUTGOING, 0x1E, 0x31), // Mapped
+ PLAY_RESOURCE_PACK_SEND(State.PLAY, Direction.OUTGOING, 0x48, 0x32), // Mapped
+ PLAY_RESPAWN(State.PLAY, Direction.OUTGOING, 0x07, 0x33), // Mapped
+ PLAY_ENTITY_HEAD_LOOK(State.PLAY, Direction.OUTGOING, 0x19, 0x34), // Mapped
+ PLAY_WORLD_BORDER(State.PLAY, Direction.OUTGOING, 0x44, 0x35), // Mapped
+ PLAY_CAMERA(State.PLAY, Direction.OUTGOING, 0x43, 0x36), // Mapped
+ PLAY_HELD_ITEM_CHANGE(State.PLAY, Direction.OUTGOING, 0x09, 0x37), // Mapped
+ PLAY_DISPLAY_SCOREBOARD(State.PLAY, Direction.OUTGOING, 0x3D, 0x38), // Mapped
+ PLAY_ENTITY_METADATA(State.PLAY, Direction.OUTGOING, 0x1C, 0x39), // Mapped
+ PLAY_ATTACH_ENTITY(State.PLAY, Direction.OUTGOING, 0x1B, 0x3A), // Mapped
+ PLAY_ENTITY_VELOCITY(State.PLAY, Direction.OUTGOING, 0x12, 0x3B), // Mapped
+ PLAY_ENTITY_EQUIPMENT(State.PLAY, Direction.OUTGOING, 0x04, 0x3C), // Mapped
+ PLAY_SET_XP(State.PLAY, Direction.OUTGOING, 0x1F, 0x3D), // Mapped
+ PLAY_UPDATE_HEALTH(State.PLAY, Direction.OUTGOING, 0x06, 0x3E), // Mapped
+ PLAY_SCOREBOARD_OBJ(State.PLAY, Direction.OUTGOING, 0x3B, 0x3F), // Mapped
+ PLAY_SET_PASSENGERS(State.PLAY, Direction.OUTGOING, -1, 0x40),
+ PLAY_TEAM(State.PLAY, Direction.OUTGOING, 0x3E, 0x41), // Mapped
+ PLAY_UPDATE_SCORE(State.PLAY, Direction.OUTGOING, 0x3C, 0x42), // Mapped
+ PLAY_SPAWN_POSITION(State.PLAY, Direction.OUTGOING, 0x05, 0x43), // Mapped
+ PLAY_TIME_UPDATE(State.PLAY, Direction.OUTGOING, 0x03, 0x44), // Mapped
+ PLAY_TITLE(State.PLAY, Direction.OUTGOING, 0x45, 0x45), // Mapped
+ PLAY_UPDATE_SIGN(State.PLAY, Direction.OUTGOING, 0x33, 0x46), // Mapped
+ PLAY_SOUND_EFFECT(State.PLAY, Direction.OUTGOING, -1, 0x47),
+ PLAY_PLAYER_LIST_HEADER_FOOTER(State.PLAY, Direction.OUTGOING, 0x47, 0x48), // Mapped
+ PLAY_COLLECT_ITEM(State.PLAY, Direction.OUTGOING, 0x0D, 0x49), // Mapped
+ PLAY_ENTITY_TELEPORT(State.PLAY, Direction.OUTGOING, 0x18, 0x4A), // Mapped
+ PLAY_ENTITY_PROPERTIES(State.PLAY, Direction.OUTGOING, 0x20, 0x4B), // Mapped
+ PLAY_ENTITY_EFFECT(State.PLAY, Direction.OUTGOING, 0x1D, 0x4C), // Mapped
+
+ PLAY_MAP_CHUNK_BULK(State.PLAY, Direction.OUTGOING, 0x26, -1),
+ PLAY_SET_COMPRESSION(State.PLAY, Direction.OUTGOING, 0x46, -1),
+ PLAY_UPDATE_ENTITY_NBT(State.PLAY, Direction.OUTGOING, 0x49, -1);
+
+ private static HashMap oldids = new HashMap<>();
+ private static HashMap newids = new HashMap<>();
+
+ static {
+ for (PacketType pt : PacketType.values()) {
+ oldids.put(toShort((short) pt.getPacketID(), (short) pt.getDirection().ordinal(), (short) pt.getState().ordinal()), pt);
+ newids.put(toShort((short) pt.getNewPacketID(), (short) pt.getDirection().ordinal(), (short) pt.getState().ordinal()), pt);
+ }
+ }
+
+ private State state;
+ private Direction direction;
+ private int packetID;
+ private int newPacketID = -1;
+
+ PacketType(State state, Direction direction, int packetID) {
+ this.state = state;
+ this.direction = direction;
+ this.packetID = packetID;
+ this.newPacketID = packetID;
+ }
+
+ PacketType(State state, Direction direction, int packetID, int newPacketID) {
+ this.state = state;
+ this.direction = direction;
+ this.packetID = packetID;
+ this.newPacketID = newPacketID;
+ }
+
+ public static PacketType findNewPacket(State state, Direction direction, int id) {
+ return newids.get(toShort((short) id, (short) direction.ordinal(), (short) state.ordinal()));
+ }
+
+ public static PacketType findOldPacket(State state, Direction direction, int id) {
+ return oldids.get(toShort((short) id, (short) direction.ordinal(), (short) state.ordinal()));
+ }
+
+ public static PacketType getIncomingPacket(State state, int id) {
+ return findNewPacket(state, Direction.INCOMING, id);
+ }
+
+ public static PacketType getOutgoingPacket(State state, int id) {
+ return findOldPacket(state, Direction.OUTGOING, id);
+ }
+
+ private static short toShort(short id, short direction, short state) {
+ return (short) ((id & 0x00FF) | (direction << 8) & 0x0F00 | (state << 12) & 0xF000);
+ }
+
+ public State getState() {
+ return state;
+ }
+
+ public Direction getDirection() {
+ return direction;
+ }
+
+ public int getPacketID() {
+ return packetID;
+ }
+
+ public int getNewPacketID() {
+ return newPacketID;
+ }
+
+}
diff --git a/src/main/java/us/myles/ViaVersion/packets/State.java b/common/src/main/java/us/myles/ViaVersion/packets/State.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/packets/State.java
rename to common/src/main/java/us/myles/ViaVersion/packets/State.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java b/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java
similarity index 99%
rename from src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java
index 8de79782d..599376e81 100644
--- a/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/base/BaseProtocol.java
@@ -3,9 +3,9 @@ package us.myles.ViaVersion.protocols.base;
import io.netty.channel.ChannelFuture;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
-import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
diff --git a/src/main/java/us/myles/ViaVersion/protocols/base/ProtocolInfo.java b/common/src/main/java/us/myles/ViaVersion/protocols/base/ProtocolInfo.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/base/ProtocolInfo.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/base/ProtocolInfo.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/Protocol1_10To1_9_3_4.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/Protocol1_10To1_9_3_4.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/Protocol1_10To1_9_3_4.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/Protocol1_10To1_9_3_4.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/storage/ResourcePackTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/storage/ResourcePackTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/storage/ResourcePackTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_10to1_9_3/storage/ResourcePackTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/Protocol1_9_1_2TO1_9_3_4.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/Protocol1_9_1_2TO1_9_3_4.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/Protocol1_9_1_2TO1_9_3_4.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/Protocol1_9_1_2TO1_9_3_4.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/BlockEntity.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/BlockEntity.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/BlockEntity.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/BlockEntity.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/Chunk1_9_3_4.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/Chunk1_9_3_4.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/Chunk1_9_3_4.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/Chunk1_9_3_4.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/ChunkSection1_9_3_4.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/ChunkSection1_9_3_4.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/ChunkSection1_9_3_4.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/ChunkSection1_9_3_4.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1to1_9/Protocol1_9_1TO1_9.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1to1_9/Protocol1_9_1TO1_9.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1to1_9/Protocol1_9_1TO1_9.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1to1_9/Protocol1_9_1TO1_9.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/Protocol1_9_3TO1_9_1_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/Protocol1_9_3TO1_9_1_2.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/Protocol1_9_3TO1_9_1_2.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/Protocol1_9_3TO1_9_1_2.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/Chunk1_9_1_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/Chunk1_9_1_2.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/Chunk1_9_1_2.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/Chunk1_9_1_2.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/ChunkSection1_9_1_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/ChunkSection1_9_1_2.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/ChunkSection1_9_1_2.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/ChunkSection1_9_1_2.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/FakeTileEntity.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/FakeTileEntity.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/FakeTileEntity.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/FakeTileEntity.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/storage/ClientWorld.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/storage/ClientWorld.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/storage/ClientWorld.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/storage/ClientWorld.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/types/Chunk1_9_1_2Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/types/Chunk1_9_1_2Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/types/Chunk1_9_1_2Type.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/types/Chunk1_9_1_2Type.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java
index f05f5bd0b..b9446c5fb 100644
--- a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ArmorType.java
@@ -1,90 +1,90 @@
-package us.myles.ViaVersion.protocols.protocol1_9to1_8;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import org.bukkit.Material;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.HashMap;
-
-@RequiredArgsConstructor
-@Getter
-public enum ArmorType {
-
- LEATHER_HELMET(1, 298, Material.LEATHER_HELMET),
- LEATHER_CHESTPLATE(3, 299, Material.LEATHER_CHESTPLATE),
- LEATHER_LEGGINGS(2, 300, Material.LEATHER_LEGGINGS),
- LEATHER_BOOTS(1, 301, Material.LEATHER_BOOTS),
- CHAINMAIL_HELMET(2, 302, Material.CHAINMAIL_HELMET),
- CHAINMAIL_CHESTPLATE(5, 303, Material.CHAINMAIL_CHESTPLATE),
- CHAINMAIL_LEGGINGS(4, 304, Material.CHAINMAIL_LEGGINGS),
- CHAINMAIL_BOOTS(1, 305, Material.CHAINMAIL_BOOTS),
- IRON_HELMET(2, 306, Material.IRON_HELMET),
- IRON_CHESTPLATE(6, 307, Material.IRON_CHESTPLATE),
- IRON_LEGGINGS(5, 308, Material.IRON_LEGGINGS),
- IRON_BOOTS(2, 309, Material.IRON_BOOTS),
- DIAMOND_HELMET(3, 310, Material.DIAMOND_HELMET),
- DIAMOND_CHESTPLATE(8, 311, Material.DIAMOND_CHESTPLATE),
- DIAMOND_LEGGINGS(6, 312, Material.DIAMOND_LEGGINGS),
- DIAMOND_BOOTS(3, 313, Material.DIAMOND_BOOTS),
- GOLD_HELMET(2, 314, Material.GOLD_HELMET),
- GOLD_CHESTPLATE(5, 315, Material.GOLD_CHESTPLATE),
- GOLD_LEGGINGS(3, 316, Material.GOLD_LEGGINGS),
- GOLD_BOOTS(1, 317, Material.GOLD_BOOTS),
- NONE(0, 0, Material.AIR);
-
- private static HashMap armor;
-
- static {
- armor = new HashMap();
- for (ArmorType a : ArmorType.values()) {
- armor.put(a.getType(), a);
- }
- }
-
- private final int armorPoints;
- private final int id;
- private final Material type;
-
- public static ArmorType findByType(Material type) {
- ArmorType t = armor.get(type);
- return t == null ? ArmorType.NONE : t;
- }
-
- public static int calculateArmorPoints(ItemStack[] armor) {
- int total = 0;
- for (ItemStack anArmor : armor) {
- if (anArmor != null)
- total += findByType(anArmor.getType()).getArmorPoints();
- }
- return total;
- }
-
- public static ArmorType findById(int id) {
- for (ArmorType a : ArmorType.values())
- if (a.getId() == id)
- return a;
- return ArmorType.NONE;
- }
-
- public static boolean isArmor(Material material) {
- for (ArmorType a : ArmorType.values())
- if (a.getType() == material)
- return true;
- return false;
- }
-
- public static int calculateArmorPoints(int[] armor) {
- int total = 0;
- for (int anArmor : armor) {
- if (anArmor != -1)
- total += findById(anArmor).getArmorPoints();
- }
- return total;
- }
-
- public Material getType() {
- return this.type;
- }
-
+package us.myles.ViaVersion.protocols.protocol1_9to1_8;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+
+import java.util.HashMap;
+
+@RequiredArgsConstructor
+@Getter
+public enum ArmorType {
+
+ LEATHER_HELMET(1, 298, Material.LEATHER_HELMET),
+ LEATHER_CHESTPLATE(3, 299, Material.LEATHER_CHESTPLATE),
+ LEATHER_LEGGINGS(2, 300, Material.LEATHER_LEGGINGS),
+ LEATHER_BOOTS(1, 301, Material.LEATHER_BOOTS),
+ CHAINMAIL_HELMET(2, 302, Material.CHAINMAIL_HELMET),
+ CHAINMAIL_CHESTPLATE(5, 303, Material.CHAINMAIL_CHESTPLATE),
+ CHAINMAIL_LEGGINGS(4, 304, Material.CHAINMAIL_LEGGINGS),
+ CHAINMAIL_BOOTS(1, 305, Material.CHAINMAIL_BOOTS),
+ IRON_HELMET(2, 306, Material.IRON_HELMET),
+ IRON_CHESTPLATE(6, 307, Material.IRON_CHESTPLATE),
+ IRON_LEGGINGS(5, 308, Material.IRON_LEGGINGS),
+ IRON_BOOTS(2, 309, Material.IRON_BOOTS),
+ DIAMOND_HELMET(3, 310, Material.DIAMOND_HELMET),
+ DIAMOND_CHESTPLATE(8, 311, Material.DIAMOND_CHESTPLATE),
+ DIAMOND_LEGGINGS(6, 312, Material.DIAMOND_LEGGINGS),
+ DIAMOND_BOOTS(3, 313, Material.DIAMOND_BOOTS),
+ GOLD_HELMET(2, 314, Material.GOLD_HELMET),
+ GOLD_CHESTPLATE(5, 315, Material.GOLD_CHESTPLATE),
+ GOLD_LEGGINGS(3, 316, Material.GOLD_LEGGINGS),
+ GOLD_BOOTS(1, 317, Material.GOLD_BOOTS),
+ NONE(0, 0, Material.AIR);
+
+ private static HashMap armor;
+
+ static {
+ armor = new HashMap();
+ for (ArmorType a : ArmorType.values()) {
+ armor.put(a.getType(), a);
+ }
+ }
+
+ private final int armorPoints;
+ private final int id;
+ private final Material type;
+
+ public static ArmorType findByType(Material type) {
+ ArmorType t = armor.get(type);
+ return t == null ? ArmorType.NONE : t;
+ }
+
+ public static int calculateArmorPoints(ItemStack[] armor) {
+ int total = 0;
+ for (ItemStack anArmor : armor) {
+ if (anArmor != null)
+ total += findByType(anArmor.getType()).getArmorPoints();
+ }
+ return total;
+ }
+
+ public static ArmorType findById(int id) {
+ for (ArmorType a : ArmorType.values())
+ if (a.getId() == id)
+ return a;
+ return ArmorType.NONE;
+ }
+
+ public static boolean isArmor(Material material) {
+ for (ArmorType a : ArmorType.values())
+ if (a.getType() == material)
+ return true;
+ return false;
+ }
+
+ public static int calculateArmorPoints(int[] armor) {
+ int total = 0;
+ for (int anArmor : armor) {
+ if (anArmor != -1)
+ total += findById(anArmor).getArmorPoints();
+ }
+ return total;
+ }
+
+ public Material getType() {
+ return this.type;
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ItemRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ItemRewriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ItemRewriter.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ItemRewriter.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/PlayerMovementMapper.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/PlayerMovementMapper.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/PlayerMovementMapper.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/PlayerMovementMapper.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/Protocol1_9TO1_8.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/Protocol1_9TO1_8.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/Protocol1_9TO1_8.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/Protocol1_9TO1_8.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ViaIdleThread.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ViaIdleThread.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ViaIdleThread.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/ViaIdleThread.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/ChatRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/ChatRewriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/ChatRewriter.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/ChatRewriter.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/GameMode.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/GameMode.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/GameMode.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chat/GameMode.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/Chunk1_9to1_8.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/Chunk1_9to1_8.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/Chunk1_9to1_8.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/Chunk1_9to1_8.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/ChunkSection1_9to1_8.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/ChunkSection1_9to1_8.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/ChunkSection1_9to1_8.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/ChunkSection1_9to1_8.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/ArmorListener.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/ArmorListener.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/ArmorListener.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/ArmorListener.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/BlockListener.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/BlockListener.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/BlockListener.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/BlockListener.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/CommandBlockListener.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/CommandBlockListener.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/CommandBlockListener.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/CommandBlockListener.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/DeathListener.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/DeathListener.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/DeathListener.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/DeathListener.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/HandItemCache.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/HandItemCache.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/HandItemCache.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/HandItemCache.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/PaperPatch.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/PaperPatch.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/PaperPatch.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/listeners/PaperPatch.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetaIndex.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetaIndex.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetaIndex.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetaIndex.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataRewriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataRewriter.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataRewriter.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataTypes.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataTypes.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataTypes.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/MetadataTypes.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/NewType.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/NewType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/NewType.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/NewType.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/Type.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/Type.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/metadata/Type.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/EntityPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/EntityPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/EntityPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/InventoryPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/InventoryPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/InventoryPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/SpawnPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/SpawnPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/SpawnPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/SpawnPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/Effect.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/Effect.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/Effect.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/Effect.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundCategory.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundCategory.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundCategory.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundCategory.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/ClientChunks.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/ClientChunks.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/ClientChunks.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/ClientChunks.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/EntityTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/InventoryTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/InventoryTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/InventoryTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/InventoryTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/MovementTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/MovementTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/MovementTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/MovementTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/PlaceBlockTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/PlaceBlockTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/PlaceBlockTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/storage/PlaceBlockTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/types/ChunkType.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/types/ChunkType.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/types/ChunkType.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/types/ChunkType.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_9_1/Protocol1_9TO1_9_1.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_9_1/Protocol1_9TO1_9_1.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_9_1/Protocol1_9TO1_9_1.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_9_1/Protocol1_9TO1_9_1.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ItemRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ItemRewriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ItemRewriter.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ItemRewriter.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/MetadataRewriter.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/packets/InventoryPackets.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/packets/InventoryPackets.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/packets/InventoryPackets.java
diff --git a/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/storage/EntityTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/storage/EntityTracker.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/storage/EntityTracker.java
rename to common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/storage/EntityTracker.java
diff --git a/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
similarity index 68%
rename from src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
rename to common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
index fa06fe35f..03d2fc917 100644
--- a/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
+++ b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
@@ -1,129 +1,123 @@
-package us.myles.ViaVersion.update;
-
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.scheduler.BukkitRunnable;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.json.simple.parser.ParseException;
-import us.myles.ViaVersion.api.ViaVersion;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.UUID;
-
-public class UpdateUtil {
-
- public final static String PREFIX = ChatColor.GREEN + "" + ChatColor.BOLD + "[ViaVersion] " + ChatColor.GREEN;
- private final static String URL = "http://api.spiget.org/v2/resources/";
- private final static int PLUGIN = 19254;
- private final static String LATEST_VERSION = "/versions/latest";
-
- public static void sendUpdateMessage(final UUID uuid, final Plugin plugin) {
- new BukkitRunnable() {
-
- @Override
- public void run() {
- final String message = getUpdateMessage(false);
- if (message != null) {
- new BukkitRunnable() {
-
- @Override
- public void run() {
- Player p = Bukkit.getPlayer(uuid);
- if (p != null) {
- p.sendMessage(PREFIX + message);
- }
- }
- }.runTask(plugin);
- }
- }
- }.runTaskAsynchronously(plugin);
- }
-
- public static void sendUpdateMessage(final Plugin plugin) {
- new BukkitRunnable() {
-
- @Override
- public void run() {
- final String message = getUpdateMessage(true);
- if (message != null) {
- new BukkitRunnable() {
-
- @Override
- public void run() {
- plugin.getLogger().warning(message);
- }
- }.runTask(plugin);
- }
- }
- }.runTaskAsynchronously(plugin);
- }
-
- private static String getUpdateMessage(boolean console) {
- if (ViaVersion.getInstance().getVersion().equals("${project.version}")) {
- return "You are using a debug/custom version, consider updating.";
- }
- String newestString = getNewestVersion();
- if (newestString == null) {
- if (console) {
- return "Could not check for updates, check your connection.";
- } else {
- return null;
- }
- }
- Version current;
- try {
- current = new Version(ViaVersion.getInstance().getVersion());
- } catch (IllegalArgumentException e) {
- return "You are using a custom version, consider updating.";
- }
- Version newest = new Version(newestString);
- if (current.compareTo(newest) < 0)
- return "There is a newer version available: " + newest.toString() + ", you're on: " + current.toString();
- else if (console && current.compareTo(newest) != 0) {
- if (current.getTag().toLowerCase().startsWith("dev") || current.getTag().toLowerCase().startsWith("snapshot")) {
- return "You are running a development version, please report any bugs to GitHub.";
- } else {
- return "You are running a newer version than is released!";
- }
- }
- return null;
- }
-
- private static String getNewestVersion() {
- try {
- URL url = new URL(URL + PLUGIN + LATEST_VERSION + "?" + System.currentTimeMillis());
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setUseCaches(true);
- connection.addRequestProperty("User-Agent", "ViaVersion " + ViaVersion.getInstance().getVersion());
- connection.setDoOutput(true);
- BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String input;
- String content = "";
- while ((input = br.readLine()) != null) {
- content = content + input;
- }
- br.close();
- JSONParser parser = new JSONParser();
- JSONObject statistics;
- try {
- statistics = (JSONObject) parser.parse(content);
- } catch (ParseException e) {
- e.printStackTrace();
- return null;
- }
- return (String) statistics.get("name");
- } catch (MalformedURLException e) {
- return null;
- } catch (IOException e) {
- return null;
- }
- }
-}
+package us.myles.ViaVersion.update;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import net.md_5.bungee.api.ChatColor;
+import us.myles.ViaVersion.api.ViaVersion;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.UUID;
+
+public class UpdateUtil {
+
+ public final static String PREFIX = ChatColor.GREEN + "" + ChatColor.BOLD + "[ViaVersion] " + ChatColor.GREEN;
+ private final static String URL = "http://api.spiget.org/v2/resources/";
+ private final static int PLUGIN = 19254;
+ private final static String LATEST_VERSION = "/versions/latest";
+ private final static Gson gson = new GsonBuilder().create();
+
+ public static void sendUpdateMessage(final UUID uuid) {
+ ViaVersion.getPlatform().runAsync(new Runnable() {
+ @Override
+ public void run() {
+ final String message = getUpdateMessage(false);
+ if (message != null) {
+ ViaVersion.getPlatform().runSync(
+ new Runnable() {
+ @Override
+ public void run() {
+ ViaVersion.getPlatform().sendMessage(uuid, PREFIX + message);
+ }
+ }
+ );
+ }
+ }
+ });
+ }
+
+ public static void sendUpdateMessage() {
+ ViaVersion.getPlatform().runAsync(new Runnable() {
+ @Override
+ public void run() {
+ final String message = getUpdateMessage(true);
+ if (message != null) {
+ ViaVersion.getPlatform().runSync(
+ new Runnable() {
+ @Override
+ public void run() {
+ ViaVersion.getPlatform().getLogger().warning(message);
+ }
+ }
+ );
+ }
+ }
+ });
+ }
+
+ private static String getUpdateMessage(boolean console) {
+ if (ViaVersion.getInstance().getVersion().equals("${project.version}")) {
+ return "You are using a debug/custom version, consider updating.";
+ }
+ String newestString = getNewestVersion();
+ if (newestString == null) {
+ if (console) {
+ return "Could not check for updates, check your connection.";
+ } else {
+ return null;
+ }
+ }
+ Version current;
+ try {
+ current = new Version(ViaVersion.getInstance().getVersion());
+ } catch (IllegalArgumentException e) {
+ return "You are using a custom version, consider updating.";
+ }
+ Version newest = new Version(newestString);
+ if (current.compareTo(newest) < 0)
+ return "There is a newer version available: " + newest.toString() + ", you're on: " + current.toString();
+ else if (console && current.compareTo(newest) != 0) {
+ if (current.getTag().toLowerCase().startsWith("dev") || current.getTag().toLowerCase().startsWith("snapshot")) {
+ return "You are running a development version, please report any bugs to GitHub.";
+ } else {
+ return "You are running a newer version than is released!";
+ }
+ }
+ return null;
+ }
+
+ private static String getNewestVersion() {
+ try {
+ URL url = new URL(URL + PLUGIN + LATEST_VERSION + "?" + System.currentTimeMillis());
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setUseCaches(true);
+ connection.addRequestProperty("User-Agent", "ViaVersion " + ViaVersion.getInstance().getVersion());
+ connection.setDoOutput(true);
+ BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+ String input;
+ String content = "";
+ while ((input = br.readLine()) != null) {
+ content = content + input;
+ }
+ br.close();
+ JsonObject statistics;
+ try {
+ statistics = gson.fromJson(content, JsonObject.class);
+ } catch (JsonParseException e) {
+ e.printStackTrace();
+ return null;
+ }
+ return statistics.get("name").getAsString();
+ } catch (MalformedURLException e) {
+ return null;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/us/myles/ViaVersion/update/Version.java b/common/src/main/java/us/myles/ViaVersion/update/Version.java
similarity index 96%
rename from src/main/java/us/myles/ViaVersion/update/Version.java
rename to common/src/main/java/us/myles/ViaVersion/update/Version.java
index d96f4800a..f31784495 100644
--- a/src/main/java/us/myles/ViaVersion/update/Version.java
+++ b/common/src/main/java/us/myles/ViaVersion/update/Version.java
@@ -1,77 +1,77 @@
-package us.myles.ViaVersion.update;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class Version implements Comparable {
- private static Pattern semVer = Pattern.compile("(?0|[1-9]\\d*)\\.(?0|[1-9]\\d*)(?:\\.(?0|[1-9]\\d*))?(?:-(?[A-z0-9.-]*))?");
- private int[] parts = new int[3];
- private String tag;
-
- public Version(String value) {
- if (value == null)
- throw new IllegalArgumentException("Version can not be null");
-
- Matcher matcher = semVer.matcher(value);
- if (!matcher.matches())
- throw new IllegalArgumentException("Invalid version format");
- parts[0] = Integer.parseInt(matcher.group("a"));
- parts[1] = Integer.parseInt(matcher.group("b"));
- parts[2] = matcher.group("c") == null ? 0 : Integer.parseInt(matcher.group("c"));
-
- tag = matcher.group("tag") == null ? "" : matcher.group("tag");
- }
-
- public static int compare(Version verA, Version verB) {
- if (verA == verB) return 0;
- if (verA == null) return -1;
- if (verB == null) return 1;
-
- int max = Math.max(verA.parts.length, verB.parts.length);
-
- for (int i = 0; i < max; i += 1) {
- int partA = i < verA.parts.length ? verA.parts[i] : 0;
- int partB = i < verB.parts.length ? verB.parts[i] : 0;
- if (partA < partB) return -1;
- if (partA > partB) return 1;
- }
-
- // Simple tag check
- if (verA.tag.length() == 0 && verB.tag.length() > 0)
- return 1;
- if (verA.tag.length() > 0 && verB.tag.length() == 0)
- return -1;
-
- return 0;
- }
-
- public static boolean equals(Version verA, Version verB) {
- return verA == verB || verA != null && verB != null && compare(verA, verB) == 0;
- }
-
- @Override
- public String toString() {
- String[] split = new String[parts.length];
-
- for (int i = 0; i < parts.length; i += 1)
- split[i] = String.valueOf(parts[i]);
-
- return StringUtils.join(split, ".") + (tag.length() != 0 ? "-" + tag : "");
- }
-
- @Override
- public int compareTo(Version that) {
- return compare(this, that);
- }
-
- @Override
- public boolean equals(Object that) {
- return that instanceof Version && equals(this, (Version) that);
- }
-
- public String getTag() {
- return tag;
- }
+package us.myles.ViaVersion.update;
+
+import org.apache.commons.lang.StringUtils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Version implements Comparable {
+ private static Pattern semVer = Pattern.compile("(?0|[1-9]\\d*)\\.(?0|[1-9]\\d*)(?:\\.(?0|[1-9]\\d*))?(?:-(?[A-z0-9.-]*))?");
+ private int[] parts = new int[3];
+ private String tag;
+
+ public Version(String value) {
+ if (value == null)
+ throw new IllegalArgumentException("Version can not be null");
+
+ Matcher matcher = semVer.matcher(value);
+ if (!matcher.matches())
+ throw new IllegalArgumentException("Invalid version format");
+ parts[0] = Integer.parseInt(matcher.group("a"));
+ parts[1] = Integer.parseInt(matcher.group("b"));
+ parts[2] = matcher.group("c") == null ? 0 : Integer.parseInt(matcher.group("c"));
+
+ tag = matcher.group("tag") == null ? "" : matcher.group("tag");
+ }
+
+ public static int compare(Version verA, Version verB) {
+ if (verA == verB) return 0;
+ if (verA == null) return -1;
+ if (verB == null) return 1;
+
+ int max = Math.max(verA.parts.length, verB.parts.length);
+
+ for (int i = 0; i < max; i += 1) {
+ int partA = i < verA.parts.length ? verA.parts[i] : 0;
+ int partB = i < verB.parts.length ? verB.parts[i] : 0;
+ if (partA < partB) return -1;
+ if (partA > partB) return 1;
+ }
+
+ // Simple tag check
+ if (verA.tag.length() == 0 && verB.tag.length() > 0)
+ return 1;
+ if (verA.tag.length() > 0 && verB.tag.length() == 0)
+ return -1;
+
+ return 0;
+ }
+
+ public static boolean equals(Version verA, Version verB) {
+ return verA == verB || verA != null && verB != null && compare(verA, verB) == 0;
+ }
+
+ @Override
+ public String toString() {
+ String[] split = new String[parts.length];
+
+ for (int i = 0; i < parts.length; i += 1)
+ split[i] = String.valueOf(parts[i]);
+
+ return StringUtils.join(split, ".") + (tag.length() != 0 ? "-" + tag : "");
+ }
+
+ @Override
+ public int compareTo(Version that) {
+ return compare(this, that);
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ return that instanceof Version && equals(this, (Version) that);
+ }
+
+ public String getTag() {
+ return tag;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/us/myles/ViaVersion/util/ConcurrentList.java b/common/src/main/java/us/myles/ViaVersion/util/ConcurrentList.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/ConcurrentList.java
rename to common/src/main/java/us/myles/ViaVersion/util/ConcurrentList.java
diff --git a/src/main/java/us/myles/ViaVersion/util/EntityUtil.java b/common/src/main/java/us/myles/ViaVersion/util/EntityUtil.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/EntityUtil.java
rename to common/src/main/java/us/myles/ViaVersion/util/EntityUtil.java
diff --git a/src/main/java/us/myles/ViaVersion/util/ListWrapper.java b/common/src/main/java/us/myles/ViaVersion/util/ListWrapper.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/ListWrapper.java
rename to common/src/main/java/us/myles/ViaVersion/util/ListWrapper.java
diff --git a/src/main/java/us/myles/ViaVersion/util/PipelineUtil.java b/common/src/main/java/us/myles/ViaVersion/util/PipelineUtil.java
similarity index 100%
rename from src/main/java/us/myles/ViaVersion/util/PipelineUtil.java
rename to common/src/main/java/us/myles/ViaVersion/util/PipelineUtil.java
diff --git a/jar/pom.xml b/jar/pom.xml
new file mode 100644
index 000000000..00754e50d
--- /dev/null
+++ b/jar/pom.xml
@@ -0,0 +1,104 @@
+
+
+
+ viaversion-parent
+ us.myles
+ 1.0.0-ALPHA-16w38a
+
+ 4.0.0
+
+ viaversion
+
+
+ ${project.name}-${project.version}
+ src/main/java
+ clean install
+
+
+ .
+ false
+ .
+
+ LICENSE
+
+
+
+ .
+ true
+ src/main/resources/
+
+ *
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.5.1
+
+
+ ${jdkVersion}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.4.3
+
+ false
+ false
+
+
+ org.spacehq.opennbt
+ us.myles.viaversion.libs.opennbt
+
+
+ com.google.gson
+ us.myles.viaversion.libs.gson
+
+
+ org.javassist
+ us.myles.viaversion.libs.javassist
+
+
+
+
+
+ package
+
+ shade
+
+
+
+
+
+
+
+
+
+ us.myles
+ viaversion-common
+ 1.0.0-ALPHA-16w38a
+
+
+ us.myles
+ viaversion-bukkit
+ 1.0.0-ALPHA-16w38a
+
+
+ us.myles
+ viaversion-bungee
+ 1.0.0-ALPHA-16w38a
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 952f6f711..07b79c27e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,15 +5,22 @@
4.0.0us.myles
- viaversion
+ viaversion-parent1.0.0-ALPHA-16w38a
- jar
+ pomViaVersionAllow newer clients to join older server versions.2016https://www.spigotmc.org/resources/viaversion.19254/
+
+ common
+ bukkit
+ bungee
+ jar
+
+
3.3.3
@@ -24,106 +31,8 @@
${projectEncoding}${projectEncoding}1.7
-
-
-
- 1.8.8-R0.1-SNAPSHOT
-
- ${project.name}-${project.version}
- src/main/java
- clean install
-
-
-
-
- .
- false
- .
-
- LICENSE
-
-
-
- .
- true
- src/main/resources/
-
- *
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.5.1
-
-
- ${jdkVersion}
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 2.4.3
-
- false
- false
-
-
- org.spacehq.opennbt
- us.myles.viaversion.libs.opennbt
-
-
- com.google.gson
- us.myles.viaversion.libs.gson
-
-
- org.javassist
- us.myles.viaversion.libs.javassist
-
-
-
-
-
- package
-
- shade
-
-
-
-
-
-
-
@@ -145,27 +54,12 @@
-
+
- org.bukkit
- bukkit
- ${bukkitVersion}
+ org.projectlombok
+ lombok
+ 1.16.6provided
- true
-
-
- junit
- junit
-
-
- gson
- com.google.code.gson
-
-
- persistence-api
- javax.persistence
-
-
@@ -204,20 +98,20 @@
true
-
+
- org.projectlombok
- lombok
- 1.16.6
+ commons-lang
+ commons-lang
+ 2.6provided
-
+
net.md-5
- bungeecord-api
- 1.9-SNAPSHOT
- provided
+ bungeecord-chat
+ 1.10-SNAPSHOT
+