From ef118a3a642180bcdf658547c685bdb61086f345 Mon Sep 17 00:00:00 2001 From: fillefilip8 Date: Thu, 3 Mar 2016 14:28:26 +0100 Subject: [PATCH] * One JavaDoc to the api XD * Added faster way to change version number. --- pom.xml | 8 +++- .../us/myles/ViaVersion/ViaVersionPlugin.java | 4 +- .../myles/ViaVersion/api/ViaVersionAPI.java | 6 ++- .../listeners/InteractListener.java | 15 ------- .../ViaVersion/listeners/VehicleListener.java | 39 ------------------- src/main/resources/plugin.yml | 2 +- 6 files changed, 14 insertions(+), 60 deletions(-) delete mode 100644 src/main/java/us/myles/ViaVersion/listeners/InteractListener.java delete mode 100644 src/main/java/us/myles/ViaVersion/listeners/VehicleListener.java diff --git a/pom.xml b/pom.xml index 7ab46f1b7..28e6acfee 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ us.myles ViaVersion - 1.0-SNAPSHOT + 0.4.6 @@ -18,6 +18,12 @@ + + + src/main/resources + true + + diff --git a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java index f9e2b5fb0..2dfe7bcfc 100644 --- a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java +++ b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java @@ -16,7 +16,6 @@ import org.bukkit.plugin.java.JavaPlugin; import us.myles.ViaVersion.api.ViaVersion; import us.myles.ViaVersion.api.ViaVersionAPI; import us.myles.ViaVersion.handlers.ViaVersionInitializer; -import us.myles.ViaVersion.listeners.VehicleListener; import us.myles.ViaVersion.util.ReflectionUtil; import java.util.Collections; @@ -39,7 +38,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { return; } - getLogger().info("ViaVersion enabled, injecting. (Allows 1.8 to be accessed via 1.9)"); + getLogger().info("ViaVersion " + getDescription().getVersion() + " is now enabled, injecting. (Allows 1.8 to be accessed via 1.9)"); try { injectPacketHandler(); System.setProperty("ViaVersion", getDescription().getVersion()); @@ -53,7 +52,6 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { setPorted(e.getPlayer().getUniqueId(), false); } }, this); - Bukkit.getPluginManager().registerEvents(new VehicleListener(),this); } public void injectPacketHandler() throws Exception { diff --git a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java b/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java index cdccc80ce..2d053b69f 100644 --- a/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java +++ b/src/main/java/us/myles/ViaVersion/api/ViaVersionAPI.java @@ -3,6 +3,10 @@ package us.myles.ViaVersion.api; import org.bukkit.entity.Player; public interface ViaVersionAPI { - + /** + * Is player using 1.9? + * @param player + * @return + */ boolean isPorted(Player player); } diff --git a/src/main/java/us/myles/ViaVersion/listeners/InteractListener.java b/src/main/java/us/myles/ViaVersion/listeners/InteractListener.java deleted file mode 100644 index ad8a6686e..000000000 --- a/src/main/java/us/myles/ViaVersion/listeners/InteractListener.java +++ /dev/null @@ -1,15 +0,0 @@ -package us.myles.ViaVersion.listeners; - -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerInteractEvent; - -/** - * Created by fillefilip8 on 2016-03-03. - */ -public class InteractListener implements Listener { - @EventHandler - public void onSwordBlock(PlayerInteractEvent e){ - - } -} diff --git a/src/main/java/us/myles/ViaVersion/listeners/VehicleListener.java b/src/main/java/us/myles/ViaVersion/listeners/VehicleListener.java deleted file mode 100644 index 537dde557..000000000 --- a/src/main/java/us/myles/ViaVersion/listeners/VehicleListener.java +++ /dev/null @@ -1,39 +0,0 @@ -package us.myles.ViaVersion.listeners; - -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.entity.Boat; -import org.bukkit.entity.Minecart; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerToggleSneakEvent; -import org.bukkit.event.vehicle.VehicleEnterEvent; -import org.bukkit.event.vehicle.VehicleExitEvent; -import us.myles.ViaVersion.api.ViaVersion; - -/** - * Created by fillefilip8 on 2016-03-02. - */ -public class VehicleListener implements Listener { - @EventHandler - public void onVehicleEnter(VehicleEnterEvent e){ - if(e.getEntered() instanceof Player) { - Player player = (Player) e.getEntered(); - if(ViaVersion.getInstance().isPorted(player)){ - - if(e.getVehicle() instanceof Minecart){ - e.getEntered().sendMessage(ChatColor.RED + "Minecarts are not supported. Due to changes on minecarts in 1.9"); - e.setCancelled(true); - }else if(e.getVehicle() instanceof Boat){ - e.getEntered().sendMessage(ChatColor.RED + "Boats are not supported. Due to changes on boats in 1.9"); - e.setCancelled(true); - } - - - } - } - - } - -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3f3eaa8a2..012f63e08 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ViaVersion main: us.myles.ViaVersion.ViaVersionPlugin author: _MylesC -version: 0.4.6 +version: ${version} load: startup loadbefore: [ProtocolLib, ProxyPipe] \ No newline at end of file