Package noppes.npcs.api
Interface IWorld
-
public interface IWorld
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
areAllPlayersAsleep()
boolean
canBlockFreeze(int x, int y, int z, boolean adjacentToWater)
boolean
canBlockFreeze(IPos pos, boolean adjacentToWater)
boolean
canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater)
boolean
canBlockFreezeBody(IPos pos, boolean adjacentToWater)
boolean
canLightningStrikeAt(int x, int y, int z)
boolean
canLightningStrikeAt(IPos pos)
boolean
canSeeSky(int x, int y, int z)
boolean
canSeeSky(IPos pos)
boolean
canSnowAt(int x, int y, int z, boolean checkLight)
boolean
canSnowAt(IPos pos, boolean checkLight)
boolean
canSnowAtBody(int x, int y, int z, boolean checkLight)
boolean
canSnowAtBody(IPos pos, boolean checkLight)
void
clearStoredData()
Remove all stored datavoid
clearTempData()
Removes all tempdatavoid
continueSounds()
int
countEntities(IEntity entity)
IParticle
createEntityParticle(java.lang.String directory)
Deprecated.IItemStack
createItem(java.lang.String id, int damage, int size)
void
explode(double x, double y, double z, float range, boolean fire, boolean grief)
void
explode(IPos pos, float range, boolean fire, boolean grief)
IPlayer[]
getAllServerPlayers()
java.lang.String
getBiomeName(int x, int z)
java.lang.String
getBiomeName(IPos pos)
IBlock
getBlock(int x, int y, int z)
IBlock
getBlock(IPos pos)
int
getBlockLightValue(int x, int y, int z)
int
getBlockLightValue(IPos pos)
int
getBlockMetadata(int x, int y, int z)
int
getBlockMetadata(IPos pos)
int
getChunkHeightMapMinimum(int x, int z)
int
getChunkHeightMapMinimum(IPos pos)
IPlayer
getClosestPlayer(double x, double y, double z, double range)
IPlayer
getClosestPlayer(IPos pos, double range)
IPlayer
getClosestPlayerToEntity(IEntity entity, double range)
IPlayer
getClosestVulnerablePlayer(double x, double y, double z, double range)
IPlayer
getClosestVulnerablePlayer(IPos pos, double range)
IPlayer
getClosestVulnerablePlayerToEntity(IEntity entity, double range)
int
getDimensionID()
IEntity[]
getEntitiesNear(double x, double y, double z, double range)
IEntity[]
getEntitiesNear(IPos position, double range)
IEntity
getEntityByID(int id)
int
getFullBlockLightValue(int x, int y, int z)
int
getFullBlockLightValue(IPos pos)
int
getHeightValue(int x, int z)
int
getHeightValue(IPos pos)
IEntity[]
getLoadedEntities()
net.minecraft.world.WorldServer
getMCWorld()
IPos
getNearestAir(IPos startPos, int maxHeight)
IPlayer
getPlayer(java.lang.String name)
IPlayer
getPlayerByUUID(java.lang.String uuid)
java.lang.String[]
getPlayerNames()
IScoreboard
getScoreboard()
long
getSeed()
java.lang.String
getSignText(int x, int y, int z)
java.lang.String
getSignText(IPos pos)
java.lang.Object
getStoredData(java.lang.String key)
java.lang.String[]
getStoredDataKeys()
java.lang.Object
getTempData(java.lang.String key)
java.lang.String[]
getTempDataKeys()
long
getTime()
IBlock
getTopBlock(int x, int z)
IBlock
getTopBlock(IPos pos)
long
getTotalTime()
boolean
hasStoredData(java.lang.String key)
boolean
hasTempData(java.lang.String key)
boolean
isBlockFreezable(int x, int y, int z)
boolean
isBlockFreezable(IPos pos)
boolean
isBlockFreezableNaturally(int x, int y, int z)
boolean
isBlockFreezableNaturally(IPos pos)
boolean
isBlockFullCube(int x, int y, int z)
boolean
isBlockFullCube(IPos pos)
boolean
isBlockHighHumidity(int x, int y, int z)
boolean
isBlockHighHumidity(IPos pos)
boolean
isBreakCancelled(int posX, int posY, int posZ)
boolean
isBreakCancelled(IPos pos)
boolean
isDay()
boolean
isPlaceCancelled(int posX, int posY, int posZ)
boolean
isPlaceCancelled(IPos pos)
boolean
isRaining()
void
pauseSounds()
void
playSound(int id, ISound sound)
void
playSoundAtEntity(IEntity entity, java.lang.String sound, float volume, float pitch)
void
playSoundToNearExcept(IPlayer player, java.lang.String sound, float volume, float pitch)
IBlock
rayCastBlock(double[] startPos, double[] lookVector, int maxDistance)
IBlock
rayCastBlock(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
starting at the start position, draw a line in the lookVector direction until a block is detectedIBlock
rayCastBlock(IPos startPos, IPos lookVector, int maxDistance)
IBlock
rayCastBlock(IPos startPos, IPos lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IEntity[]
rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range)
IEntity[]
rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IEntity[]
rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IEntity[]
rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range)
IEntity[]
rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IPos
rayCastPos(double[] startPos, double[] lookVector, int maxDistance)
IPos
rayCastPos(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
IPos
rayCastPos(IPos startPos, IPos lookVector, int maxDistance)
IPos
rayCastPos(IPos startPos, IPos lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
void
removeBlock(int x, int y, int z)
void
removeBlock(IPos pos)
void
removeStoredData(java.lang.String key)
void
removeTempData(java.lang.String key)
void
removeTileEntity(int x, int y, int z)
Removes the block's tile entity at the given position.void
removeTileEntity(IPos pos)
boolean
setBlock(int x, int y, int z, IBlock block)
boolean
setBlock(int x, int y, int z, IItemStack item)
boolean
setBlock(IPos pos, IBlock block)
boolean
setBlock(IPos pos, IItemStack item)
boolean
setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag)
boolean
setBlockMetadataWithNotify(IPos pos, int metadata, int flag)
void
setRaining(boolean bo)
void
setSpawnLocation(int x, int y, int z)
void
setSpawnLocation(IPos pos)
void
setStoredData(java.lang.String key, java.lang.Object value)
Stored data persists through world restart.void
setTempData(java.lang.String key, java.lang.Object value)
Tempdata gets cleared when the server restarts.void
setTileEntity(int x, int y, int z, ITileEntity tileEntity)
Sets the block's tile entity at the given position.void
setTileEntity(IPos pos, ITileEntity tileEntity)
void
setTime(long time)
IEntity
spawnClone(int x, int y, int z, int tab, java.lang.String name)
IEntity
spawnClone(int x, int y, int z, int tab, java.lang.String name, boolean ignoreProtection)
Lets you spawn a server side cloned entityIEntity
spawnClone(IPos pos, int tab, java.lang.String name)
IEntity
spawnClone(IPos pos, int tab, java.lang.String name, boolean ignoreProtection)
boolean
spawnEntityInWorld(IEntity entity)
void
spawnParticle(java.lang.String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count)
Sends a packet from the server to the client everytime its called.void
spawnParticle(java.lang.String particle, IPos pos, double dx, double dy, double dz, double speed, int count)
void
stopSound(int id)
void
stopSounds()
void
thunderStrike(double x, double y, double z)
void
thunderStrike(IPos pos)
-
-
-
Method Detail
-
getTime
long getTime()
- Returns:
- The worlds time
-
getTotalTime
long getTotalTime()
- Returns:
- The total world time
-
areAllPlayersAsleep
boolean areAllPlayersAsleep()
-
getBlock
IBlock getBlock(int x, int y, int z)
- Parameters:
x
- World position xy
- World position yz
- World position z- Returns:
- The block at the given position. Returns null if there isn't a block
-
getBlock
IBlock getBlock(IPos pos)
- Parameters:
pos
-- Returns:
- The block at the given position. Returns null if there isn't a block
-
getTopBlock
IBlock getTopBlock(int x, int z)
- Returns:
- The top-most block in the world as an IBlock object.
-
isBlockFreezable
boolean isBlockFreezable(IPos pos)
-
isBlockFreezable
boolean isBlockFreezable(int x, int y, int z)
-
isBlockFreezableNaturally
boolean isBlockFreezableNaturally(IPos pos)
-
isBlockFreezableNaturally
boolean isBlockFreezableNaturally(int x, int y, int z)
-
canBlockFreeze
boolean canBlockFreeze(IPos pos, boolean adjacentToWater)
-
canBlockFreeze
boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater)
-
canBlockFreezeBody
boolean canBlockFreezeBody(IPos pos, boolean adjacentToWater)
-
canBlockFreezeBody
boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater)
-
canSnowAt
boolean canSnowAt(IPos pos, boolean checkLight)
-
canSnowAt
boolean canSnowAt(int x, int y, int z, boolean checkLight)
-
canSnowAtBody
boolean canSnowAtBody(IPos pos, boolean checkLight)
-
canSnowAtBody
boolean canSnowAtBody(int x, int y, int z, boolean checkLight)
-
getHeightValue
int getHeightValue(int x, int z)
- Returns:
- The Y-value of the world at this x & z value based on the height map of the world.
-
getHeightValue
int getHeightValue(IPos pos)
-
getChunkHeightMapMinimum
int getChunkHeightMapMinimum(int x, int z)
- Returns:
- The minimum Y-value of the world at this x & z value based on the height map of the world.
-
getChunkHeightMapMinimum
int getChunkHeightMapMinimum(IPos pos)
-
getBlockMetadata
int getBlockMetadata(int x, int y, int z)
- Returns:
- The metadata of the block at this position.
-
getBlockMetadata
int getBlockMetadata(IPos pos)
-
setBlockMetadataWithNotify
boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag)
-
setBlockMetadataWithNotify
boolean setBlockMetadataWithNotify(IPos pos, int metadata, int flag)
-
canSeeSky
boolean canSeeSky(int x, int y, int z)
- Parameters:
x
-y
-z
-- Returns:
- can the block at this position see the sky or are there no blocks above this one
-
canSeeSky
boolean canSeeSky(IPos pos)
- Parameters:
pos
-- Returns:
- can the block at this position see the sky or are there no blocks above this one
-
getFullBlockLightValue
int getFullBlockLightValue(int x, int y, int z)
-
getFullBlockLightValue
int getFullBlockLightValue(IPos pos)
-
getBlockLightValue
int getBlockLightValue(int x, int y, int z)
-
getBlockLightValue
int getBlockLightValue(IPos pos)
-
playSoundAtEntity
void playSoundAtEntity(IEntity entity, java.lang.String sound, float volume, float pitch)
-
playSoundToNearExcept
void playSoundToNearExcept(IPlayer player, java.lang.String sound, float volume, float pitch)
-
playSound
void playSound(int id, ISound sound)
-
stopSound
void stopSound(int id)
-
pauseSounds
void pauseSounds()
-
continueSounds
void continueSounds()
-
stopSounds
void stopSounds()
-
getEntityByID
IEntity getEntityByID(int id)
-
spawnEntityInWorld
boolean spawnEntityInWorld(IEntity entity)
-
getClosestPlayer
IPlayer getClosestPlayer(double x, double y, double z, double range)
-
getClosestVulnerablePlayerToEntity
IPlayer getClosestVulnerablePlayerToEntity(IEntity entity, double range)
-
getClosestVulnerablePlayer
IPlayer getClosestVulnerablePlayer(double x, double y, double z, double range)
-
countEntities
int countEntities(IEntity entity)
- Parameters:
entity
- The entity whose type will be used as a parameter- Returns:
- The amount of entities of the given type in the world.
-
getLoadedEntities
IEntity[] getLoadedEntities()
-
getEntitiesNear
IEntity[] getEntitiesNear(double x, double y, double z, double range)
-
setTileEntity
void setTileEntity(int x, int y, int z, ITileEntity tileEntity)
Sets the block's tile entity at the given position.
-
setTileEntity
void setTileEntity(IPos pos, ITileEntity tileEntity)
-
removeTileEntity
void removeTileEntity(int x, int y, int z)
Removes the block's tile entity at the given position.
-
removeTileEntity
void removeTileEntity(IPos pos)
-
isBlockFullCube
boolean isBlockFullCube(int x, int y, int z)
- Returns:
- True if the block at this position is of cubic shape. (Not a stair, slab, etc.)
-
isBlockFullCube
boolean isBlockFullCube(IPos pos)
-
getSeed
long getSeed()
-
setSpawnLocation
void setSpawnLocation(int x, int y, int z)
-
setSpawnLocation
void setSpawnLocation(IPos pos)
-
canLightningStrikeAt
boolean canLightningStrikeAt(int x, int y, int z)
-
canLightningStrikeAt
boolean canLightningStrikeAt(IPos pos)
-
isBlockHighHumidity
boolean isBlockHighHumidity(int x, int y, int z)
-
isBlockHighHumidity
boolean isBlockHighHumidity(IPos pos)
-
getSignText
java.lang.String getSignText(int x, int y, int z)
- Parameters:
x
- World position xy
- World position yz
- World position z- Returns:
- Text from signs
- Since:
- 1.7.10d
-
getSignText
java.lang.String getSignText(IPos pos)
-
setBlock
boolean setBlock(int x, int y, int z, IItemStack item)
- Parameters:
x
- World position xy
- World position yz
- World position zitem
- The block to be set
-
setBlock
boolean setBlock(IPos pos, IItemStack item)
-
setBlock
boolean setBlock(int x, int y, int z, IBlock block)
- Parameters:
x
- World position xy
- World position yz
- World position zblock
- The block to be set
-
removeBlock
void removeBlock(int x, int y, int z)
- Parameters:
x
- World position xy
- World position yz
- World position z
-
removeBlock
void removeBlock(IPos pos)
-
isPlaceCancelled
boolean isPlaceCancelled(int posX, int posY, int posZ)
-
isPlaceCancelled
boolean isPlaceCancelled(IPos pos)
-
isBreakCancelled
boolean isBreakCancelled(int posX, int posY, int posZ)
-
isBreakCancelled
boolean isBreakCancelled(IPos pos)
-
rayCastPos
IPos rayCastPos(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
rayCastPos
IPos rayCastPos(double[] startPos, double[] lookVector, int maxDistance)
-
rayCastPos
IPos rayCastPos(IPos startPos, IPos lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
rayCastBlock
IBlock rayCastBlock(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
starting at the start position, draw a line in the lookVector direction until a block is detected- Parameters:
startPos
-lookVector
- should be a normalized direction vectormaxDistance
-- Returns:
- the first detected block but null if maxDistance is reached
-
rayCastBlock
IBlock rayCastBlock(double[] startPos, double[] lookVector, int maxDistance)
-
rayCastBlock
IBlock rayCastBlock(IPos startPos, IPos lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
getNearestAir
IPos getNearestAir(IPos startPos, int maxHeight)
- Parameters:
startPos
-maxHeight
-- Returns:
- the position of the closest block of air to startPos
-
rayCastEntities
IEntity[] rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
rayCastEntities
IEntity[] rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
rayCastEntities
IEntity[] rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)
-
rayCastEntities
IEntity[] rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range)
-
rayCastEntities
IEntity[] rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range)
-
getPlayer
IPlayer getPlayer(java.lang.String name)
- Parameters:
name
- The name of the player to be returned- Returns:
- The Player with name. Null is returned when the player isnt found
-
getPlayerByUUID
IPlayer getPlayerByUUID(java.lang.String uuid)
-
setTime
void setTime(long time)
- Parameters:
time
- The world time to be set
-
isDay
boolean isDay()
- Returns:
- Whether or not its daytime
-
isRaining
boolean isRaining()
- Returns:
- Whether or not its currently raining
-
setRaining
void setRaining(boolean bo)
- Parameters:
bo
- Set if it's raining
-
thunderStrike
void thunderStrike(double x, double y, double z)
- Parameters:
x
- The x positiony
- The y positionz
- The z position
-
thunderStrike
void thunderStrike(IPos pos)
-
spawnParticle
void spawnParticle(java.lang.String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count)
Sends a packet from the server to the client everytime its called. Probably should not use this too much.- Parameters:
particle
- Particle name. Particle name list: http://minecraft.wiki/w/Particlesx
- The x positiony
- The y positionz
- The z positiondx
- Usually used for the x motiondy
- Usually used for the y motiondz
- Usually used for the z motionspeed
- Speed of the particles, usually between 0 and 1count
- Particle count
-
spawnParticle
void spawnParticle(java.lang.String particle, IPos pos, double dx, double dy, double dz, double speed, int count)
-
createItem
IItemStack createItem(java.lang.String id, int damage, int size)
- Parameters:
id
- The items namedamage
- The damage valuesize
- The number of items in the item- Returns:
- Returns the item
-
createEntityParticle
@Deprecated IParticle createEntityParticle(java.lang.String directory)
Deprecated.- Parameters:
directory
- The particle's texture directory. Use only forward slashes when writing a directory. Example: "customnpcs:textures/particle/tail.png"- Returns:
- Returns IEntityParticle object
-
getTempData
java.lang.Object getTempData(java.lang.String key)
- Parameters:
key
- Get temp data for this key- Returns:
- Returns the stored temp data
-
setTempData
void setTempData(java.lang.String key, java.lang.Object value)
Tempdata gets cleared when the server restarts. All worlds share the same temp data.- Parameters:
key
- The key for the data storedvalue
- The data stored
-
hasTempData
boolean hasTempData(java.lang.String key)
- Parameters:
key
- The key thats going to be tested against the temp data- Returns:
- Whether or not temp data containes the key
-
removeTempData
void removeTempData(java.lang.String key)
- Parameters:
key
- The key for the temp data to be removed
-
clearTempData
void clearTempData()
Removes all tempdata
-
getTempDataKeys
java.lang.String[] getTempDataKeys()
-
getStoredData
java.lang.Object getStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be returned- Returns:
- Returns the stored data
-
setStoredData
void setStoredData(java.lang.String key, java.lang.Object value)
Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved- Parameters:
key
- The key for the data storedvalue
- The data stored. This data can be either a Number or a String. Other data is not stored
-
hasStoredData
boolean hasStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be checked- Returns:
- Returns whether or not the stored data contains the key
-
removeStoredData
void removeStoredData(java.lang.String key)
- Parameters:
key
- The key of the data to be removed
-
clearStoredData
void clearStoredData()
Remove all stored data
-
getStoredDataKeys
java.lang.String[] getStoredDataKeys()
-
explode
void explode(double x, double y, double z, float range, boolean fire, boolean grief)
- Parameters:
x
- Position xy
- Position yz
- Position zrange
- Range of the explosionfire
- Whether or not the explosion does fire damagegrief
- Whether or not the explosion does damage to blocks
-
explode
void explode(IPos pos, float range, boolean fire, boolean grief)
-
getAllServerPlayers
IPlayer[] getAllServerPlayers()
-
getPlayerNames
java.lang.String[] getPlayerNames()
-
getBiomeName
java.lang.String getBiomeName(int x, int z)
- Parameters:
x
- Position xz
- Position z- Returns:
- Returns the name of the biome
- Since:
- 1.7.10c
-
getBiomeName
java.lang.String getBiomeName(IPos pos)
-
spawnClone
IEntity spawnClone(int x, int y, int z, int tab, java.lang.String name, boolean ignoreProtection)
Lets you spawn a server side cloned entity- Parameters:
x
- The x position the clone will be spawned aty
- The y position the clone will be spawned atz
- The z position the clone will be spawned attab
- The tab in which the clone isname
- Name of the cloned entityignoreProtection
- Whether the spawning of this clone skips protection checks.- Returns:
- Returns the entity which was spawned
-
spawnClone
IEntity spawnClone(int x, int y, int z, int tab, java.lang.String name)
-
getScoreboard
IScoreboard getScoreboard()
-
getMCWorld
net.minecraft.world.WorldServer getMCWorld()
- Returns:
- Returns minecraft world object
- Since:
- 1.7.10c Expert use only
-
getDimensionID
int getDimensionID()
- Returns:
- The ID of this world's dimension. 0 for overworld, 1 for End, -1 for Nether, etc.
-
-