Skip to content

Commit

Permalink
Packetevents - change names
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Oct 7, 2024
1 parent 3b6316e commit 49bb89f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* <p>To listen to this event you will first need to execute {@link PlayerPacketListener#registerListener(Plugin)}</p>
*/
@SuppressWarnings("unused")
public class PacketOutboundEvent extends PacketEvent {
public class PacketClientboundEvent extends PacketEvent {

private static final HandlerList HANDLERS = new HandlerList();

Expand All @@ -23,7 +23,7 @@ public class PacketOutboundEvent extends PacketEvent {
* @param player player
* @hidden no
*/
public PacketOutboundEvent(Packet<?> packet, Player player) {
public PacketClientboundEvent(Packet<?> packet, Player player) {
super(packet, player);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* <p>To listen to this event you will first need to execute {@link PlayerPacketListener#registerListener(Plugin)}</p>
*/
@SuppressWarnings("unused")
public class PacketInboundEvent extends PacketEvent {
public class PacketServerboundEvent extends PacketEvent {

private static final HandlerList HANDLERS = new HandlerList();

Expand All @@ -22,7 +22,7 @@ public class PacketInboundEvent extends PacketEvent {
* @param packet p
* @param player p
*/
public PacketInboundEvent(Packet<?> packet, Player player) {
public PacketServerboundEvent(Packet<?> packet, Player player) {
super(packet, player);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.shanebeestudios.coreapi.listener;

import com.shanebeestudios.coreapi.event.PacketEvent;
import com.shanebeestudios.coreapi.event.PacketInboundEvent;
import com.shanebeestudios.coreapi.event.PacketOutboundEvent;
import com.shanebeestudios.coreapi.event.PacketServerboundEvent;
import com.shanebeestudios.coreapi.event.PacketClientboundEvent;
import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
Expand Down Expand Up @@ -48,7 +48,7 @@ private void onPlayerJoin(PlayerJoinEvent event) {
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
if (msg instanceof Packet<?> packet) {
PacketEvent packetEvent = new PacketOutboundEvent(packet, bukkitPlayer);
PacketEvent packetEvent = new PacketClientboundEvent(packet, bukkitPlayer);
packetEvent.callEvent();
if (packetEvent.isCancelled()) return;
}
Expand All @@ -58,7 +58,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
@Override
public void channelRead(@NotNull ChannelHandlerContext ctx, @NotNull Object msg) throws Exception {
if (msg instanceof Packet<?> packet) {
PacketEvent packetEvent = new PacketInboundEvent(packet, bukkitPlayer);
PacketEvent packetEvent = new PacketServerboundEvent(packet, bukkitPlayer);
packetEvent.callEvent();
if (packetEvent.isCancelled()) return;
}
Expand Down

0 comments on commit 49bb89f

Please sign in to comment.