forked from BLOCKFANTASY/LOOHP-Limbo
Added ResourcePack related packets, along with sending and recieving them, and added PlayerResourcePackStatusEvent to simplify reading the incoming packets for plugins.
This commit is contained in:
@@ -18,6 +18,7 @@ import com.loohp.limbo.server.packets.PacketPlayOutChat;
|
||||
import com.loohp.limbo.server.packets.PacketPlayOutGameState;
|
||||
import com.loohp.limbo.server.packets.PacketPlayOutHeldItemChange;
|
||||
import com.loohp.limbo.server.packets.PacketPlayOutPositionAndLook;
|
||||
import com.loohp.limbo.server.packets.PacketPlayOutResourcePackSend;
|
||||
import com.loohp.limbo.server.packets.PacketPlayOutRespawn;
|
||||
import com.loohp.limbo.utils.GameMode;
|
||||
|
||||
@@ -259,5 +260,17 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setResourcePack(String url, String hash, boolean forced, BaseComponent[] promptmessage) {
|
||||
try {
|
||||
PacketPlayOutResourcePackSend packsend = new PacketPlayOutResourcePackSend(url, hash, forced,
|
||||
(promptmessage != null || !ComponentSerializer.toString(promptmessage).equalsIgnoreCase("")) ? true : false,
|
||||
ComponentSerializer.toString(promptmessage));
|
||||
clientConnection.sendPacket(packsend);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user