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(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)IEnergyBeamcreateEnergyBeam(IEntity owner, double x, double y, double z, float beamWidth, float headSize)Creates an energy beam projectile.IEnergyDisccreateEnergyDisc(IEntity owner, double x, double y, double z, float radius, float thickness)Creates an energy disc projectile.IEnergyLasercreateEnergyLaser(IEntity owner, double x, double y, double z, float laserWidth)Creates an energy laser projectile.IEnergyOrbcreateEnergyOrb(IEntity owner, double x, double y, double z, float size)Creates an energy orb projectile.IParticlecreateEntityParticle(String directory)Deprecated.IItemStackcreateItem(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()StringgetBiomeName(int x, int z)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(String name)IPlayergetPlayerByUUID(String uuid)String[]getPlayerNames()IScoreboardgetScoreboard()longgetSeed()StringgetSignText(int x, int y, int z)StringgetSignText(IPos pos)ObjectgetStoredData(String key)Deprecated.String[]getStoredDataKeys()ObjectgetTempData(String key)Deprecated.String[]getTempDataKeys()Deprecated.longgetTime()IBlockgetTopBlock(int x, int z)IBlockgetTopBlock(IPos pos)longgetTotalTime()booleanhasStoredData(String key)Deprecated.booleanhasTempData(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, String sound, float volume, float pitch)voidplaySoundToNearExcept(IPlayer player, 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(String key)Deprecated.voidremoveTempData(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(String key, Object value)Deprecated.voidsetTempData(String key, 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, String name)IEntityspawnClone(int x, int y, int z, int tab, String name, boolean ignoreProtection)Lets you spawn a server side cloned entityIEntityspawnClone(IPos pos, int tab, String name)IEntityspawnClone(IPos pos, int tab, String name, boolean ignoreProtection)booleanspawnEntityInWorld(IEntity entity)voidspawnParticle(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(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- the block position- Returns:
- The block at the given position. Returns null if there isn't a block
-
getTopBlock
IBlock getTopBlock(int x, int z)
- Parameters:
x- X coordinatez- Z coordinate- 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)- Parameters:
x- X coordinatez- Z coordinate- 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)- Parameters:
x- X coordinatez- Z coordinate- 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)- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate- 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- X coordinatey- Y coordinatez- Z coordinate- 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- the block position- 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)
-
playSoundToNearExcept
void playSoundToNearExcept(IPlayer player, 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.- Parameters:
x- X coordinatey- Y coordinatez- Z coordinatetileEntity- the tile entity to place
-
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.- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate
-
removeTileEntity
void removeTileEntity(IPos pos)
-
isBlockFullCube
boolean isBlockFullCube(int x, int y, int z)- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate- 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
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
-
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- Returns:
- true if the block was successfully placed
-
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- Returns:
- true if the block was successfully placed
-
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- the ray origin as [x, y, z]lookVector- should be a normalized direction vectormaxDistance- maximum ray distance in blocksstopOnBlock- whether to stop on solid blocksstopOnLiquid- whether to stop on liquid blocksstopOnCollision- whether to stop on collision boundaries- 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- the start position as [x, y, z]maxHeight- maximum search height- 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(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
-
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(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(String particle, IPos pos, double dx, double dy, double dz, double speed, int count)
-
createItem
IItemStack createItem(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(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 Object getTempData(String key)
Deprecated.
-
setTempData
@Deprecated void setTempData(String key, Object value)
Deprecated.
-
hasTempData
@Deprecated boolean hasTempData(String key)
Deprecated.
-
removeTempData
@Deprecated void removeTempData(String key)
Deprecated.
-
clearTempData
@Deprecated void clearTempData()
Deprecated.
-
getTempDataKeys
@Deprecated String[] getTempDataKeys()
Deprecated.
-
getStoredData
@Deprecated Object getStoredData(String key)
Deprecated.
-
setStoredData
@Deprecated void setStoredData(String key, Object value)
Deprecated.
-
hasStoredData
@Deprecated boolean hasStoredData(String key)
Deprecated.
-
removeStoredData
@Deprecated void removeStoredData(String key)
Deprecated.
-
clearStoredData
@Deprecated void clearStoredData()
Deprecated.
-
getStoredDataKeys
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
String[] getPlayerNames()
-
getBiomeName
String getBiomeName(int x, int z)
- Parameters:
x- Position xz- Position z- Returns:
- Returns the name of the biome
- Since:
- 1.7.10c
-
spawnClone
IEntity spawnClone(int x, int y, int z, int tab, 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
-
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.
-
createEnergyOrb
IEnergyOrb createEnergyOrb(IEntity owner, double x, double y, double z, float size)
Creates an energy orb projectile. Not spawned until fire() is called.- Parameters:
owner- The entity that owns this projectilex- Spawn X positiony- Spawn Y positionz- Spawn Z positionsize- Orb size- Returns:
- the energy orb entity
-
createEnergyBeam
IEnergyBeam createEnergyBeam(IEntity owner, double x, double y, double z, float beamWidth, float headSize)
Creates an energy beam projectile. Not spawned until fire() is called.- Parameters:
owner- The entity that owns this projectilex- Spawn X positiony- Spawn Y positionz- Spawn Z positionbeamWidth- Width of the beamheadSize- Size of the beam head- Returns:
- the energy beam entity
-
createEnergyDisc
IEnergyDisc createEnergyDisc(IEntity owner, double x, double y, double z, float radius, float thickness)
Creates an energy disc projectile. Not spawned until fire() is called.- Parameters:
owner- The entity that owns this projectilex- Spawn X positiony- Spawn Y positionz- Spawn Z positionradius- Disc radiusthickness- Disc thickness- Returns:
- the energy disc entity
-
createEnergyLaser
IEnergyLaser createEnergyLaser(IEntity owner, double x, double y, double z, float laserWidth)
Creates an energy laser projectile. Not spawned until fire() is called.- Parameters:
owner- The entity that owns this projectilex- Spawn X positiony- Spawn Y positionz- Spawn Z positionlaserWidth- Width of the laser- Returns:
- the energy laser entity
-
broadcast
void broadcast(String message)
-
-