Interface IWorld


  • public interface IWorld
    • 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 x
        y - World position y
        z - 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)
      • getClosestPlayerToEntity

        IPlayer getClosestPlayerToEntity​(IEntity entity,
                                         double range)
      • getClosestPlayer

        IPlayer getClosestPlayer​(double x,
                                 double y,
                                 double z,
                                 double range)
      • getClosestPlayer

        IPlayer getClosestPlayer​(IPos pos,
                                 double range)
      • getClosestVulnerablePlayerToEntity

        IPlayer getClosestVulnerablePlayerToEntity​(IEntity entity,
                                                   double range)
      • getClosestVulnerablePlayer

        IPlayer getClosestVulnerablePlayer​(double x,
                                           double y,
                                           double z,
                                           double range)
      • getClosestVulnerablePlayer

        IPlayer getClosestVulnerablePlayer​(IPos pos,
                                           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​(IPos position,
                                  double range)
      • 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.
      • 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 x
        y - World position y
        z - 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 x
        y - World position y
        z - World position z
        item - The block to be set
      • setBlock

        boolean setBlock​(int x,
                         int y,
                         int z,
                         IBlock block)
        Parameters:
        x - World position x
        y - World position y
        z - World position z
        block - The block to be set
      • setBlock

        boolean setBlock​(IPos pos,
                         IBlock block)
      • removeBlock

        void removeBlock​(int x,
                         int y,
                         int z)
        Parameters:
        x - World position x
        y - World position y
        z - 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)
      • rayCastPos

        IPos rayCastPos​(IPos startPos,
                        IPos lookVector,
                        int maxDistance)
      • 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 vector
        maxDistance -
        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)
      • rayCastBlock

        IBlock rayCastBlock​(IPos startPos,
                            IPos lookVector,
                            int maxDistance)
      • 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 position
        y - The y position
        z - 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/Particles
        x - The x position
        y - The y position
        z - The z position
        dx - Usually used for the x motion
        dy - Usually used for the y motion
        dz - Usually used for the z motion
        speed - Speed of the particles, usually between 0 and 1
        count - 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 name
        damage - The damage value
        size - 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 stored
        value - 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 stored
        value - 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 x
        y - Position y
        z - Position z
        range - Range of the explosion
        fire - Whether or not the explosion does fire damage
        grief - 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 x
        z - 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 at
        y - The y position the clone will be spawned at
        z - The z position the clone will be spawned at
        tab - The tab in which the clone is
        name - Name of the cloned entity
        ignoreProtection - Whether the spawning of this clone skips protection checks.
        Returns:
        Returns the entity which was spawned
      • spawnClone

        IEntity spawnClone​(IPos pos,
                           int tab,
                           java.lang.String name,
                           boolean ignoreProtection)
      • spawnClone

        IEntity spawnClone​(int x,
                           int y,
                           int z,
                           int tab,
                           java.lang.String name)
      • spawnClone

        IEntity spawnClone​(IPos pos,
                           int tab,
                           java.lang.String name)
      • 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.