Enum Class SemiblockTracker
- All Implemented Interfaces:
Serializable,Comparable<SemiblockTracker>,Constable
Server side tracker to find the semiblock entities at a given world and blockpos
(Note that one blockpos could have up to 7 semiblocks - one non-sided plus six sided semiblocks)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidclearSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) Clear any record of a semiblock at the given world/pos/facegetAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieve all the semiblocks at the given position.getAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction offsetDir) Retrieve all the semiblocks at the given position.static SemiblockTrackergetSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieve the semiblock entity at the given world/posgetSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) Retrieve the semiblock at the given world/pos/facegetSemiblocksInArea(net.minecraft.world.level.Level world, net.minecraft.world.phys.AABB aabb) Retrieve all the semiblocks in the given area.static voidonServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event) booleanputSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, ISemiBlock entity) Add a semiblock at the given world/posstatic SemiblockTrackerReturns the enum constant of this class with the specified name.static SemiblockTracker[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
onServerStopping
public static void onServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event) -
getSemiblock
public ISemiBlock getSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieve the semiblock entity at the given world/pos- Parameters:
world- the worldpos- the block- Returns:
- the entity at the given pos
-
getSemiblock
public ISemiBlock getSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) Retrieve the semiblock at the given world/pos/face- Parameters:
world- the worldpos- the blockposdirection- face of the blockpos, or null for the block itself- Returns:
- the entity, or null if none was found, or the blockpos in question isn't loaded
-
getAllSemiblocks
public Stream<ISemiBlock> getAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Retrieve all the semiblocks at the given position.- Parameters:
world- the worldpos- the blockpos- Returns:
- a collection of all the semiblocks at the given position
-
getAllSemiblocks
public Stream<ISemiBlock> getAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction offsetDir) Retrieve all the semiblocks at the given position. If there's nothing at the given position, try the position offset by one block in the given the direction.- Parameters:
world- the worldpos- the blockposoffsetDir- a direction to offset if needed- Returns:
- a stream of all the semiblocks at the given position
-
clearSemiblock
public void clearSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) Clear any record of a semiblock at the given world/pos/face- Parameters:
world- the worldpos- the blockposdirection- the side of the block, or null for the block itself
-
putSemiblock
public boolean putSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, ISemiBlock entity) Add a semiblock at the given world/pos- Parameters:
world- the worldpos- the blockposentity- the semiblock entity- Returns:
- true if it was added OK, false if there was already a semiblock there (which is an error)
-
getSemiblocksInArea
public Stream<ISemiBlock> getSemiblocksInArea(net.minecraft.world.level.Level world, net.minecraft.world.phys.AABB aabb) Retrieve all the semiblocks in the given area.- Parameters:
world- the worldaabb- a bounding box which contains all the wanted semiblocks- Returns:
- a stream of semiblock in the area
-