Class Placement.Options

java.lang.Object
dev.myriadclient.api.service.Placement.Options
Enclosing interface:
Placement

public static final class Placement.Options extends Object
How blocks are placed. Start from a preset (forServer(), DEFAULT, STRICT) and change what you need with the with methods, so options added in later versions keep their defaults in your code:
Placement.Options o = Placement.Options.forServer().withRange(range.get());
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Placement.Options
    Lenient servers: no rotation, any face.
    static final Placement.Options
    Servers that check placements (Grim, NCP, 2b2t): rotate first and click only visible faces.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Allow placing with no solid neighbour, through the off hand (swap, place, swing, swap back), clicking the face of the empty space that faces you.
    boolean
    equals(@Nullable Object o)
     
    What the server in effect takes (AntiCheat.inEffect()): turned first where it checks the look of each click, visible faces only where it requires them.
    int
     
    double
    How far a click may reach: from the eyes to the point clicked, as the server measures it (Grim also takes the eye heights of the other poses it can't rule out, which reach farther below you).
    boolean
    Face the clicked face server-side first (needed on servers that check placements).
    boolean
    Click as if sneaking, without crouching: the server gets the sneak key down for just the click (and up again straight after, before the tick's movement), so blocks that would open or toggle (chests, doors, repeaters, note blocks) can be placed against, and a chest stays single beside another.
    boolean
    Swing the hand with each placement and click, where you see it.
     
    boolean
    Only click faces that point towards you with nothing in the way; strict anti-cheats reject the rest.
    withAirPlace(boolean airPlace)
    These options with airPlace() set.
    withRange(double range)
    These options with range() set, in blocks.
    withRotate(boolean rotate)
    These options with rotate() set.
    withSneak(boolean sneak)
    These options with sneak() set.
    withSwing(boolean swing)
    These options with swing() set.
    withVisibleFaces(boolean visibleFaces)
    These options with visibleFaces() set.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final Placement.Options DEFAULT
      Lenient servers: no rotation, any face.
    • STRICT

      public static final Placement.Options STRICT
      Servers that check placements (Grim, NCP, 2b2t): rotate first and click only visible faces.
  • Method Details

    • forServer

      public static Placement.Options forServer()
      What the server in effect takes (AntiCheat.inEffect()): turned first where it checks the look of each click, visible faces only where it requires them. STRICT on Grim, DEFAULT on a vanilla server.
    • rotate

      public boolean rotate()
      Face the clicked face server-side first (needed on servers that check placements). The block is placed at the start of the tick after the rotation went out in the movement packet, before that tick's movement, as vanilla clicks; placements that a single rotation can't cover wait their turn, one rotation per tick. While facing it, movement follows the sent yaw (rotation move fix), as Grim expects.
    • airPlace

      public boolean airPlace()
      Allow placing with no solid neighbour, through the off hand (swap, place, swing, swap back), clicking the face of the empty space that faces you. 2b2t takes these; current Grim builds refuse any placement against air (AirLiquidPlace), so offer it as a choice rather than turning it on for a server.
    • swing

      public boolean swing()
      Swing the hand with each placement and click, where you see it. Off, an air placement or a click with Placement.use(Object, BlockHitResult, int, Placement.Options) still tells the server of a swing without showing one; a main-hand placement sends none. Where the server doesn't ask for swings (AntiCheat.Profile.checksSwings() false) none is sent whatever this says.
    • range

      public double range()
      How far a click may reach: from the eyes to the point clicked, as the server measures it (Grim also takes the eye heights of the other poses it can't rule out, which reach farther below you). Use Reach.blockRange() for all the server allows.
    • visibleFaces

      public boolean visibleFaces()
      Only click faces that point towards you with nothing in the way; strict anti-cheats reject the rest. Visible faces are always preferred; this makes them required. Off, and without rotate(), a face turned away from you is clicked when there's no other (the block ahead of the one you stand on), as servers that don't check which face a click lands on take.
    • sneak

      public boolean sneak()
      Click as if sneaking, without crouching: the server gets the sneak key down for just the click (and up again straight after, before the tick's movement), so blocks that would open or toggle (chests, doors, repeaters, note blocks) can be placed against, and a chest stays single beside another. Off, such blocks aren't clicked unless you're sneaking yourself.
    • withRotate

      public Placement.Options withRotate(boolean rotate)
      These options with rotate() set.
    • withAirPlace

      public Placement.Options withAirPlace(boolean airPlace)
      These options with airPlace() set.
    • withSwing

      public Placement.Options withSwing(boolean swing)
      These options with swing() set.
    • withRange

      public Placement.Options withRange(double range)
      These options with range() set, in blocks.
    • withVisibleFaces

      public Placement.Options withVisibleFaces(boolean visibleFaces)
      These options with visibleFaces() set.
    • withSneak

      public Placement.Options withSneak(boolean sneak)
      These options with sneak() set.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object