Class SpreadPlayersCommand

java.lang.Object
net.minecraft.server.commands.SpreadPlayersCommand

public class SpreadPlayersCommand extends Object
  • 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

      public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher)
    • spreadPlayers

      private static int spreadPlayers(CommandSourceStack source, Vec2 center, float spreadDistance, float maxRange, int maxHeight, boolean respectTeams, Collection<? extends Entity> targets) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getNumberOfTeams

      private static int getNumberOfTeams(Collection<? extends Entity> entities)
      Gets the number of unique teams for the given list of entities.
    • spreadPositions

      private static void spreadPositions(Vec2 center, double spreadDistance, ServerLevel level, RandomSource random, double minX, double minZ, double maxX, double maxZ, int maxHeight, SpreadPlayersCommand.Position[] positions, boolean respectTeams) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • setPlayerPositions

      private static double setPlayerPositions(Collection<? extends Entity> targets, ServerLevel level, SpreadPlayersCommand.Position[] positions, int maxHeight, boolean respectTeams)
    • createInitialPositions

      private static SpreadPlayersCommand.Position[] createInitialPositions(RandomSource random, int count, double minX, double minZ, double maxX, double maxZ)