Package me.hackware.api.util
Interface AntiCheatBridge
public interface AntiCheatBridge
Client policy the game managers need but cannot see from the API: the
AntiCheat module's placement/rotation/inventory limits and the vanilla
MultiPlayerGameMode.carriedIndex field (reached through a mixin
accessor). The client installs its implementation at startup; the built-in
default is permissive (no limiter, nothing gated) so the managers still
function in an un-bootstrapped environment.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classMutable holder (interfaces cannot own mutable statics).static interfacePlacement limits, read live from the AntiCheat module's settings. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaroundSilentContainerClick(Runnable sendClick) Runs a raw container-click send with whatever wire-state fixups the client policy applies around ordinary silent clicks (sprint drop/restore for Grim's MultiActionsC, queued-click flush ordering).booleancanClickSlot(net.minecraft.world.entity.player.Player player, int containerId) Inventory-click gating (AntiCheat click limits).booleancanClickSlotPair(net.minecraft.world.entity.player.Player player, int containerId) static AntiCheatBridgeget()The installed implementation (permissive default untilinstall(me.hackware.api.util.AntiCheatBridge)).intThe slot vanilla believes is selected (carriedIndex), or -1.static voidinstall(AntiCheatBridge bridge) Installed once by the client at startup.booleanWhether the AntiCheat rotation mode is SILENT.voidsetCarriedIndex(int slot) Keeps vanilla'scarriedIndexin sync with a silently sent slot.
-
Method Details
-
placementPolicy
AntiCheatBridge.PlacementPolicy placementPolicy() -
isSilentRotationMode
boolean isSilentRotationMode()Whether the AntiCheat rotation mode is SILENT. -
canClickSlot
boolean canClickSlot(net.minecraft.world.entity.player.Player player, int containerId) Inventory-click gating (AntiCheat click limits). -
canClickSlotPair
boolean canClickSlotPair(net.minecraft.world.entity.player.Player player, int containerId) -
aroundSilentContainerClick
Runs a raw container-click send with whatever wire-state fixups the client policy applies around ordinary silent clicks (sprint drop/restore for Grim's MultiActionsC, queued-click flush ordering). Clicks routed through vanilla'shandleInventoryMouseClickget this from the client's mixin; a click packet sent directly on the connection bypasses that choke point and must be wrapped here, or Grim cancels it server-side whenever the sprint flag is on the wire. -
getCarriedIndex
int getCarriedIndex()The slot vanilla believes is selected (carriedIndex), or -1. -
setCarriedIndex
void setCarriedIndex(int slot) Keeps vanilla'scarriedIndexin sync with a silently sent slot. -
get
The installed implementation (permissive default untilinstall(me.hackware.api.util.AntiCheatBridge)). -
install
Installed once by the client at startup.
-