Package noppes.npcs.api
Interface IWorld
-
public interface IWorld
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanareAllPlayersAsleep()voidbroadcast(java.lang.String message)booleancanBlockFreeze(int x, int y, int z, boolean adjacentToWater)booleancanBlockFreeze(IPos pos, boolean adjacentToWater)booleancanBlockFreezeBody(int x, int y, int z, boolean adjacentToWater)booleancanBlockFreezeBody(IPos pos, boolean adjacentToWater)booleancanLightningStrikeAt(int x, int y, int z)booleancanLightningStrikeAt(IPos pos)booleancanSeeSky(int x, int y, int z)booleancanSeeSky(IPos pos)booleancanSnowAt(int x, int y, int z, boolean checkLight)booleancanSnowAt(IPos pos, boolean checkLight)booleancanSnowAtBody(int x, int y, int z, boolean checkLight)booleancanSnowAtBody(IPos pos, boolean checkLight)voidclearStoredData()Deprecated.voidclearTempData()Deprecated.voidcontinueSounds()intcountEntities(IEntity entity)IParticlecreateEntityParticle(java.lang.String directory)Deprecated.IItemStackcreateItem(java.lang.String id, int damage, int size)voidexplode(double x, double y, double z, float range, boolean fire, boolean grief)voidexplode(IPos pos, float range, boolean fire, boolean grief)IPlayer[]getAllServerPlayers()java.lang.StringgetBiomeName(int x, int z)java.lang.StringgetBiomeName(IPos pos)IBlockgetBlock(int x, int y, int z)IBlockgetBlock(IPos pos)intgetBlockLightValue(int x, int y, int z)intgetBlockLightValue(IPos pos)intgetBlockMetadata(int x, int y, int z)intgetBlockMetadata(IPos pos)intgetChunkHeightMapMinimum(int x, int z)intgetChunkHeightMapMinimum(IPos pos)IPlayergetClosestPlayer(double x, double y, double z, double range)IPlayergetClosestPlayer(IPos pos, double range)IPlayergetClosestPlayerToEntity(IEntity entity, double range)IPlayergetClosestVulnerablePlayer(double x, double y, double z, double range)IPlayergetClosestVulnerablePlayer(IPos pos, double range)IPlayergetClosestVulnerablePlayerToEntity(IEntity entity, double range)intgetDimensionID()IEntity[]getEntitiesNear(double x, double y, double z, double range)IEntity[]getEntitiesNear(IPos position, double range)IEntitygetEntityByID(int id)intgetFullBlockLightValue(int x, int y, int z)intgetFullBlockLightValue(IPos pos)intgetHeightValue(int x, int z)intgetHeightValue(IPos pos)IEntity[]getLoadedEntities()net.minecraft.world.WorldServergetMCWorld()IPosgetNearestAir(IPos startPos, int maxHeight)IPlayergetPlayer(java.lang.String name)IPlayergetPlayerByUUID(java.lang.String uuid)java.lang.String[]getPlayerNames()IScoreboardgetScoreboard()longgetSeed()java.lang.StringgetSignText(int x, int y, int z)java.lang.StringgetSignText(IPos pos)java.lang.ObjectgetStoredData(java.lang.String key)Deprecated.java.lang.String[]getStoredDataKeys()java.lang.ObjectgetTempData(java.lang.String key)Deprecated.java.lang.String[]getTempDataKeys()Deprecated.longgetTime()IBlockgetTopBlock(int x, int z)IBlockgetTopBlock(IPos pos)longgetTotalTime()booleanhasStoredData(java.lang.String key)Deprecated.booleanhasTempData(java.lang.String key)Deprecated.booleanisBlockFreezable(int x, int y, int z)booleanisBlockFreezable(IPos pos)booleanisBlockFreezableNaturally(int x, int y, int z)booleanisBlockFreezableNaturally(IPos pos)booleanisBlockFullCube(int x, int y, int z)booleanisBlockFullCube(IPos pos)booleanisBlockHighHumidity(int x, int y, int z)booleanisBlockHighHumidity(IPos pos)booleanisBreakCancelled(int posX, int posY, int posZ)booleanisBreakCancelled(IPos pos)booleanisDay()booleanisPlaceCancelled(int posX, int posY, int posZ)booleanisPlaceCancelled(IPos pos)booleanisRaining()voidpauseSounds()voidplaySound(int id, ISound sound)voidplaySoundAtEntity(IEntity entity, java.lang.String sound, float volume, float pitch)voidplaySoundToNearExcept(IPlayer player, java.lang.String sound, float volume, float pitch)IBlockrayCastBlock(double[] startPos, double[] lookVector, int maxDistance)IBlockrayCastBlock(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 detectedIBlockrayCastBlock(IPos startPos, IPos lookVector, int maxDistance)IBlockrayCastBlock(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)IPosrayCastPos(double[] startPos, double[] lookVector, int maxDistance)IPosrayCastPos(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)IPosrayCastPos(IPos startPos, IPos lookVector, int maxDistance)IPosrayCastPos(IPos startPos, IPos lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision)voidremoveBlock(int x, int y, int z)voidremoveBlock(IPos pos)voidremoveStoredData(java.lang.String key)Deprecated.voidremoveTempData(java.lang.String key)Deprecated.voidremoveTileEntity(int x, int y, int z)Removes the block's tile entity at the given position.voidremoveTileEntity(IPos pos)booleansetBlock(int x, int y, int z, IBlock block)booleansetBlock(int x, int y, int z, IItemStack item)booleansetBlock(IPos pos, IBlock block)booleansetBlock(IPos pos, IItemStack item)booleansetBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag)booleansetBlockMetadataWithNotify(IPos pos, int metadata, int flag)voidsetRaining(boolean bo)voidsetSpawnLocation(int x, int y, int z)voidsetSpawnLocation(IPos pos)voidsetStoredData(java.lang.String key, java.lang.Object value)Deprecated.voidsetTempData(java.lang.String key, java.lang.Object value)Deprecated.voidsetTileEntity(int x, int y, int z, ITileEntity tileEntity)Sets the block's tile entity at the given position.voidsetTileEntity(IPos pos, ITileEntity tileEntity)voidsetTime(long time)IEntityspawnClone(int x, int y, int z, int tab, java.lang.String name)IEntityspawnClone(int x, int y, int z, int tab, java.lang.String name, boolean ignoreProtection)Lets you spawn a server side cloned entityIEntityspawnClone(IPos pos, int tab, java.lang.String name)IEntityspawnClone(IPos pos, int tab, java.lang.String name, boolean ignoreProtection)booleanspawnEntityInWorld(IEntity entity)voidspawnParticle(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.voidspawnParticle(java.lang.String particle, IPos pos, double dx, double dy, double dz, double speed, int count)voidstopSound(int id)voidstopSounds()voidthunderStrike(double x, double y, double z)voidthunderStrike(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
@Deprecated java.lang.Object getTempData(java.lang.String key)
Deprecated.
-
setTempData
@Deprecated void setTempData(java.lang.String key, java.lang.Object value)Deprecated.
-
hasTempData
@Deprecated boolean hasTempData(java.lang.String key)
Deprecated.
-
removeTempData
@Deprecated void removeTempData(java.lang.String key)
Deprecated.
-
clearTempData
@Deprecated void clearTempData()
Deprecated.
-
getTempDataKeys
@Deprecated java.lang.String[] getTempDataKeys()
Deprecated.
-
getStoredData
@Deprecated java.lang.Object getStoredData(java.lang.String key)
Deprecated.
-
setStoredData
@Deprecated void setStoredData(java.lang.String key, java.lang.Object value)Deprecated.
-
hasStoredData
@Deprecated boolean hasStoredData(java.lang.String key)
Deprecated.
-
removeStoredData
@Deprecated void removeStoredData(java.lang.String key)
Deprecated.
-
clearStoredData
@Deprecated void clearStoredData()
Deprecated.
-
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.
-
broadcast
void broadcast(java.lang.String message)
-
-