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> p_138697_)
    • 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

      private static int getNumberOfTeams(Collection<? extends Entity> pEntities)
      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)