Class OperationProbe

java.lang.Object
com.trevlar.slotkit.api.window.OperationProbe

public final class OperationProbe extends Object
Lets a test mod check the click-tag hand-off and the in-world actions: which operation a sent click carried, and whether an action would be refused. SlotKit's validator uses it. A shipping mod tags its clicks with SlotOperations.as(BehaviorKey, Runnable) and never records or claims a tag itself.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A click tag as the probe sees it: the operation pair it carries.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable OperationProbe.Tag
    claimAction(UUID player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action)
     
    static @Nullable OperationProbe.Tag
    claimClick(UUID player, int containerId, int slotId, int button, net.minecraft.world.inventory.ContainerInput input)
    What the server does as that click arrives: the tag, once, or null.
    static void
    recordAction(UUID player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action, OperationProbe.Tag tag)
    The same for an in-world action (Q, Ctrl-Q, F with no screen open).
    static void
    recordClick(UUID player, int containerId, int slotId, int button, net.minecraft.world.inventory.ContainerInput input, OperationProbe.Tag tag)
    What the client does as it sends a tagged click to the integrated server.
    static boolean
    refusesAction(net.minecraft.world.entity.player.Player player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action)
    Whether player doing action would be refused, as both the client and server seams judge it.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • recordClick

      public static void recordClick(UUID player, int containerId, int slotId, int button, net.minecraft.world.inventory.ContainerInput input, OperationProbe.Tag tag)
      What the client does as it sends a tagged click to the integrated server.
    • claimClick

      public static @Nullable OperationProbe.Tag claimClick(UUID player, int containerId, int slotId, int button, net.minecraft.world.inventory.ContainerInput input)
      What the server does as that click arrives: the tag, once, or null.
    • recordAction

      public static void recordAction(UUID player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action, OperationProbe.Tag tag)
      The same for an in-world action (Q, Ctrl-Q, F with no screen open).
    • claimAction

      public static @Nullable OperationProbe.Tag claimAction(UUID player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action)
    • refusesAction

      public static boolean refusesAction(net.minecraft.world.entity.player.Player player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action)
      Whether player doing action would be refused, as both the client and server seams judge it.