mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
feat: latest changes and wrappers
This commit is contained in:
@@ -1,36 +1,33 @@
|
||||
package me.lojosho.hibiscuscommons.packets;
|
||||
|
||||
import me.lojosho.hibiscuscommons.packets.wrapper.ContainerContentWrapper;
|
||||
import me.lojosho.hibiscuscommons.packets.wrapper.EntityEquipmentWrapper;
|
||||
import me.lojosho.hibiscuscommons.packets.wrapper.PassengerWrapper;
|
||||
import me.lojosho.hibiscuscommons.packets.wrapper.SlotContentWrapper;
|
||||
import me.lojosho.hibiscuscommons.packets.wrapper.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface PacketInterface {
|
||||
|
||||
default PacketAction writeContainerContent(@NotNull Player player, ContainerContentWrapper wrapper) {
|
||||
default PacketAction writeContainerContent(@NotNull Player player, @NotNull ContainerContentWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
}
|
||||
|
||||
default PacketAction writeSlotContent(@NotNull Player player, SlotContentWrapper wrapper) {
|
||||
default PacketAction writeSlotContent(@NotNull Player player, @NotNull SlotContentWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
}
|
||||
|
||||
default PacketAction writeEquipmentContent(@NotNull Player player, EntityEquipmentWrapper wrapper) {
|
||||
default PacketAction writeEquipmentContent(@NotNull Player player, @NotNull EntityEquipmentWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
}
|
||||
|
||||
default PacketAction writePassengerContent(@NotNull Player player, PassengerWrapper wrapper) {
|
||||
default PacketAction writePassengerContent(@NotNull Player player, @NotNull PassengerWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
}
|
||||
|
||||
default PacketAction readInventoryClick(@NotNull Player player, Integer clickType, Integer slotNumber) {
|
||||
default PacketAction readInventoryClick(@NotNull Player player, @NotNull InventoryClickWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
// Override
|
||||
}
|
||||
|
||||
default PacketAction readPlayerAction(@NotNull Player player, Integer actionType) {
|
||||
default PacketAction readPlayerAction(@NotNull Player player, @NotNull PlayerActionWrapper wrapper) {
|
||||
return PacketAction.NOTHING;
|
||||
// Override
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ import java.util.Map;
|
||||
@Getter @Setter
|
||||
public class EntityEquipmentWrapper {
|
||||
|
||||
private int entityId;
|
||||
private Map<EquipmentSlot, ItemStack> armor;
|
||||
|
||||
public EntityEquipmentWrapper(@NotNull Map<EquipmentSlot, ItemStack> armor) {
|
||||
public EntityEquipmentWrapper(int entityId, @NotNull Map<EquipmentSlot, ItemStack> armor) {
|
||||
this.entityId = entityId;
|
||||
this.armor = armor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package me.lojosho.hibiscuscommons.packets.wrapper;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Getter @Setter
|
||||
public class InventoryClickWrapper {
|
||||
|
||||
private int clickType;
|
||||
private int slotNumber;
|
||||
|
||||
public InventoryClickWrapper(@NotNull Integer clickType, @NotNull Integer slotNumber) {
|
||||
this.clickType = clickType;
|
||||
this.slotNumber = slotNumber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package me.lojosho.hibiscuscommons.packets.wrapper;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter @Setter
|
||||
public class PlayerActionWrapper {
|
||||
|
||||
private String actionType;
|
||||
|
||||
public PlayerActionWrapper(String actionType) {
|
||||
this.actionType = actionType;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user