|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectServer
public class Server extends java.lang.Object
Server.java - Interface to server stuff
Constructor and Description |
---|
Server(net.minecraft.server.MinecraftServer server)
Creates a server |
Modifier and Type | Method and Description |
---|---|
void |
addToServerQueue(java.lang.Runnable r)
Adds a runnable to the Server Queue, so that it will be executed in the Server Thread. |
void |
addToServerQueue(java.lang.Runnable r,
long delayMillis)
Executes a runnable in the server thread after a specified delay. |
void |
ban(java.lang.String player)
Bans specified player |
void |
dropItem(double x,
double y,
double z,
int itemId)
Drops an item at the specified location |
void |
dropItem(double x,
double y,
double z,
int itemId,
int quantity)
Drops an item with desired quantity at the specified location |
void |
dropItem(Location loc,
int itemId)
Drops an item at the specified location |
void |
dropItem(Location loc,
int itemId,
int quantity)
Drops an item with desired quantity at the specified location |
java.util.List<Mob> |
getAnimalList()
Returns the list of animals in all open chunks. |
Block |
getBlockAt(int x,
int y,
int z)
Returns the block at the specified location |
int |
getBlockData(int x,
int y,
int z)
Returns the block data at the specified coordinates |
int |
getBlockIdAt(int x,
int y,
int z)
Returns the block type at the specified location |
java.util.List<Boat> |
getBoatList()
Returns the list of boats in all open chunks. |
ComplexBlock |
getComplexBlock(Block block)
Returns the complex block at the specified location. |
ComplexBlock |
getComplexBlock(int x,
int y,
int z)
Returns the complex block at the specified location. |
java.util.List<BaseEntity> |
getEntityList()
Returns the list of all entities in the server in open chunks. |
int |
getHighestBlockY(int x,
int z)
Returns the highest block Y |
java.util.List<LivingEntity> |
getLivingEntityList()
Returns the list of all living entities (players, animals, mobs) in open chunks. |
net.minecraft.server.MinecraftServer |
getMCServer()
Returns the actual Minecraft Server |
java.util.List<Minecart> |
getMinecartList()
Returns the list of minecarts in all open chunks. |
java.util.List<Mob> |
getMobList()
Returns the list of mobs in all open chunks. |
ComplexBlock |
getOnlyComplexBlock(Block block)
Returns the only complex block at the specified location. |
ComplexBlock |
getOnlyComplexBlock(int x,
int y,
int z)
Returns the complex block at the specified location. |
Player |
getPlayer(java.lang.String name)
Returns specified player |
java.util.List<Player> |
getPlayerList()
Returns the player list. |
long |
getRelativeTime()
Returns current server time (0-24000) |
Location |
getSpawnLocation()
Get the global spawn location |
long |
getTime()
Returns actual server time (-2^63 to 2^63-1) |
java.util.List<BaseVehicle> |
getVehicleEntityList()
Returns the list of vehicles in open chunks. |
boolean |
isBlockIndirectlyPowered(Block block)
Checks if the provided block is being indirectly powered through redstone |
boolean |
isBlockIndirectlyPowered(int x,
int y,
int z)
Checks if the provided block is being indirectly powered through redstone |
boolean |
isBlockPowered(Block block)
Checks if the provided block is being powered through redstone |
boolean |
isBlockPowered(int x,
int y,
int z)
Checks if the provided block is being powered through redstone |
boolean |
isChunkLoaded(Block block)
Checks to see whether or not the chunk containing the given block is loaded into memory. |
boolean |
isChunkLoaded(int x,
int y,
int z)
Checks to see whether or not the chunk containing the given block coordinates is loaded into memory. |
boolean |
isTimerExpired(java.lang.String uniqueString)
Check to see if your timer has expired yet. |
void |
loadChunk(Block block)
Loads the chunk containing the given block. |
void |
loadChunk(int x,
int z)
Loads the chunk containing the given chunk coordinates. |
void |
loadChunk(int x,
int y,
int z)
Loads the chunk containing the given block coordinates. |
Player |
matchPlayer(java.lang.String name)
Tries to match a character's name. |
void |
messageAll(java.lang.String msg)
Sends a message to all users |
void |
saveInventories()
Saves all player inventories to file |
boolean |
setBlock(Block block)
Sets the block |
boolean |
setBlockAt(int blockType,
int x,
int y,
int z)
Sets the block type at the specified location |
boolean |
setBlockData(int x,
int y,
int z,
int data)
Sets the block data at the specified coordinates |
void |
setRelativeTime(long time)
Sets the current server time |
void |
setTime(long time)
Sets the actual server time |
void |
setTimer(java.lang.String uniqueString,
int time)
Starts a timer using the built-in timer system. |
void |
unban(java.lang.String player)
Unbans specified user |
void |
updateBlockPhysics(Block block)
Forces the server to update the physics for blocks around the given block |
void |
updateBlockPhysics(int x,
int y,
int z,
int data)
Forces the server to update the physics for blocks around the given block |
void |
useConsoleCommand(java.lang.String command)
Uses the specified console command |
void |
useConsoleCommand(java.lang.String command,
Player player)
Uses the specified console command |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Server(net.minecraft.server.MinecraftServer server)
server
- Method Detail |
---|
public void messageAll(java.lang.String msg)
msg
- Message text to sendpublic void ban(java.lang.String player)
player
- Name of the player to banpublic void unban(java.lang.String player)
player
- Player name to unbanpublic void useConsoleCommand(java.lang.String command)
command
- public void useConsoleCommand(java.lang.String command, Player player)
command
- command to useplayer
- player to use command aspublic void setTimer(java.lang.String uniqueString, int time)
uniqueString
- must be unique identifier for this timertime
- time till it expires (6000 roughly equals 5 minutes)public boolean isTimerExpired(java.lang.String uniqueString)
uniqueString
- unique identifierpublic long getTime()
public long getRelativeTime()
public void setTime(long time)
time
- time (-2^63 to 2^63-1)public void setRelativeTime(long time)
time
- time (0-24000)public net.minecraft.server.MinecraftServer getMCServer()
public Player matchPlayer(java.lang.String name)
name
- public Player getPlayer(java.lang.String name)
name
- public java.util.List<Player> getPlayerList()
public java.util.List<Mob> getMobList()
public java.util.List<Mob> getAnimalList()
public java.util.List<Minecart> getMinecartList()
public java.util.List<Boat> getBoatList()
public java.util.List<BaseEntity> getEntityList()
public java.util.List<LivingEntity> getLivingEntityList()
public java.util.List<BaseVehicle> getVehicleEntityList()
public Location getSpawnLocation()
public boolean setBlock(Block block)
block
- public Block getBlockAt(int x, int y, int z)
x
- y
- z
- public int getBlockData(int x, int y, int z)
x
- xy
- yz
- zpublic boolean setBlockData(int x, int y, int z, int data)
x
- xy
- yz
- zdata
- datapublic boolean setBlockAt(int blockType, int x, int y, int z)
blockType
- x
- y
- z
- public int getHighestBlockY(int x, int z)
x
- z
- public int getBlockIdAt(int x, int y, int z)
x
- y
- z
- public ComplexBlock getComplexBlock(Block block)
block
- public ComplexBlock getComplexBlock(int x, int y, int z)
x
- xy
- yz
- zpublic ComplexBlock getOnlyComplexBlock(Block block)
block
- public ComplexBlock getOnlyComplexBlock(int x, int y, int z)
x
- xy
- yz
- zpublic void dropItem(Location loc, int itemId)
loc
- itemId
- public void dropItem(double x, double y, double z, int itemId)
x
- y
- z
- itemId
- public void dropItem(Location loc, int itemId, int quantity)
loc
- itemId
- quantity
- public void dropItem(double x, double y, double z, int itemId, int quantity)
x
- y
- z
- itemId
- quantity
- public void updateBlockPhysics(Block block)
block
- the block that changedpublic void updateBlockPhysics(int x, int y, int z, int data)
x
- the X coordinate of the blocky
- the Y coordinate of the blockz
- the Z coordinate of the blockdata
- the new data for the blockpublic void addToServerQueue(java.lang.Runnable r)
r
- - the runnablepublic void addToServerQueue(java.lang.Runnable r, long delayMillis)
r
- - the runnabledelayMillis
- - the delay in millisecondspublic void saveInventories()
public boolean isChunkLoaded(Block block)
block
- the Block to checkpublic boolean isChunkLoaded(int x, int y, int z)
x
- a block x-coordinatey
- a block y-coordinatez
- a block z-coordinatepublic void loadChunk(Block block)
block
- the Block to checkpublic void loadChunk(int x, int y, int z)
x
- a block x-coordinatey
- a block y-coordinatez
- a block z-coordinatepublic void loadChunk(int x, int z)
x
- a chunk x-coordinatez
- a chunk z-coordinatepublic boolean isBlockPowered(Block block)
block
- Block to checkpublic boolean isBlockPowered(int x, int y, int z)
x
- a block x-coordinatey
- a block y-coordinatez
- a block z-coordinatepublic boolean isBlockIndirectlyPowered(Block block)
block
- Block to checkpublic boolean isBlockIndirectlyPowered(int x, int y, int z)
x
- a block x-coordinatey
- a block y-coordinatez
- a block z-coordinate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |