mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-01-13 19:51:22 +01:00
Added support for 1_8_R1
This commit is contained in:
parent
1bf886e909
commit
bbcd423987
@ -1,6 +1,6 @@
|
|||||||
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
||||||
name: AdvancedPortals
|
name: AdvancedPortals
|
||||||
version: 0.0.24
|
version: 0.0.25
|
||||||
author: sekwah41
|
author: sekwah41
|
||||||
description: An advanced portals plugin for bukkit.
|
description: An advanced portals plugin for bukkit.
|
||||||
commands:
|
commands:
|
||||||
|
2
pom.xml
2
pom.xml
@ -16,7 +16,7 @@
|
|||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<version>0.0.24-snapshot</version>
|
<version>0.0.25-snapshot</version>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
<maven.compiler.source>1.7</maven.compiler.source>
|
||||||
|
@ -61,7 +61,9 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
|||||||
|
|
||||||
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
this.getLogger().warning("This version of craftbukkit is not yet supported, please notify sekwah and tell him about this version v:" + version);
|
this.getLogger().warning("This version of craftbukkit is not yet supported, please notify sekwah and tell him about this version v:" + version);
|
||||||
|
this.getLogger().warning("Along with the above stacktrace");
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
} catch (IllegalArgumentException |
|
} catch (IllegalArgumentException |
|
||||||
NoSuchFieldException | SecurityException | NoSuchMethodException e) {
|
NoSuchFieldException | SecurityException | NoSuchMethodException e) {
|
||||||
|
@ -39,7 +39,17 @@ public class CraftBukkit {
|
|||||||
String minecraftPackage = "net.minecraft.server." + bukkitImpl + ".";
|
String minecraftPackage = "net.minecraft.server." + bukkitImpl + ".";
|
||||||
|
|
||||||
Class<?> chatBaseComponent = Class.forName(minecraftPackage + "IChatBaseComponent"); // string to packet methods
|
Class<?> chatBaseComponent = Class.forName(minecraftPackage + "IChatBaseComponent"); // string to packet methods
|
||||||
this.serializeMessage = this.findClass(chatBaseComponent, "ChatSerializer").getMethod("a", String.class);
|
Class<?> chatSerialClass = this.findClass(chatBaseComponent, "ChatSerializer");
|
||||||
|
|
||||||
|
if(chatSerialClass == null){
|
||||||
|
plugin.getLogger().info("Old version detected, changing chat method");
|
||||||
|
this.serializeMessage = chatBaseComponent.getMethod("a", String.class);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
plugin.getLogger().info("Old version detected, changing chat method");
|
||||||
|
this.serializeMessage = chatBaseComponent.getMethod("a", String.class);
|
||||||
|
}
|
||||||
|
|
||||||
this.chatPacketConstructor = Class.forName(minecraftPackage + "PacketPlayOutChat").getConstructor(chatBaseComponent, byte.class);
|
this.chatPacketConstructor = Class.forName(minecraftPackage + "PacketPlayOutChat").getConstructor(chatBaseComponent, byte.class);
|
||||||
|
|
||||||
this.playerGetHandle = Class.forName(craftBukkitPackage + "entity.CraftPlayer").getMethod("getHandle");
|
this.playerGetHandle = Class.forName(craftBukkitPackage + "entity.CraftPlayer").getMethod("getHandle");
|
||||||
@ -47,6 +57,8 @@ public class CraftBukkit {
|
|||||||
Class<?> packet = Class.forName(minecraftPackage + "Packet");
|
Class<?> packet = Class.forName(minecraftPackage + "Packet");
|
||||||
this.sendPacket = playerConnection.getType().getMethod("sendPacket", packet);
|
this.sendPacket = playerConnection.getType().getMethod("sendPacket", packet);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
plugin.getLogger().warning("Attempting to use backup porekit locations");
|
||||||
// Fall back on your Porekit
|
// Fall back on your Porekit
|
||||||
Class<?> textBaseComponent = Class.forName("net.minecraft.util.text.ITextComponent"); // string to packet methods
|
Class<?> textBaseComponent = Class.forName("net.minecraft.util.text.ITextComponent"); // string to packet methods
|
||||||
this.serializeMessage = this.findClass(textBaseComponent, "Serializer").getMethod("func_150699_a", String.class); // md: jsonToComponent
|
this.serializeMessage = this.findClass(textBaseComponent, "Serializer").getMethod("func_150699_a", String.class); // md: jsonToComponent
|
||||||
|
Loading…
Reference in New Issue
Block a user