org.spongepowered.api.event.server.query.QueryServerEvent Maven / Gradle / Ivy
Show all versions of spongeapi Show documentation
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.event.server.query;
import org.spongepowered.api.event.Event;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
/**
* Called when the server is queried through the Query protocol.
*/
public interface QueryServerEvent extends Event {
interface Basic extends QueryServerEvent {
/**
* Gets the MOTD to respond with.
*
* By default, this is the server's current MOTD
*
* @return The MOTD to respond with.
*/
String motd();
/**
* Sets the MOTD to respond with.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param motd The MOTD to respond with
*/
void setMotd(String motd);
/**
* Gets the GameType to respond with.
*
* By default, this is SMP
.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @return The GameType to respond with
*/
String gameType();
/**
* Sets the GameType to respond with.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param gameType The GameType to respond with
*/
void setGameType(String gameType);
/**
* Gets the map (world) to respond with.
*
* By default, this is the current world on the server.
*
* @return The map to respond with
*/
String map();
/**
* Sets the map (world) to respond with.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param map The map to respond with
*/
void setMap(String map);
/**
* Gets the player count to respond with.
*
* By default, this is the number of players present on the server.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @return The player count to respond with
*/
int playerCount();
/**
* Sets the player count to respond with.
*
* If setting the int causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param playerCount The player count to respond with
*/
void setPlayerCount(int playerCount);
/**
* Gets the max player count to respond with.
*
* By default, this is the maximum number of players allowed on the
* server.
*
* @return The max player count to respond with
*/
int maxPlayerCount();
/**
* Sets the max player count to respond with.
*
* If setting the int causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param maxPlayerCount The max player count to respond with
*/
void setMaxPlayerCount(int maxPlayerCount);
/**
* Gets the address to respond with.
*
* By default, this is the address the server is listening on.
*
* @return The address to respond with
*/
InetSocketAddress address();
/**
* Sets the address to respond with.
*
* @param address The address to respond with
*/
void setAddress(InetSocketAddress address);
}
interface Full extends Basic {
/**
* Gets the GameId to respond with.
*
* This is currently hardcoded to MINECRAFT
.
*
* @return The GameId to respond with.
*/
String gameId();
/**
* Gets the version to respond with.
*
* By default, this is the server's Minecraft version (e.g 1.8.1).
*
*
* @return The version to respond with
*/
String version();
/**
* Sets the version to respond with.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param version The version to respond with
*/
void setVersion(String version);
/**
* Gets the list of plugins to respond with.
*
* @return The list of plugins to respond with
*/
String plugins();
/**
* Sets the list of plugins to respond with.
*
* If setting the string causes the message to go over the
* maximum size, the message will be automatically truncated.
*
* @param plugins The list of plugins to respond with
*/
void setPlugins(String plugins);
/**
* Gets the map of custom keys and values to respond with.
*
* If settings any of the keys or values causes the message
* to go over the maximum size, the message will be automatically
* truncated.
*
* @return The map of custom keys and values to respond with
*/
Map customValuesMap();
/**
* Gets the list of player names to respond with.
*
* @return The list of player names to respond with
*/
List players();
}
}