-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
PlayerList, CustomPacket support for paper.
1 parent
cca369c
commit f80d573
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/vulpeus/kyoyu/plugin/PlayerListListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.vulpeus.kyoyu.plugin; | ||
|
||
//? if PAPER { | ||
/* | ||
import com.vulpeus.kyoyu.CompatibleUtils; | ||
import com.vulpeus.kyoyu.Kyoyu; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerJoinEvent; | ||
import org.bukkit.event.player.PlayerQuitEvent; | ||
public class PlayerListListener implements Listener { | ||
@EventHandler | ||
public void onPlayerJoin(PlayerJoinEvent event) { | ||
Player player = event.getPlayer(); | ||
Kyoyu.PLAYERS.add(player.identity().uuid(), player.getName(), new CompatibleUtils.KyoyuPlayer(player)); | ||
} | ||
@EventHandler | ||
public void onPlayerLeave(PlayerQuitEvent event) { | ||
Player player = event.getPlayer(); | ||
Kyoyu.PLAYERS.remove(player.identity().uuid()); | ||
} | ||
} | ||
*/ | ||
//?} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/vulpeus/kyoyu/plugin/PluginPacketListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.vulpeus.kyoyu.plugin; | ||
|
||
//? if PAPER { | ||
/* | ||
import com.vulpeus.kyoyu.CompatibleUtils; | ||
import com.vulpeus.kyoyu.Kyoyu; | ||
import com.vulpeus.kyoyu.net.KyoyuPacketPayload; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.plugin.messaging.PluginMessageListener; | ||
import org.jetbrains.annotations.NotNull; | ||
public class PluginPacketListener implements PluginMessageListener { | ||
@Override | ||
public void onPluginMessageReceived(String channel, @NotNull Player player, byte[] payload) { | ||
if (!channel.equals("kyoyu:kyoyu")) return; | ||
KyoyuPacketPayload kyoyuPacketPayload = new KyoyuPacketPayload(payload); | ||
kyoyuPacketPayload.onPacketServer(new CompatibleUtils.KyoyuPlayer(player)); | ||
} | ||
} | ||
*/ | ||
//?} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters