Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
* One JavaDoc to the api XD
* Added faster way to change version number.
Dieser Commit ist enthalten in:
Ursprung
bb42cda4a8
Commit
ef118a3a64
8
pom.xml
8
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>us.myles</groupId>
|
||||
<artifactId>ViaVersion</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>0.4.6</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@ -18,6 +18,12 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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){
|
||||
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
name: ViaVersion
|
||||
main: us.myles.ViaVersion.ViaVersionPlugin
|
||||
author: _MylesC
|
||||
version: 0.4.6
|
||||
version: ${version}
|
||||
load: startup
|
||||
loadbefore: [ProtocolLib, ProxyPipe]
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren