9
0
mirror of https://github.com/HibiscusMC/HibiscusCommons.git synced 2025-12-19 15:09:26 +00:00

feat: latest packet wrappers

This commit is contained in:
LoJoSho
2025-06-28 15:23:41 -05:00
parent 491f46f4b3
commit 9ced7fd85e
5 changed files with 45 additions and 12 deletions

View File

@@ -32,12 +32,12 @@ public interface PacketInterface {
// Override
}
default PacketAction readPlayerArm(@NotNull Player player) {
default PacketAction readPlayerArm(@NotNull Player player, @NotNull PlayerSwingWrapper wrapper) {
return PacketAction.NOTHING;
// Override
}
default PacketAction readEntityHandle(@NotNull Player player) {
default PacketAction readEntityHandle(@NotNull Player player, @NotNull PlayerInteractWrapper wrapper) {
return PacketAction.NOTHING;
// Override
}

View File

@@ -1,14 +1,14 @@
package me.lojosho.hibiscuscommons.packets.wrapper;
import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
@Getter @Setter
public class PlayerActionWrapper {
private String actionType;
@Getter
private final String actionType;
public PlayerActionWrapper(String actionType) {
public PlayerActionWrapper(@NotNull String actionType) {
this.actionType = actionType;
}
}

View File

@@ -0,0 +1,13 @@
package me.lojosho.hibiscuscommons.packets.wrapper;
import lombok.Getter;
public class PlayerInteractWrapper {
@Getter
private final int entityId;
public PlayerInteractWrapper(int entityId) {
this.entityId = entityId;
}
}

View File

@@ -0,0 +1,15 @@
package me.lojosho.hibiscuscommons.packets.wrapper;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
public class PlayerSwingWrapper {
@Getter
private final String hand;
public PlayerSwingWrapper(@NotNull String hand) {
this.hand = hand;
}
}