Package net.minecraft.server.commands
Class SpreadPlayersCommand
java.lang.Object
net.minecraft.server.commands.SpreadPlayersCommand
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.Dynamic4CommandExceptionType
private static final com.mojang.brigadier.exceptions.Dynamic4CommandExceptionType
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static SpreadPlayersCommand.Position[]
createInitialPositions
(RandomSource pRandom, int pCount, double pMinX, double pMinZ, double pMaxX, double pMaxZ) private static int
getNumberOfTeams
(Collection<? extends Entity> pEntities) Gets the number of unique teams for the given list of entities.static void
register
(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> p_138697_) private static double
setPlayerPositions
(Collection<? extends Entity> pTargets, ServerLevel pLevel, SpreadPlayersCommand.Position[] pPositions, int pMaxHeight, boolean pRespectTeams) private static int
spreadPlayers
(CommandSourceStack pSource, Vec2 pCenter, float pSpreadDistance, float pMaxRange, int pMaxHeight, boolean pRespectTeams, Collection<? extends Entity> pTargets) private static void
spreadPositions
(Vec2 pCenter, double pSpreadDistance, ServerLevel pLevel, RandomSource pRandom, double pMinX, double pMinZ, double pMaxX, double pMaxZ, int pMaxHeight, SpreadPlayersCommand.Position[] pPositions, boolean pRespectTeams)
-
Field Details
-
MAX_ITERATION_COUNT
private static final int MAX_ITERATION_COUNT- See Also:
-
ERROR_FAILED_TO_SPREAD_TEAMS
private static final com.mojang.brigadier.exceptions.Dynamic4CommandExceptionType ERROR_FAILED_TO_SPREAD_TEAMS -
ERROR_FAILED_TO_SPREAD_ENTITIES
private static final com.mojang.brigadier.exceptions.Dynamic4CommandExceptionType ERROR_FAILED_TO_SPREAD_ENTITIES -
ERROR_INVALID_MAX_HEIGHT
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_INVALID_MAX_HEIGHT
-
-
Constructor Details
-
SpreadPlayersCommand
public SpreadPlayersCommand()
-
-
Method Details
-
register
-
spreadPlayers
private static int spreadPlayers(CommandSourceStack pSource, Vec2 pCenter, float pSpreadDistance, float pMaxRange, int pMaxHeight, boolean pRespectTeams, Collection<? extends Entity> pTargets) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getNumberOfTeams
Gets the number of unique teams for the given list of entities. -
spreadPositions
private static void spreadPositions(Vec2 pCenter, double pSpreadDistance, ServerLevel pLevel, RandomSource pRandom, double pMinX, double pMinZ, double pMaxX, double pMaxZ, int pMaxHeight, SpreadPlayersCommand.Position[] pPositions, boolean pRespectTeams) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setPlayerPositions
private static double setPlayerPositions(Collection<? extends Entity> pTargets, ServerLevel pLevel, SpreadPlayersCommand.Position[] pPositions, int pMaxHeight, boolean pRespectTeams) -
createInitialPositions
private static SpreadPlayersCommand.Position[] createInitialPositions(RandomSource pRandom, int pCount, double pMinX, double pMinZ, double pMaxX, double pMaxZ)
-