Package net.minecraft.world
Class World
- java.lang.Object
-
- net.minecraft.world.World
-
- All Implemented Interfaces:
IBlockAccess
- Direct Known Subclasses:
WorldClient
public abstract class World extends java.lang.Object implements IBlockAccess
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<ChunkCoordIntPair>
activeChunkSet
+ populated by chunks that are within 9 chunks of any playerprotected IChunkProvider
chunkProvider
protected int
DIST_HASH_MAGIC
+ magic number used to generate fast random numbers for 3d distribution within a chunkprotected IntHashMap<Entity>
entitiesById
protected boolean
findingSpawnPoint
java.util.List<Entity>
loadedEntityList
+ A list of all Entities in all currently-loaded chunksjava.util.List<TileEntity>
loadedTileEntityList
+ A list of the loaded tile entities in the worldprotected MapStorage
mapStorage
java.util.List<EntityPlayer>
playerEntities
+ Array list of players in the world.protected float
prevRainingStrength
protected float
prevThunderingStrength
WorldProvider
provider
protected float
rainingStrength
EaglercraftRandom
rand
+ RNG for World.protected ISaveHandler
saveHandler
protected boolean
scheduledUpdatesAreImmediate
protected boolean
spawnHostileMobs
protected boolean
spawnPeacefulMobs
Profiler
theProfiler
protected float
thunderingStrength
java.util.List<TileEntity>
tickableTileEntities
protected java.util.List<Entity>
unloadedEntityList
protected int
updateLCG
+ Contains the current Linear Congruential Generator seed for block updates.java.util.List<Entity>
weatherEffects
+ a list of all the lightning entitiesprotected java.util.List<IWorldAccess>
worldAccesses
protected WorldInfo
worldInfo
protected Scoreboard
worldScoreboard
-
Constructor Summary
Constructors Modifier Constructor Description protected
World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam)
void
addTileEntities(java.util.Collection<TileEntity> tileEntityCollection)
boolean
addTileEntity(TileEntity tile)
boolean
addWeatherEffect(Entity entityIn)
+ adds a lightning bolt to the list of lightning bolts in this world.void
addWorldAccess(IWorldAccess worldAccess)
+ Adds a IWorldAccess to the list of worldAccessesCrashReportCategory
addWorldInfoToCrashReport(CrashReport report)
+ Adds some basic stats of the world to the given crash report.void
calculateInitialSkylight()
+ Called on construction of the World class to setup the initial skylight valuesprotected void
calculateInitialWeather()
+ Called from World constructor to set rainingStrength and thunderingStrengthint
calculateSkylightSubtracted(float parFloat1)
+ Returns the amount of skylight subtracted for the current timeboolean
canBlockBePlaced(Block blockIn, BlockPos pos, boolean side, EnumFacing entityIn, Entity itemStackIn, ItemStack parItemStack)
boolean
canBlockFreeze(BlockPos pos, boolean noWaterAdj)
+ Checks to see if a given block is both water and cold enough to freeze.boolean
canBlockFreezeNoWater(BlockPos pos)
boolean
canBlockFreezeWater(BlockPos pos)
boolean
canBlockSeeSky(BlockPos pos)
boolean
canLightningStrike(BlockPos strikePosition)
boolean
canSeeSky(BlockPos pos)
boolean
canSnowAt(BlockPos pos, boolean checkLight)
+ Checks to see if a given block can accumulate snow from it snowingboolean
checkBlockCollision(AxisAlignedBB bb)
+ Returns true if there are any blocks in the region constrained by an AxisAlignedBBboolean
checkLight(BlockPos pos)
boolean
checkLightFor(EnumSkyBlock lightType, BlockPos pos)
boolean
checkNoEntityCollision(AxisAlignedBB bb)
+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entityboolean
checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn)
+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entityvoid
checkSessionLock()
+ Checks whether the session lock file was modified by another processint
countEntities(java.lang.Class<?> entityType)
+ Counts how many entities of an entity class exist in the world.protected abstract IChunkProvider
createChunkProvider()
Explosion
createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking)
+ Creates an explosion.boolean
destroyBlock(BlockPos pos, boolean dropBlock)
+ Sets a block to air, but also plays the sound and particles and can spawn dropsstatic boolean
doesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos)
boolean
extendedLevelsInChunkCache()
+ set by !chunk.getAreLevelsEmptyboolean
extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side)
+ Attempts to extinguish a fire<T extends Entity>
TfindNearestEntityWithinAABB(java.lang.Class<? extends T> entityType, AxisAlignedBB aabb, T closestTo)
void
forceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random)
java.util.List<AxisAlignedBB>
func_147461_a(AxisAlignedBB bb)
void
func_181544_b(int parInt1)
int
func_181545_F()
int
getActualHeight()
+ Returns current world height.BiomeGenBase
getBiomeGenForCoords(BlockPos pos)
Block
getBlock(BlockPos pos)
float
getBlockDensity(Vec3 vec, AxisAlignedBB bb)
+ Gets the percentage of real blocks within within a bounding box, along a specified vector.IBlockState
getBlockState(BlockPos pos)
float
getCelestialAngle(float partialTicks)
+ calls calculateCelestialAnglefloat
getCelestialAngleRadians(float partialTicks)
+ Return getCelestialAngle()*2*PIChunk
getChunkFromBlockCoords(BlockPos pos)
Chunk
getChunkFromChunkCoords(int chunkX, int chunkZ)
+ Returns back a chunk looked up by chunk coordinates Args: x, yIChunkProvider
getChunkProvider()
+ gets the world's chunk providerint
getChunksLowestHorizon(int x, int z)
+ Gets the lowest height of the chunk where sunlight directly reachesEntityPlayer
getClosestPlayer(double x, double y, double z, double distance)
+ Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not limit the distance).EntityPlayer
getClosestPlayerToEntity(Entity entityIn, double distance)
+ Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored).Vec3
getCloudColour(float partialTicks)
java.util.List<AxisAlignedBB>
getCollidingBoundingBoxes(Entity entityIn, AxisAlignedBB bb)
+ Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision.int
getCombinedLight(BlockPos pos, int lightValue)
java.util.Calendar
getCurrentDate()
+ returns a calendar object containing the current datefloat
getCurrentMoonPhaseFactor()
+ gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25java.lang.String
getDebugLoadedEntities()
+ This string is 'All: (number of loaded entities)' Viewable by press ing F3EnumDifficulty
getDifficulty()
DifficultyInstance
getDifficultyForLocation(BlockPos pos)
<T extends Entity>
java.util.List<T>getEntities(java.lang.Class<? extends T> entityType, Predicate<? super T> filter)
java.util.List<Entity>
getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, Predicate<? super Entity> predicate)
+ Gets all entities within the specified AABB excluding the one passed into it.<T extends Entity>
java.util.List<T>getEntitiesWithinAABB(java.lang.Class<? extends T> classEntity, AxisAlignedBB bb)
<T extends Entity>
java.util.List<T>getEntitiesWithinAABB(java.lang.Class<? extends T> clazz, AxisAlignedBB aabb, Predicate<? super T> filter)
java.util.List<Entity>
getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb)
+ Will get all entities within the specified AABB excluding the one passed into it.Entity
getEntityByID(int id)
+ Returns the Entity with the given ID, or null if it doesn't exist in this World.Entity
getEntityByUUID(java.lang.String uuid)
Vec3
getFogColor(float partialTicks)
+ Returns vector(ish) with R/G/B for fogGameRules
getGameRules()
+ Gets the GameRules instance.Block
getGroundAboveSeaLevel(BlockPos pos)
int
getHeight()
+ Returns maximum world height.BlockPos
getHeight(BlockPos pos)
+ Returns maximum world height.double
getHorizon()
+ Returns horizon height for use in rendering the sky.int
getLastLightningBolt()
int
getLight(BlockPos pos)
int
getLight(BlockPos pos, boolean checkNeighbors)
float
getLightBrightness(BlockPos pos)
int
getLightFor(EnumSkyBlock type, BlockPos pos)
int
getLightFromNeighbors(BlockPos pos)
int
getLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos)
java.util.List<Entity>
getLoadedEntityList()
+ Accessor for world Loaded Entity ListMapStorage
getMapStorage()
int
getMoonPhase()
java.util.List<NextTickListEntry>
getPendingBlockUpdates(Chunk chunkIn, boolean parFlag)
EntityPlayer
getPlayerEntityByName(java.lang.String name)
+ Find a player by name in this world.EntityPlayer
getPlayerEntityByUUID(EaglercraftUUID uuid)
<T extends Entity>
java.util.List<T>getPlayers(java.lang.Class<? extends T> playerType, Predicate<? super T> filter)
BlockPos
getPrecipitationHeight(BlockPos pos)
java.lang.String
getProviderName()
+ Returns the name of the current chunk provider, by calling chunkprovider.makeString()float
getRainStrength(float delta)
+ Returns rain strength.int
getRedstonePower(BlockPos pos, EnumFacing facing)
protected abstract int
getRenderDistanceChunks()
ISaveHandler
getSaveHandler()
+ Returns this world's current save handlerScoreboard
getScoreboard()
long
getSeed()
+ gets the random world seedVec3
getSkyColor(Entity entityIn, float partialTicks)
+ Calculates the color for the skyboxint
getSkylightSubtracted()
BlockPos
getSpawnPoint()
+ Gets the spawn point in the worldfloat
getStarBrightness(float partialTicks)
+ How bright are stars in the skyBlockPos
getStrongholdPos(java.lang.String name, BlockPos pos)
int
getStrongPower(BlockPos pos)
+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)int
getStrongPower(BlockPos pos, EnumFacing direction)
+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)float
getSunBrightness(float parFloat1)
+ Returns the sun brightness - checks time of day, rain and thunderfloat
getThunderStrength(float delta)
TileEntity
getTileEntity(BlockPos pos)
BlockPos
getTopSolidOrLiquidBlock(BlockPos pos)
+ Finds the highest block on the x and z coordinate that is solid or liquid, and returns its y coord.long
getTotalWorldTime()
int
getUniqueDataId(java.lang.String key)
+ Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the 'idcounts' file.WorldBorder
getWorldBorder()
WorldInfo
getWorldInfo()
+ Returns the world's WorldInfo objectlong
getWorldTime()
WorldType
getWorldType()
boolean
handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)
+ handles the acceleration of an object whilst in water.World
init()
void
initialize(WorldSettings settings)
boolean
isAABBInMaterial(AxisAlignedBB bb, Material materialIn)
+ checks if the given AABB is in the material given.boolean
isAirBlock(BlockPos pos)
+ Checks to see if an air block exists at the provided location.boolean
isAnyLiquid(AxisAlignedBB bb)
+ Returns if any of the blocks within the aabb are liquids.boolean
isAnyPlayerWithinRangeAt(double x, double y, double z, double range)
boolean
isAreaLoaded(BlockPos center, int radius)
boolean
isAreaLoaded(BlockPos center, int radius, boolean allowEmpty)
boolean
isAreaLoaded(BlockPos from, BlockPos to)
boolean
isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty)
boolean
isBlockFullCube(BlockPos pos)
int
isBlockIndirectlyGettingPowered(BlockPos pos)
+ Checks if the specified block or its neighbors are powered by a neighboring block.boolean
isBlockinHighHumidity(BlockPos pos)
boolean
isBlockLoaded(BlockPos pos)
boolean
isBlockLoaded(BlockPos pos, boolean allowEmpty)
boolean
isBlockModifiable(EntityPlayer player, BlockPos pos)
boolean
isBlockNormalCube(BlockPos pos, boolean _default)
+ Checks if a block's material is opaque, and that it takes up a full cubeboolean
isBlockPowered(BlockPos pos)
boolean
isBlockTickPending(BlockPos pos, Block blockType)
protected boolean
isChunkLoaded(int x, int z, boolean allowEmpty)
boolean
isDaytime()
+ Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4boolean
isFindingSpawnPoint()
boolean
isFlammableWithin(AxisAlignedBB bb)
boolean
isInsideBorder(WorldBorder worldBorderIn, Entity entityIn)
boolean
isMaterialInBB(AxisAlignedBB bb, Material materialIn)
+ Returns true if the given bounding box contains the given materialboolean
isRaining()
+ Returns true if the current rain strength is greater than 0.2boolean
isSidePowered(BlockPos pos, EnumFacing side)
boolean
isSpawnChunk(int x, int z)
+ Returns true if the chunk is located near the spawn pointboolean
isThundering()
+ Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9void
joinEntityInSurroundings(Entity entityIn)
+ spwans an entity and loads surrounding chunksvoid
loadEntities(java.util.Collection<Entity> entityCollection)
WorldSavedData
loadItemData(java.lang.Class<? extends WorldSavedData> clazz, java.lang.String dataID)
+ Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating the given Class, or returns null if none such file exists.void
makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
void
markBlockForUpdate(BlockPos pos)
void
markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)
void
markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax)
void
markBlocksDirtyVertical(int x1, int z1, int x2, int z2)
+ marks a vertical line of blocks as dirtyvoid
markChunkDirty(BlockPos pos, TileEntity unusedTileEntity)
void
markTileEntityForRemoval(TileEntity tileEntityIn)
+ Adds the specified TileEntity to the pending removal list.Explosion
newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
+ returns a new explosion.void
notifyBlockOfStateChange(BlockPos pos, Block blockIn)
void
notifyLightSet(BlockPos pos)
void
notifyNeighborsOfStateChange(BlockPos pos, Block blockType)
void
notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide)
void
notifyNeighborsRespectDebug(BlockPos pos, Block blockType)
protected void
onEntityAdded(Entity entityIn)
protected void
onEntityRemoved(Entity entityIn)
void
playAuxSFX(int pos, BlockPos parBlockPos, int parInt2)
void
playAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int parInt2)
void
playBroadcastSound(int pos, BlockPos parBlockPos, int parInt2)
protected void
playMoodSoundAndCheckLight(int chunkIn, int parInt2, Chunk parChunk)
void
playRecord(BlockPos pos, java.lang.String name)
void
playSound(double x, double y, double z, java.lang.String soundName, float volume, float pitch, boolean distanceDelay)
+ par8 is loudness, all pars passed to minecraftInstance.sndManager.playSoundvoid
playSoundAtEntity(Entity entityIn, java.lang.String name, float volume, float pitch)
+ Plays a sound at the entity's position.void
playSoundEffect(double x, double y, double z, java.lang.String soundName, float volume, float pitch)
+ Play a sound effect.void
playSoundToNearExcept(EntityPlayer player, java.lang.String name, float volume, float pitch)
+ Plays sound to all near players except the player reference givenMovingObjectPosition
rayTraceBlocks(Vec3 parVec3_1, Vec3 parVec3_2)
+ ray traces all blocks, including non-collideable onesMovingObjectPosition
rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid)
+ ray traces all blocks, including non-collideable onesMovingObjectPosition
rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)
+ ray traces all blocks, including non-collideable onesvoid
removeEntity(Entity entityIn)
+ Schedule the entity for removal during the next tick.void
removePlayerEntityDangerously(Entity entityIn)
+ Do NOT use this method to remove normal entities- use normal removeEntityvoid
removeTileEntity(BlockPos pos)
void
removeWorldAccess(IWorldAccess worldAccess)
+ Removes a worldAccess from the worldAccesses objectvoid
scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)
void
scheduleUpdate(BlockPos pos, Block blockIn, int delay)
void
sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
void
sendQuittingDisconnectingPacket()
+ If on MP, sends a quitting packet.protected void
setActivePlayerChunksAndCheckLight()
void
setAllowedSpawnTypes(boolean hostile, boolean peaceful)
+ first boolean for hostile mobs and second for peaceful mobsboolean
setBlockState(BlockPos pos, IBlockState state)
+ Convenience method to update the block on both the client and serverboolean
setBlockState(BlockPos pos, IBlockState newState, int flags)
+ Convenience method to update the block on both the client and serverboolean
setBlockToAir(BlockPos pos)
void
setEntityState(Entity entityIn, byte state)
+ sends a Packet 38 (Entity Status) to all tracked players of that entityvoid
setInitialSpawnLocation()
+ Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.void
setItemData(java.lang.String dataID, WorldSavedData worldSavedDataIn)
+ Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same id.void
setLastLightningBolt(int lastLightningBoltIn)
void
setLightFor(EnumSkyBlock type, BlockPos pos, int lightValue)
void
setRainStrength(float strength)
+ Sets the strength of the rain.EaglercraftRandom
setRandomSeed(int parInt1, int parInt2, int parInt3)
+ puts the World Random seed to a specific state dependant on the inputsvoid
setSkylightSubtracted(int newSkylightSubtracted)
void
setSpawnPoint(BlockPos pos)
void
setThunderStrength(float strength)
+ Sets the strength of the thunder.void
setTileEntity(BlockPos pos, TileEntity tileEntityIn)
void
setTotalWorldTime(long worldTime)
void
setWorldTime(long time)
+ Sets the world time.boolean
spawnEntityInWorld(Entity entityIn)
+ Called when an entity is spawned in the world.void
spawnParticle(EnumParticleTypes particleType, boolean xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, double parDouble6, int... parArrayOfInt)
void
spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parArrayOfInt)
void
tick()
+ Runs a single tick for the worldboolean
tickUpdates(boolean parFlag)
+ Runs through the list of updates to run and ticks themvoid
unloadEntities(java.util.Collection<Entity> entityCollection)
void
updateAllPlayersSleepingFlag()
+ Updates the flag that indicates whether or not all players in the world are sleeping.protected void
updateBlocks()
void
updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority)
void
updateComparatorOutputLevel(BlockPos pos, Block blockIn)
void
updateEntities()
+ Updates (and cleans up) entities and tile entitiesvoid
updateEntity(Entity ent)
+ Will update the entity in the world if the chunk the entity is in is currently loaded.void
updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
+ Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update.protected void
updateWeather()
+ Updates all weather states.
-
-
-
Field Detail
-
scheduledUpdatesAreImmediate
protected boolean scheduledUpdatesAreImmediate
-
loadedEntityList
public final java.util.List<Entity> loadedEntityList
+ A list of all Entities in all currently-loaded chunks
-
unloadedEntityList
protected final java.util.List<Entity> unloadedEntityList
-
loadedTileEntityList
public final java.util.List<TileEntity> loadedTileEntityList
+ A list of the loaded tile entities in the world
-
tickableTileEntities
public final java.util.List<TileEntity> tickableTileEntities
-
playerEntities
public final java.util.List<EntityPlayer> playerEntities
+ Array list of players in the world.
-
weatherEffects
public final java.util.List<Entity> weatherEffects
+ a list of all the lightning entities
-
entitiesById
protected final IntHashMap<Entity> entitiesById
-
updateLCG
protected int updateLCG
+ Contains the current Linear Congruential Generator seed for block updates. Used with an A value of 3 and a C value of 0x3c6ef35f, producing a highly planar series of values ill-suited for choosing random blocks in a 16x128x16 field.
-
DIST_HASH_MAGIC
protected final int DIST_HASH_MAGIC
+ magic number used to generate fast random numbers for 3d distribution within a chunk- See Also:
- Constant Field Values
-
prevRainingStrength
protected float prevRainingStrength
-
rainingStrength
protected float rainingStrength
-
prevThunderingStrength
protected float prevThunderingStrength
-
thunderingStrength
protected float thunderingStrength
-
rand
public final EaglercraftRandom rand
+ RNG for World.
-
provider
public final WorldProvider provider
-
worldAccesses
protected java.util.List<IWorldAccess> worldAccesses
-
chunkProvider
protected IChunkProvider chunkProvider
-
saveHandler
protected final ISaveHandler saveHandler
-
worldInfo
protected WorldInfo worldInfo
-
findingSpawnPoint
protected boolean findingSpawnPoint
-
mapStorage
protected MapStorage mapStorage
-
theProfiler
public final Profiler theProfiler
-
worldScoreboard
protected Scoreboard worldScoreboard
-
activeChunkSet
protected java.util.Set<ChunkCoordIntPair> activeChunkSet
+ populated by chunks that are within 9 chunks of any player
-
spawnHostileMobs
protected boolean spawnHostileMobs
-
spawnPeacefulMobs
protected boolean spawnPeacefulMobs
-
-
Constructor Detail
-
World
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
-
-
Method Detail
-
init
public World init()
-
getBiomeGenForCoords
public BiomeGenBase getBiomeGenForCoords(BlockPos pos)
- Specified by:
getBiomeGenForCoords
in interfaceIBlockAccess
-
createChunkProvider
protected abstract IChunkProvider createChunkProvider()
-
initialize
public void initialize(WorldSettings settings)
-
setInitialSpawnLocation
public void setInitialSpawnLocation()
+ Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
-
isAirBlock
public boolean isAirBlock(BlockPos pos)
+ Checks to see if an air block exists at the provided location. Note that this only checks to see if the blocks material is set to air, meaning it is possible for non-vanilla blocks to still pass this check.- Specified by:
isAirBlock
in interfaceIBlockAccess
-
isBlockLoaded
public boolean isBlockLoaded(BlockPos pos)
-
isBlockLoaded
public boolean isBlockLoaded(BlockPos pos, boolean allowEmpty)
-
isAreaLoaded
public boolean isAreaLoaded(BlockPos center, int radius)
-
isAreaLoaded
public boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty)
-
isChunkLoaded
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty)
-
getChunkFromChunkCoords
public Chunk getChunkFromChunkCoords(int chunkX, int chunkZ)
+ Returns back a chunk looked up by chunk coordinates Args: x, y
-
setBlockState
public boolean setBlockState(BlockPos pos, IBlockState newState, int flags)
+ Convenience method to update the block on both the client and server
-
setBlockToAir
public boolean setBlockToAir(BlockPos pos)
-
getEntityByUUID
public Entity getEntityByUUID(java.lang.String uuid)
-
destroyBlock
public boolean destroyBlock(BlockPos pos, boolean dropBlock)
+ Sets a block to air, but also plays the sound and particles and can spawn drops
-
setBlockState
public boolean setBlockState(BlockPos pos, IBlockState state)
+ Convenience method to update the block on both the client and server
-
markBlockForUpdate
public void markBlockForUpdate(BlockPos pos)
-
markBlocksDirtyVertical
public void markBlocksDirtyVertical(int x1, int z1, int x2, int z2)
+ marks a vertical line of blocks as dirty
-
markBlockRangeForRenderUpdate
public void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax)
-
markBlockRangeForRenderUpdate
public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)
-
notifyNeighborsOfStateChange
public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType)
-
notifyNeighborsOfStateExcept
public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide)
-
canSeeSky
public boolean canSeeSky(BlockPos pos)
-
canBlockSeeSky
public boolean canBlockSeeSky(BlockPos pos)
-
getLight
public int getLight(BlockPos pos)
-
getLightFromNeighbors
public int getLightFromNeighbors(BlockPos pos)
-
getLight
public int getLight(BlockPos pos, boolean checkNeighbors)
-
getChunksLowestHorizon
public int getChunksLowestHorizon(int x, int z)
+ Gets the lowest height of the chunk where sunlight directly reaches
-
getLightFromNeighborsFor
public int getLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos)
-
getLightFor
public int getLightFor(EnumSkyBlock type, BlockPos pos)
-
setLightFor
public void setLightFor(EnumSkyBlock type, BlockPos pos, int lightValue)
-
notifyLightSet
public void notifyLightSet(BlockPos pos)
-
getCombinedLight
public int getCombinedLight(BlockPos pos, int lightValue)
- Specified by:
getCombinedLight
in interfaceIBlockAccess
-
getLightBrightness
public float getLightBrightness(BlockPos pos)
-
getBlockState
public IBlockState getBlockState(BlockPos pos)
- Specified by:
getBlockState
in interfaceIBlockAccess
-
isDaytime
public boolean isDaytime()
+ Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4
-
rayTraceBlocks
public MovingObjectPosition rayTraceBlocks(Vec3 parVec3_1, Vec3 parVec3_2)
+ ray traces all blocks, including non-collideable ones
-
rayTraceBlocks
public MovingObjectPosition rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid)
+ ray traces all blocks, including non-collideable ones
-
rayTraceBlocks
public MovingObjectPosition rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)
+ ray traces all blocks, including non-collideable ones
-
playSoundAtEntity
public void playSoundAtEntity(Entity entityIn, java.lang.String name, float volume, float pitch)
+ Plays a sound at the entity's position. Args: entity, sound, volume (relative to 1.0), and frequency (or pitch, also relative to 1.0).
-
playSoundToNearExcept
public void playSoundToNearExcept(EntityPlayer player, java.lang.String name, float volume, float pitch)
+ Plays sound to all near players except the player reference given
-
playSoundEffect
public void playSoundEffect(double x, double y, double z, java.lang.String soundName, float volume, float pitch)
+ Play a sound effect. Many many parameters for this function. Not sure what they do, but a classic call is : (double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, 'random.door_open', 1.0F, world.rand.nextFloat() * 0.1F + 0.9F with i,j,k position of the block.
-
playSound
public void playSound(double x, double y, double z, java.lang.String soundName, float volume, float pitch, boolean distanceDelay)
+ par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound
-
playRecord
public void playRecord(BlockPos pos, java.lang.String name)
-
spawnParticle
public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parArrayOfInt)
-
spawnParticle
public void spawnParticle(EnumParticleTypes particleType, boolean xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, double parDouble6, int... parArrayOfInt)
-
addWeatherEffect
public boolean addWeatherEffect(Entity entityIn)
+ adds a lightning bolt to the list of lightning bolts in this world.
-
spawnEntityInWorld
public boolean spawnEntityInWorld(Entity entityIn)
+ Called when an entity is spawned in the world. This includes players.
-
onEntityAdded
protected void onEntityAdded(Entity entityIn)
-
onEntityRemoved
protected void onEntityRemoved(Entity entityIn)
-
removeEntity
public void removeEntity(Entity entityIn)
+ Schedule the entity for removal during the next tick. Marks the entity dead in anticipation.
-
removePlayerEntityDangerously
public void removePlayerEntityDangerously(Entity entityIn)
+ Do NOT use this method to remove normal entities- use normal removeEntity
-
addWorldAccess
public void addWorldAccess(IWorldAccess worldAccess)
+ Adds a IWorldAccess to the list of worldAccesses
-
removeWorldAccess
public void removeWorldAccess(IWorldAccess worldAccess)
+ Removes a worldAccess from the worldAccesses object
-
getCollidingBoundingBoxes
public java.util.List<AxisAlignedBB> getCollidingBoundingBoxes(Entity entityIn, AxisAlignedBB bb)
+ Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity, aabb
-
isInsideBorder
public boolean isInsideBorder(WorldBorder worldBorderIn, Entity entityIn)
-
func_147461_a
public java.util.List<AxisAlignedBB> func_147461_a(AxisAlignedBB bb)
-
calculateSkylightSubtracted
public int calculateSkylightSubtracted(float parFloat1)
+ Returns the amount of skylight subtracted for the current time
-
getSunBrightness
public float getSunBrightness(float parFloat1)
+ Returns the sun brightness - checks time of day, rain and thunder
-
getSkyColor
public Vec3 getSkyColor(Entity entityIn, float partialTicks)
+ Calculates the color for the skybox
-
getCelestialAngle
public float getCelestialAngle(float partialTicks)
+ calls calculateCelestialAngle
-
getMoonPhase
public int getMoonPhase()
-
getCurrentMoonPhaseFactor
public float getCurrentMoonPhaseFactor()
+ gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25
-
getCelestialAngleRadians
public float getCelestialAngleRadians(float partialTicks)
+ Return getCelestialAngle()*2*PI
-
getCloudColour
public Vec3 getCloudColour(float partialTicks)
-
getFogColor
public Vec3 getFogColor(float partialTicks)
+ Returns vector(ish) with R/G/B for fog
-
getTopSolidOrLiquidBlock
public BlockPos getTopSolidOrLiquidBlock(BlockPos pos)
+ Finds the highest block on the x and z coordinate that is solid or liquid, and returns its y coord.
-
getStarBrightness
public float getStarBrightness(float partialTicks)
+ How bright are stars in the sky
-
scheduleBlockUpdate
public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)
-
updateEntities
public void updateEntities()
+ Updates (and cleans up) entities and tile entities
-
addTileEntity
public boolean addTileEntity(TileEntity tile)
-
addTileEntities
public void addTileEntities(java.util.Collection<TileEntity> tileEntityCollection)
-
updateEntity
public void updateEntity(Entity ent)
+ Will update the entity in the world if the chunk the entity is in is currently loaded. Args: entity
-
updateEntityWithOptionalForce
public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
+ Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. Args: entity, forceUpdate
-
checkNoEntityCollision
public boolean checkNoEntityCollision(AxisAlignedBB bb)
+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity
-
checkNoEntityCollision
public boolean checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn)
+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity
-
checkBlockCollision
public boolean checkBlockCollision(AxisAlignedBB bb)
+ Returns true if there are any blocks in the region constrained by an AxisAlignedBB
-
isAnyLiquid
public boolean isAnyLiquid(AxisAlignedBB bb)
+ Returns if any of the blocks within the aabb are liquids. Args: aabb
-
isFlammableWithin
public boolean isFlammableWithin(AxisAlignedBB bb)
-
handleMaterialAcceleration
public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)
+ handles the acceleration of an object whilst in water. Not sure if it is used elsewhere.
-
isMaterialInBB
public boolean isMaterialInBB(AxisAlignedBB bb, Material materialIn)
+ Returns true if the given bounding box contains the given material
-
isAABBInMaterial
public boolean isAABBInMaterial(AxisAlignedBB bb, Material materialIn)
+ checks if the given AABB is in the material given. Used while swimming.
-
createExplosion
public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking)
+ Creates an explosion. Args: entity, x, y, z, strength
-
newExplosion
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
+ returns a new explosion. Does initiation (at time of writing Explosion is not finished)
-
getBlockDensity
public float getBlockDensity(Vec3 vec, AxisAlignedBB bb)
+ Gets the percentage of real blocks within within a bounding box, along a specified vector.
-
extinguishFire
public boolean extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side)
+ Attempts to extinguish a fire
-
getDebugLoadedEntities
public java.lang.String getDebugLoadedEntities()
+ This string is 'All: (number of loaded entities)' Viewable by press ing F3
-
getProviderName
public java.lang.String getProviderName()
+ Returns the name of the current chunk provider, by calling chunkprovider.makeString()
-
getTileEntity
public TileEntity getTileEntity(BlockPos pos)
- Specified by:
getTileEntity
in interfaceIBlockAccess
-
setTileEntity
public void setTileEntity(BlockPos pos, TileEntity tileEntityIn)
-
removeTileEntity
public void removeTileEntity(BlockPos pos)
-
markTileEntityForRemoval
public void markTileEntityForRemoval(TileEntity tileEntityIn)
+ Adds the specified TileEntity to the pending removal list.
-
isBlockFullCube
public boolean isBlockFullCube(BlockPos pos)
-
doesBlockHaveSolidTopSurface
public static boolean doesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos)
-
isBlockNormalCube
public boolean isBlockNormalCube(BlockPos pos, boolean _default)
+ Checks if a block's material is opaque, and that it takes up a full cube
-
calculateInitialSkylight
public void calculateInitialSkylight()
+ Called on construction of the World class to setup the initial skylight values
-
setAllowedSpawnTypes
public void setAllowedSpawnTypes(boolean hostile, boolean peaceful)
+ first boolean for hostile mobs and second for peaceful mobs
-
tick
public void tick()
+ Runs a single tick for the world
-
calculateInitialWeather
protected void calculateInitialWeather()
+ Called from World constructor to set rainingStrength and thunderingStrength
-
updateWeather
protected void updateWeather()
+ Updates all weather states.
-
setActivePlayerChunksAndCheckLight
protected void setActivePlayerChunksAndCheckLight()
-
getRenderDistanceChunks
protected abstract int getRenderDistanceChunks()
-
playMoodSoundAndCheckLight
protected void playMoodSoundAndCheckLight(int chunkIn, int parInt2, Chunk parChunk)
-
updateBlocks
protected void updateBlocks()
-
forceBlockUpdateTick
public void forceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random)
-
canBlockFreezeWater
public boolean canBlockFreezeWater(BlockPos pos)
-
canBlockFreezeNoWater
public boolean canBlockFreezeNoWater(BlockPos pos)
-
canBlockFreeze
public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj)
+ Checks to see if a given block is both water and cold enough to freeze.
-
canSnowAt
public boolean canSnowAt(BlockPos pos, boolean checkLight)
+ Checks to see if a given block can accumulate snow from it snowing
-
checkLight
public boolean checkLight(BlockPos pos)
-
checkLightFor
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos)
-
tickUpdates
public boolean tickUpdates(boolean parFlag)
+ Runs through the list of updates to run and ticks them
-
getPendingBlockUpdates
public java.util.List<NextTickListEntry> getPendingBlockUpdates(Chunk chunkIn, boolean parFlag)
-
getEntitiesWithinAABBExcludingEntity
public java.util.List<Entity> getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb)
+ Will get all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb
-
getEntitiesInAABBexcluding
public java.util.List<Entity> getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, Predicate<? super Entity> predicate)
+ Gets all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb, predicate
-
getEntities
public <T extends Entity> java.util.List<T> getEntities(java.lang.Class<? extends T> entityType, Predicate<? super T> filter)
-
getPlayers
public <T extends Entity> java.util.List<T> getPlayers(java.lang.Class<? extends T> playerType, Predicate<? super T> filter)
-
getEntitiesWithinAABB
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(java.lang.Class<? extends T> classEntity, AxisAlignedBB bb)
-
getEntitiesWithinAABB
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(java.lang.Class<? extends T> clazz, AxisAlignedBB aabb, Predicate<? super T> filter)
-
findNearestEntityWithinAABB
public <T extends Entity> T findNearestEntityWithinAABB(java.lang.Class<? extends T> entityType, AxisAlignedBB aabb, T closestTo)
-
getEntityByID
public Entity getEntityByID(int id)
+ Returns the Entity with the given ID, or null if it doesn't exist in this World.
-
getLoadedEntityList
public java.util.List<Entity> getLoadedEntityList()
+ Accessor for world Loaded Entity List
-
markChunkDirty
public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity)
-
countEntities
public int countEntities(java.lang.Class<?> entityType)
+ Counts how many entities of an entity class exist in the world. Args: entityClass
-
loadEntities
public void loadEntities(java.util.Collection<Entity> entityCollection)
-
unloadEntities
public void unloadEntities(java.util.Collection<Entity> entityCollection)
-
canBlockBePlaced
public boolean canBlockBePlaced(Block blockIn, BlockPos pos, boolean side, EnumFacing entityIn, Entity itemStackIn, ItemStack parItemStack)
-
func_181545_F
public int func_181545_F()
-
func_181544_b
public void func_181544_b(int parInt1)
-
getStrongPower
public int getStrongPower(BlockPos pos, EnumFacing direction)
+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)- Specified by:
getStrongPower
in interfaceIBlockAccess
-
getWorldType
public WorldType getWorldType()
- Specified by:
getWorldType
in interfaceIBlockAccess
-
getStrongPower
public int getStrongPower(BlockPos pos)
+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)
-
isSidePowered
public boolean isSidePowered(BlockPos pos, EnumFacing side)
-
getRedstonePower
public int getRedstonePower(BlockPos pos, EnumFacing facing)
-
isBlockPowered
public boolean isBlockPowered(BlockPos pos)
-
isBlockIndirectlyGettingPowered
public int isBlockIndirectlyGettingPowered(BlockPos pos)
+ Checks if the specified block or its neighbors are powered by a neighboring block. Used by blocks like TNT and Doors.
-
getClosestPlayerToEntity
public EntityPlayer getClosestPlayerToEntity(Entity entityIn, double distance)
+ Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored). Args: entity, dist
-
getClosestPlayer
public EntityPlayer getClosestPlayer(double x, double y, double z, double distance)
+ Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not limit the distance). Args: x, y, z, dist
-
isAnyPlayerWithinRangeAt
public boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range)
-
getPlayerEntityByName
public EntityPlayer getPlayerEntityByName(java.lang.String name)
+ Find a player by name in this world.
-
getPlayerEntityByUUID
public EntityPlayer getPlayerEntityByUUID(EaglercraftUUID uuid)
-
sendQuittingDisconnectingPacket
public void sendQuittingDisconnectingPacket()
+ If on MP, sends a quitting packet.
-
checkSessionLock
public void checkSessionLock() throws MinecraftException
+ Checks whether the session lock file was modified by another process- Throws:
MinecraftException
-
setTotalWorldTime
public void setTotalWorldTime(long worldTime)
-
getSeed
public long getSeed()
+ gets the random world seed
-
getTotalWorldTime
public long getTotalWorldTime()
-
getWorldTime
public long getWorldTime()
-
setWorldTime
public void setWorldTime(long time)
+ Sets the world time.
-
getSpawnPoint
public BlockPos getSpawnPoint()
+ Gets the spawn point in the world
-
setSpawnPoint
public void setSpawnPoint(BlockPos pos)
-
joinEntityInSurroundings
public void joinEntityInSurroundings(Entity entityIn)
+ spwans an entity and loads surrounding chunks
-
isBlockModifiable
public boolean isBlockModifiable(EntityPlayer player, BlockPos pos)
-
setEntityState
public void setEntityState(Entity entityIn, byte state)
+ sends a Packet 38 (Entity Status) to all tracked players of that entity
-
getChunkProvider
public IChunkProvider getChunkProvider()
+ gets the world's chunk provider
-
getSaveHandler
public ISaveHandler getSaveHandler()
+ Returns this world's current save handler
-
getWorldInfo
public WorldInfo getWorldInfo()
+ Returns the world's WorldInfo object
-
getGameRules
public GameRules getGameRules()
+ Gets the GameRules instance.
-
updateAllPlayersSleepingFlag
public void updateAllPlayersSleepingFlag()
+ Updates the flag that indicates whether or not all players in the world are sleeping.
-
getThunderStrength
public float getThunderStrength(float delta)
-
setThunderStrength
public void setThunderStrength(float strength)
+ Sets the strength of the thunder.
-
getRainStrength
public float getRainStrength(float delta)
+ Returns rain strength.
-
setRainStrength
public void setRainStrength(float strength)
+ Sets the strength of the rain.
-
isThundering
public boolean isThundering()
+ Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9
-
isRaining
public boolean isRaining()
+ Returns true if the current rain strength is greater than 0.2
-
canLightningStrike
public boolean canLightningStrike(BlockPos strikePosition)
-
isBlockinHighHumidity
public boolean isBlockinHighHumidity(BlockPos pos)
-
getMapStorage
public MapStorage getMapStorage()
-
setItemData
public void setItemData(java.lang.String dataID, WorldSavedData worldSavedDataIn)
+ Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same id.
-
loadItemData
public WorldSavedData loadItemData(java.lang.Class<? extends WorldSavedData> clazz, java.lang.String dataID)
+ Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating the given Class, or returns null if none such file exists. args: Class to instantiate, String dataid
-
getUniqueDataId
public int getUniqueDataId(java.lang.String key)
+ Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the 'idcounts' file.
-
playBroadcastSound
public void playBroadcastSound(int pos, BlockPos parBlockPos, int parInt2)
-
playAuxSFX
public void playAuxSFX(int pos, BlockPos parBlockPos, int parInt2)
-
playAuxSFXAtEntity
public void playAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int parInt2)
-
getHeight
public int getHeight()
+ Returns maximum world height.
-
getActualHeight
public int getActualHeight()
+ Returns current world height.
-
setRandomSeed
public EaglercraftRandom setRandomSeed(int parInt1, int parInt2, int parInt3)
+ puts the World Random seed to a specific state dependant on the inputs
-
extendedLevelsInChunkCache
public boolean extendedLevelsInChunkCache()
+ set by !chunk.getAreLevelsEmpty- Specified by:
extendedLevelsInChunkCache
in interfaceIBlockAccess
-
getHorizon
public double getHorizon()
+ Returns horizon height for use in rendering the sky.
-
addWorldInfoToCrashReport
public CrashReportCategory addWorldInfoToCrashReport(CrashReport report)
+ Adds some basic stats of the world to the given crash report.
-
sendBlockBreakProgress
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
-
getCurrentDate
public java.util.Calendar getCurrentDate()
+ returns a calendar object containing the current date
-
makeFireworks
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
-
getScoreboard
public Scoreboard getScoreboard()
-
getDifficultyForLocation
public DifficultyInstance getDifficultyForLocation(BlockPos pos)
-
getDifficulty
public EnumDifficulty getDifficulty()
-
getSkylightSubtracted
public int getSkylightSubtracted()
-
setSkylightSubtracted
public void setSkylightSubtracted(int newSkylightSubtracted)
-
getLastLightningBolt
public int getLastLightningBolt()
-
setLastLightningBolt
public void setLastLightningBolt(int lastLightningBoltIn)
-
isFindingSpawnPoint
public boolean isFindingSpawnPoint()
-
getWorldBorder
public WorldBorder getWorldBorder()
-
isSpawnChunk
public boolean isSpawnChunk(int x, int z)
+ Returns true if the chunk is located near the spawn point
-
-