Class OperationProbe
java.lang.Object
com.trevlar.slotkit.api.window.OperationProbe
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 ClassesModifier and TypeClassDescriptionstatic final recordA click tag as the probe sees it: the operation pair it carries. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable OperationProbe.TagclaimAction(UUID player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action) static @Nullable OperationProbe.TagclaimClick(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, ornull.static voidrecordAction(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 voidrecordClick(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 booleanrefusesAction(net.minecraft.world.entity.player.Player player, net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.Action action) Whetherplayerdoingactionwould be refused, as both the client and server seams judge it.
-
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, ornull. -
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) Whetherplayerdoingactionwould be refused, as both the client and server seams judge it.
-