public interface INetHandler
IPacket managing. You
can receive an instance of this class using RockBottomAPI.getNet().| Modifier and Type | Method and Description |
|---|---|
void |
blacklist(java.util.UUID id,
java.lang.String reason)
Adds a certain player's unique id to the blacklist, meaning they will not
be allowed to play on the server anymore.
|
void |
enableWhitelist(boolean enabled)
Sets the whitelist to be disabled or enabled
|
java.lang.String |
getBlacklistReason(java.util.UUID id)
Gets the reason for any player's unique id to be on the blacklist.
|
int |
getCommandLevel(AbstractEntityPlayer player)
Returns the command level of any player.
|
io.netty.channel.group.ChannelGroup |
getConnectedClients() |
void |
init(java.lang.String ip,
int port,
boolean isServer) |
boolean |
isActive()
Returns true fi the game is currently either in server or client mode.
|
boolean |
isBlacklisted(java.util.UUID id)
Returns true if a certain player's unique id is blacklisted currently
|
boolean |
isClient()
Returns true if the game is currently in client mode, meaning it houses a
player that is currently connected to a local or dedicated server that a
different player is hosting.
|
boolean |
isConnectedToServer()
Returns true if the game is currently in client mode and there is an
open, working connection to the server.
|
boolean |
isServer()
Returns true if the game is currently in server mode, meaning it acts as
a server that other players can join.
|
boolean |
isThePlayer(Entity entity)
Returns true if the passed entity is the current local player.
|
boolean |
isWhitelisted(java.util.UUID id)
Returns true if the given player unique id is on the whitelist.
|
boolean |
isWhitelistEnabled()
Returns true if the whitelist is enabled.
|
void |
removeBlacklist(java.util.UUID id)
Removes a certain player's unique id from the blacklist
|
void |
removeWhitelist(java.util.UUID id)
Removes a certain player's unique id from the whitelist of the server.
|
void |
saveServerSettings() |
void |
sendToAllPlayers(IWorld world,
IPacket packet)
Sends an
IPacket to all the players on the server, meaning that
this packet will be send to a list of clients and then handled there. |
void |
sendToAllPlayersAround(IWorld world,
IPacket packet,
double x,
double y,
double radius)
Sends an
IPacket to all of the players in the current world
within a certain radius of a certain point. |
void |
sendToAllPlayersAroundExcept(IWorld world,
IPacket packet,
double x,
double y,
double radius,
Entity except)
Sends an
IPacket to all of the players in the current world
within a certain radius of a certain point, except for a single player. |
void |
sendToAllPlayersExcept(IWorld world,
IPacket packet,
Entity except)
Sends an
IPacket to all of the players on the server except one. |
void |
sendToAllPlayersInWorld(IWorld world,
IPacket packet)
Sends an
IPacket to all the players in the current world, meaning
that this packet will be send to a list of clients and then handled
there. |
void |
sendToAllPlayersInWorldExcept(IWorld world,
IPacket packet,
Entity except)
Sends an
IPacket to all of the players in the current world
except one. |
void |
sendToAllPlayersWithLoadedPos(IWorld world,
IPacket packet,
double x,
double y)
Sends an
IPacket to all of the players in the current world that
have the given position in their list of loaded chunks. |
void |
sendToAllPlayersWithLoadedPosExcept(IWorld world,
IPacket packet,
double x,
double y,
Entity except)
Sends an
IPacket to all of the players in the current world that
have the given position in their list of loaded chunks, except for a
certain player. |
void |
sendToServer(IPacket packet)
Sends an
IPacket directly to the server where it will be
handled. |
void |
setCommandLevel(AbstractEntityPlayer player,
int level)
Sets the command level of any player to a certain value.
|
void |
setCommandLevel(java.util.UUID id,
int level)
Sets the command level of any player's unique id to a certain value.
|
void |
shutdown() |
void |
whitelist(java.util.UUID id)
Puts a certain player's unique id onto the whitelist of the server.
|
boolean isThePlayer(Entity entity)
entity - The entity to queryIGameInstance.isDedicatedServer(),
IChunkOrWorld.isLocalPlayer(Entity)boolean isClient()
IChunkOrWorld.isClient()boolean isServer()
IGameInstance.isDedicatedServer(),
IChunkOrWorld.isServer()boolean isActive()
isClient(),
isServer()boolean isConnectedToServer()
isClient()@ApiInternal io.netty.channel.group.ChannelGroup getConnectedClients()
void sendToServer(IPacket packet)
IPacket directly to the server where it will be
handled.packet - The packet to sendvoid sendToAllPlayers(IWorld world, IPacket packet)
IPacket to all the players on the server, meaning that
this packet will be send to a list of clients and then handled there.world - The worldpacket - The packet to sendvoid sendToAllPlayersExcept(IWorld world, IPacket packet, Entity except)
IPacket to all of the players on the server except one.
This can be useful for if a packet is being sent from a player that
already has a certain bit of information, possibly from having sent it to
the server prior.world - The worldpacket - The packet to sendexcept - The player that the packet should not be sent tovoid sendToAllPlayersInWorld(IWorld world, IPacket packet)
IPacket to all the players in the current world, meaning
that this packet will be send to a list of clients and then handled
there.world - The worldpacket - The packet to sendvoid sendToAllPlayersInWorldExcept(IWorld world, IPacket packet, Entity except)
IPacket to all of the players in the current world
except one. This can be useful for if a packet is being sent from a
player that already has a certain bit of information, possibly from
having sent it to the server prior.world - The worldpacket - The packet to sendexcept - The player that the packet should not be sent tovoid sendToAllPlayersAround(IWorld world, IPacket packet, double x, double y, double radius)
IPacket to all of the players in the current world
within a certain radius of a certain point. This can be useful for thigns
like machines or entity or tile-based actions where a player that is too
far away to see the change does not need to receive the packet.world - The worldpacket - The packet to sendx - The center xy - The center yradius - The radius around the centervoid sendToAllPlayersAroundExcept(IWorld world, IPacket packet, double x, double y, double radius, Entity except)
IPacket to all of the players in the current world
within a certain radius of a certain point, except for a single player.world - The worldpacket - The packet to sendx - The center xy - The center yradius - The radius around the centerexcept - The player that the packet should not be sent tovoid sendToAllPlayersWithLoadedPos(IWorld world, IPacket packet, double x, double y)
IPacket to all of the players in the current world that
have the given position in their list of loaded chunks. What this means
is that the packet will only be sent to those players that are close
enough to the position for the chunk that contains it to be loaded on
their end. This can greatly increase server performance for things that
happen in the world and for which players that don't have a given
position loaded also do not have to receive the information.world - The worldpacket - The packet to sendx - The position xy - The position yvoid sendToAllPlayersWithLoadedPosExcept(IWorld world, IPacket packet, double x, double y, Entity except)
IPacket to all of the players in the current world that
have the given position in their list of loaded chunks, except for a
certain player.world - The worldpacket - The packet to sendx - The position xy - The position yexcept - The player that the packet should not be sent toint getCommandLevel(AbstractEntityPlayer player)
player - The playerConstants.ADMIN_PERMISSIONvoid setCommandLevel(AbstractEntityPlayer player, int level)
player - The playerlevel - The command levelgetCommandLevel(AbstractEntityPlayer),
Constants.ADMIN_PERMISSIONvoid setCommandLevel(java.util.UUID id,
int level)
id - The player's idlevel - The command levelgetCommandLevel(AbstractEntityPlayer),
Constants.ADMIN_PERMISSIONvoid whitelist(java.util.UUID id)
id - The id to whitelistvoid removeWhitelist(java.util.UUID id)
id - The id to removeboolean isWhitelisted(java.util.UUID id)
id - The id to queryboolean isWhitelistEnabled()
void enableWhitelist(boolean enabled)
enabled - The valueisWhitelistEnabled()void blacklist(java.util.UUID id,
java.lang.String reason)
id - The idreason - The reason for being on the blacklistjava.lang.String getBlacklistReason(java.util.UUID id)
id - The idvoid removeBlacklist(java.util.UUID id)
id - The id to removeblacklist(UUID, String)boolean isBlacklisted(java.util.UUID id)
id - The id to query@ApiInternal void init(java.lang.String ip, int port, boolean isServer) throws java.lang.Exception
java.lang.Exception@ApiInternal void shutdown()
@ApiInternal void saveServerSettings()