Class GhostBlocks
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.GhostBlocks
Blocks drawn as ghosts: their real models (block entities' too, a chest as a chest), drawn by the game's own
renderers with the player's camera into a picture of their own, then laid over the world at one opacity and tint. As
one picture, a ghost shows only its outside, as the real block would, never its inside or far faces through its near
ones; and it is in perspective from every side.
Call draw(java.util.Collection<net.ixdarklord.coolcatcanvas.api.client.vfx.GhostBlocks.Placed>, int, net.ixdarklord.coolcatcanvas.api.client.vfx.GhostBlocks.Show, boolean) right after the level is drawn, while its depth is still there. Each call draws one group in one colour; call it once for each.
GhostBlocks.draw(List.of(new GhostBlocks.Placed(pos, Blocks.CHEST.defaultBlockState())), 0x80FFFFFF,
GhostBlocks.Show.THROUGH_WALLS, false);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA block to draw as a ghost, where it is drawn.static enumWhere a ghost shows, against the world in front of it or behind it. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidForgets the block models made so far: call after the game's models are reloaded, so new ones are drawn.static voiddraw(Collection<GhostBlocks.Placed> blocks, int argb, GhostBlocks.Show show, boolean shaded) Draws blocks as ghosts inargb: its colour tints them, its alpha is their opacity.
-
Method Details
-
draw
public static void draw(Collection<GhostBlocks.Placed> blocks, int argb, GhostBlocks.Show show, boolean shaded) Draws blocks as ghosts inargb: its colour tints them, its alpha is their opacity.- Parameters:
shaded- lit as blocks are in the world, each face its own shade; false for every face full bright (so they stand out, through walls say)
-
clearModels
public static void clearModels()Forgets the block models made so far: call after the game's models are reloaded, so new ones are drawn.
-