Regions: CuboidRegion
A cuboid region is a region of blocks in a cuboid shape, which can look like this:
You always have eight corners in total, two of which are considered as minPos
and maxPos
. When creating a cuboid region, you always have to define those points. They should be opposite of each other, in this case, A
(for minPos) and D
(for maxPos) would be a good example.
Kelp can then automatically interpolate the other corners and create a cuboid shape out of it.
This example might be familiar to you from the Gladiator
kit of HG games.
It spawns a glass cube up in the sky and lets two players fight against each other
in there, before they are teleported on the ground again.
CuboidRegion region = CuboidRegion.create(pos1, pos2);
region.getSurfaceBlocks().forEach(block -> block.setMaterial(KelpMaterial.GLASS));
player1.teleport(region.getCenter().clone().addX(5));
player2.teleport(region.getCenter().clone().subtractX(5));
(c) 2019-2021 pxav.
Kelp is an open-source project maintained by multiple developers. If you have additions/questions/problems to report about the wiki, feel free to create an issue here on GitHub or join the Discord
- SQL Module coming soon
- Documentation in progress