Class Placement.Options
java.lang.Object
dev.myriadclient.api.service.Placement.Options
- Enclosing interface:
Placement
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
FieldsModifier and TypeFieldDescriptionstatic final Placement.OptionsLenient servers: no rotation, any face.static final Placement.OptionsServers that check placements (Grim, NCP, 2b2t): rotate first and click only visible faces. -
Method Summary
Modifier and TypeMethodDescriptionbooleanairPlace()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.booleanstatic Placement.OptionsWhat the server in effect takes (AntiCheat.inEffect()): turned first where it checks the look of each click, visible faces only where it requires them.inthashCode()doublerange()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).booleanrotate()Face the clicked face server-side first (needed on servers that check placements).booleansneak()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.booleanswing()Swing the hand with each placement and click, where you see it.toString()booleanOnly click faces that point towards you with nothing in the way; strict anti-cheats reject the rest.withAirPlace(boolean airPlace) These options withairPlace()set.withRange(double range) These options withrange()set, in blocks.withRotate(boolean rotate) These options withrotate()set.withSneak(boolean sneak) These options withsneak()set.withSwing(boolean swing) These options withswing()set.withVisibleFaces(boolean visibleFaces) These options withvisibleFaces()set.
-
Field Details
-
DEFAULT
Lenient servers: no rotation, any face. -
STRICT
Servers that check placements (Grim, NCP, 2b2t): rotate first and click only visible faces.
-
-
Method Details
-
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.STRICTon Grim,DEFAULTon 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 withPlacement.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). UseReach.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 withoutrotate(), 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
These options withrotate()set. -
withAirPlace
These options withairPlace()set. -
withSwing
These options withswing()set. -
withRange
These options withrange()set, in blocks. -
withVisibleFaces
These options withvisibleFaces()set. -
withSneak
These options withsneak()set. -
equals
-
hashCode
-
toString
-