Fix compatibility issues
This commit is contained in:
parent
4a22c916b1
commit
de5ecfcb93
10
pom.xml
10
pom.xml
@ -95,6 +95,7 @@
|
|||||||
<include>com.sun.mail:javax.mail</include>
|
<include>com.sun.mail:javax.mail</include>
|
||||||
<include>com.comphenix.attribute:AttributeStorage</include>
|
<include>com.comphenix.attribute:AttributeStorage</include>
|
||||||
<include>org.mcstats.bukkit:metrics</include>
|
<include>org.mcstats.bukkit:metrics</include>
|
||||||
|
<include>com.google.code.gson:gson</include>
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
<relocations>
|
<relocations>
|
||||||
@ -241,6 +242,15 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- GSON required for 1.7.X compatibility -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Maxmind GeoIp API -->
|
<!-- Maxmind GeoIp API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import org.bukkit.scheduler.BukkitTask;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
||||||
import org.mcstats.Metrics;
|
import org.mcstats.Metrics;
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
@ -474,7 +473,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (Settings.protectInventoryBeforeLogInEnabled) {
|
if (Settings.protectInventoryBeforeLogInEnabled) {
|
||||||
if (server.getPluginManager().isPluginEnabled("ProtocolLib")) {
|
if (server.getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||||
inventoryProtector = new AuthMeInventoryListener(this);
|
inventoryProtector = new AuthMeInventoryListener(this);
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(inventoryProtector);
|
inventoryProtector.register();
|
||||||
} else {
|
} else {
|
||||||
ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it...");
|
ConsoleLogger.showError("WARNING!!! The protectInventory feature requires ProtocolLib! Disabling it...");
|
||||||
Settings.protectInventoryBeforeLogInEnabled = false;
|
Settings.protectInventoryBeforeLogInEnabled = false;
|
||||||
|
|||||||
@ -60,6 +60,10 @@ public class AuthMeInventoryListener extends PacketAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
public void sendInventoryPacket(Player player) {
|
public void sendInventoryPacket(Player player) {
|
||||||
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
PacketContainer inventoryPacket = protocolManager.createPacket(PacketType.Play.Server.WINDOW_ITEMS);
|
PacketContainer inventoryPacket = protocolManager.createPacket(PacketType.Play.Server.WINDOW_ITEMS);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user