added 1.10 support

This commit is contained in:
Alastair Hawkes 2016-06-09 09:48:06 +01:00
parent 06794ac4a7
commit 4f0b06b32c
3 changed files with 28 additions and 9 deletions

View File

@ -1,8 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="Advanced-Portals:jar">
<output-path>$USER_HOME$/Desktop/Sekwah41 plugin test/plugins</output-path>
<root id="archive" name="AdvancedPortals.jar">
<element id="module-output" name="Advanced-Portals" />
</root>
</artifact>
</component>

View File

@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.19
version: 0.0.20
author: sekwah41
description: An advanced portals plugin for bukkit.
commands:

View File

@ -0,0 +1,27 @@
package com.sekwah.advancedportals.compat.bukkit;
import net.minecraft.server.v1_10_R1.IChatBaseComponent;
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class v1_10_R1 implements NMS {
@Override
public void sendRawMessage(String rawMessage, Player player) {
IChatBaseComponent comp = IChatBaseComponent.ChatSerializer.a(rawMessage);
// "json message", position(0: chat (chat box), 1: system message (chat box), 2: above action bar)
PacketPlayOutChat packet = new PacketPlayOutChat(comp, (byte) 1);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
@Override
public void sendActionBarMessage(String rawMessage, Player player) {
IChatBaseComponent comp = IChatBaseComponent.ChatSerializer.a(rawMessage);
// "json message", position(0: chat (chat box), 1: system message (chat box), 2: above action bar)
PacketPlayOutChat packet = new PacketPlayOutChat(comp, (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}