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 IChunkProviderchunkProviderprotected intDIST_HASH_MAGIC+ magic number used to generate fast random numbers for 3d distribution within a chunkprotected IntHashMap<Entity>entitiesByIdprotected booleanfindingSpawnPointjava.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 MapStoragemapStoragejava.util.List<EntityPlayer>playerEntities+ Array list of players in the world.protected floatprevRainingStrengthprotected floatprevThunderingStrengthWorldProviderproviderprotected floatrainingStrengthEaglercraftRandomrand+ RNG for World.protected ISaveHandlersaveHandlerprotected booleanscheduledUpdatesAreImmediateprotected booleanspawnHostileMobsprotected booleanspawnPeacefulMobsProfilertheProfilerprotected floatthunderingStrengthjava.util.List<TileEntity>tickableTileEntitiesprotected java.util.List<Entity>unloadedEntityListprotected intupdateLCG+ 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>worldAccessesprotected WorldInfoworldInfoprotected ScoreboardworldScoreboard
-
Constructor Summary
Constructors Modifier Constructor Description protectedWorld(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 voidaddBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam)voidaddTileEntities(java.util.Collection<TileEntity> tileEntityCollection)booleanaddTileEntity(TileEntity tile)booleanaddWeatherEffect(Entity entityIn)+ adds a lightning bolt to the list of lightning bolts in this world.voidaddWorldAccess(IWorldAccess worldAccess)+ Adds a IWorldAccess to the list of worldAccessesCrashReportCategoryaddWorldInfoToCrashReport(CrashReport report)+ Adds some basic stats of the world to the given crash report.voidcalculateInitialSkylight()+ Called on construction of the World class to setup the initial skylight valuesprotected voidcalculateInitialWeather()+ Called from World constructor to set rainingStrength and thunderingStrengthintcalculateSkylightSubtracted(float parFloat1)+ Returns the amount of skylight subtracted for the current timebooleancanBlockBePlaced(Block blockIn, BlockPos pos, boolean side, EnumFacing entityIn, Entity itemStackIn, ItemStack parItemStack)booleancanBlockFreeze(BlockPos pos, boolean noWaterAdj)+ Checks to see if a given block is both water and cold enough to freeze.booleancanBlockFreezeNoWater(BlockPos pos)booleancanBlockFreezeWater(BlockPos pos)booleancanBlockSeeSky(BlockPos pos)booleancanLightningStrike(BlockPos strikePosition)booleancanSeeSky(BlockPos pos)booleancanSnowAt(BlockPos pos, boolean checkLight)+ Checks to see if a given block can accumulate snow from it snowingbooleancheckBlockCollision(AxisAlignedBB bb)+ Returns true if there are any blocks in the region constrained by an AxisAlignedBBbooleancheckLight(BlockPos pos)booleancheckLightFor(EnumSkyBlock lightType, BlockPos pos)booleancheckNoEntityCollision(AxisAlignedBB bb)+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entitybooleancheckNoEntityCollision(AxisAlignedBB bb, Entity entityIn)+ Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entityvoidcheckSessionLock()+ Checks whether the session lock file was modified by another processintcountEntities(java.lang.Class<?> entityType)+ Counts how many entities of an entity class exist in the world.protected abstract IChunkProvidercreateChunkProvider()ExplosioncreateExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking)+ Creates an explosion.booleandestroyBlock(BlockPos pos, boolean dropBlock)+ Sets a block to air, but also plays the sound and particles and can spawn dropsstatic booleandoesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos)booleanextendedLevelsInChunkCache()+ set by !chunk.getAreLevelsEmptybooleanextinguishFire(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)voidforceBlockUpdateTick(Block blockType, BlockPos pos, EaglercraftRandom random)java.util.List<AxisAlignedBB>func_147461_a(AxisAlignedBB bb)voidfunc_181544_b(int parInt1)intfunc_181545_F()intgetActualHeight()+ Returns current world height.BiomeGenBasegetBiomeGenForCoords(BlockPos pos)BlockgetBlock(BlockPos pos)floatgetBlockDensity(Vec3 vec, AxisAlignedBB bb)+ Gets the percentage of real blocks within within a bounding box, along a specified vector.IBlockStategetBlockState(BlockPos pos)floatgetCelestialAngle(float partialTicks)+ calls calculateCelestialAnglefloatgetCelestialAngleRadians(float partialTicks)+ Return getCelestialAngle()*2*PIChunkgetChunkFromBlockCoords(BlockPos pos)ChunkgetChunkFromChunkCoords(int chunkX, int chunkZ)+ Returns back a chunk looked up by chunk coordinates Args: x, yIChunkProvidergetChunkProvider()+ gets the world's chunk providerintgetChunksLowestHorizon(int x, int z)+ Gets the lowest height of the chunk where sunlight directly reachesEntityPlayergetClosestPlayer(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).EntityPlayergetClosestPlayerToEntity(Entity entityIn, double distance)+ Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored).Vec3getCloudColour(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.intgetCombinedLight(BlockPos pos, int lightValue)java.util.CalendargetCurrentDate()+ returns a calendar object containing the current datefloatgetCurrentMoonPhaseFactor()+ gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25java.lang.StringgetDebugLoadedEntities()+ This string is 'All: (number of loaded entities)' Viewable by press ing F3EnumDifficultygetDifficulty()DifficultyInstancegetDifficultyForLocation(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.EntitygetEntityByID(int id)+ Returns the Entity with the given ID, or null if it doesn't exist in this World.EntitygetEntityByUUID(java.lang.String uuid)Vec3getFogColor(float partialTicks)+ Returns vector(ish) with R/G/B for fogGameRulesgetGameRules()+ Gets the GameRules instance.BlockgetGroundAboveSeaLevel(BlockPos pos)intgetHeight()+ Returns maximum world height.BlockPosgetHeight(BlockPos pos)+ Returns maximum world height.doublegetHorizon()+ Returns horizon height for use in rendering the sky.intgetLastLightningBolt()intgetLight(BlockPos pos)intgetLight(BlockPos pos, boolean checkNeighbors)floatgetLightBrightness(BlockPos pos)intgetLightFor(EnumSkyBlock type, BlockPos pos)intgetLightFromNeighbors(BlockPos pos)intgetLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos)java.util.List<Entity>getLoadedEntityList()+ Accessor for world Loaded Entity ListMapStoragegetMapStorage()intgetMoonPhase()java.util.List<NextTickListEntry>getPendingBlockUpdates(Chunk chunkIn, boolean parFlag)EntityPlayergetPlayerEntityByName(java.lang.String name)+ Find a player by name in this world.EntityPlayergetPlayerEntityByUUID(EaglercraftUUID uuid)<T extends Entity>
java.util.List<T>getPlayers(java.lang.Class<? extends T> playerType, Predicate<? super T> filter)BlockPosgetPrecipitationHeight(BlockPos pos)java.lang.StringgetProviderName()+ Returns the name of the current chunk provider, by calling chunkprovider.makeString()floatgetRainStrength(float delta)+ Returns rain strength.intgetRedstonePower(BlockPos pos, EnumFacing facing)protected abstract intgetRenderDistanceChunks()ISaveHandlergetSaveHandler()+ Returns this world's current save handlerScoreboardgetScoreboard()longgetSeed()+ gets the random world seedVec3getSkyColor(Entity entityIn, float partialTicks)+ Calculates the color for the skyboxintgetSkylightSubtracted()BlockPosgetSpawnPoint()+ Gets the spawn point in the worldfloatgetStarBrightness(float partialTicks)+ How bright are stars in the skyBlockPosgetStrongholdPos(java.lang.String name, BlockPos pos)intgetStrongPower(BlockPos pos)+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)intgetStrongPower(BlockPos pos, EnumFacing direction)+ Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)floatgetSunBrightness(float parFloat1)+ Returns the sun brightness - checks time of day, rain and thunderfloatgetThunderStrength(float delta)TileEntitygetTileEntity(BlockPos pos)BlockPosgetTopSolidOrLiquidBlock(BlockPos pos)+ Finds the highest block on the x and z coordinate that is solid or liquid, and returns its y coord.longgetTotalWorldTime()intgetUniqueDataId(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.WorldBordergetWorldBorder()WorldInfogetWorldInfo()+ Returns the world's WorldInfo objectlonggetWorldTime()WorldTypegetWorldType()booleanhandleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)+ handles the acceleration of an object whilst in water.Worldinit()voidinitialize(WorldSettings settings)booleanisAABBInMaterial(AxisAlignedBB bb, Material materialIn)+ checks if the given AABB is in the material given.booleanisAirBlock(BlockPos pos)+ Checks to see if an air block exists at the provided location.booleanisAnyLiquid(AxisAlignedBB bb)+ Returns if any of the blocks within the aabb are liquids.booleanisAnyPlayerWithinRangeAt(double x, double y, double z, double range)booleanisAreaLoaded(BlockPos center, int radius)booleanisAreaLoaded(BlockPos center, int radius, boolean allowEmpty)booleanisAreaLoaded(BlockPos from, BlockPos to)booleanisAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty)booleanisBlockFullCube(BlockPos pos)intisBlockIndirectlyGettingPowered(BlockPos pos)+ Checks if the specified block or its neighbors are powered by a neighboring block.booleanisBlockinHighHumidity(BlockPos pos)booleanisBlockLoaded(BlockPos pos)booleanisBlockLoaded(BlockPos pos, boolean allowEmpty)booleanisBlockModifiable(EntityPlayer player, BlockPos pos)booleanisBlockNormalCube(BlockPos pos, boolean _default)+ Checks if a block's material is opaque, and that it takes up a full cubebooleanisBlockPowered(BlockPos pos)booleanisBlockTickPending(BlockPos pos, Block blockType)protected booleanisChunkLoaded(int x, int z, boolean allowEmpty)booleanisDaytime()+ Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4booleanisFindingSpawnPoint()booleanisFlammableWithin(AxisAlignedBB bb)booleanisInsideBorder(WorldBorder worldBorderIn, Entity entityIn)booleanisMaterialInBB(AxisAlignedBB bb, Material materialIn)+ Returns true if the given bounding box contains the given materialbooleanisRaining()+ Returns true if the current rain strength is greater than 0.2booleanisSidePowered(BlockPos pos, EnumFacing side)booleanisSpawnChunk(int x, int z)+ Returns true if the chunk is located near the spawn pointbooleanisThundering()+ Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9voidjoinEntityInSurroundings(Entity entityIn)+ spwans an entity and loads surrounding chunksvoidloadEntities(java.util.Collection<Entity> entityCollection)WorldSavedDataloadItemData(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.voidmakeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)voidmarkBlockForUpdate(BlockPos pos)voidmarkBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)voidmarkBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax)voidmarkBlocksDirtyVertical(int x1, int z1, int x2, int z2)+ marks a vertical line of blocks as dirtyvoidmarkChunkDirty(BlockPos pos, TileEntity unusedTileEntity)voidmarkTileEntityForRemoval(TileEntity tileEntityIn)+ Adds the specified TileEntity to the pending removal list.ExplosionnewExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)+ returns a new explosion.voidnotifyBlockOfStateChange(BlockPos pos, Block blockIn)voidnotifyLightSet(BlockPos pos)voidnotifyNeighborsOfStateChange(BlockPos pos, Block blockType)voidnotifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide)voidnotifyNeighborsRespectDebug(BlockPos pos, Block blockType)protected voidonEntityAdded(Entity entityIn)protected voidonEntityRemoved(Entity entityIn)voidplayAuxSFX(int pos, BlockPos parBlockPos, int parInt2)voidplayAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int parInt2)voidplayBroadcastSound(int pos, BlockPos parBlockPos, int parInt2)protected voidplayMoodSoundAndCheckLight(int chunkIn, int parInt2, Chunk parChunk)voidplayRecord(BlockPos pos, java.lang.String name)voidplaySound(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.playSoundvoidplaySoundAtEntity(Entity entityIn, java.lang.String name, float volume, float pitch)+ Plays a sound at the entity's position.voidplaySoundEffect(double x, double y, double z, java.lang.String soundName, float volume, float pitch)+ Play a sound effect.voidplaySoundToNearExcept(EntityPlayer player, java.lang.String name, float volume, float pitch)+ Plays sound to all near players except the player reference givenMovingObjectPositionrayTraceBlocks(Vec3 parVec3_1, Vec3 parVec3_2)+ ray traces all blocks, including non-collideable onesMovingObjectPositionrayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid)+ ray traces all blocks, including non-collideable onesMovingObjectPositionrayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)+ ray traces all blocks, including non-collideable onesvoidremoveEntity(Entity entityIn)+ Schedule the entity for removal during the next tick.voidremovePlayerEntityDangerously(Entity entityIn)+ Do NOT use this method to remove normal entities- use normal removeEntityvoidremoveTileEntity(BlockPos pos)voidremoveWorldAccess(IWorldAccess worldAccess)+ Removes a worldAccess from the worldAccesses objectvoidscheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)voidscheduleUpdate(BlockPos pos, Block blockIn, int delay)voidsendBlockBreakProgress(int breakerId, BlockPos pos, int progress)voidsendQuittingDisconnectingPacket()+ If on MP, sends a quitting packet.protected voidsetActivePlayerChunksAndCheckLight()voidsetAllowedSpawnTypes(boolean hostile, boolean peaceful)+ first boolean for hostile mobs and second for peaceful mobsbooleansetBlockState(BlockPos pos, IBlockState state)+ Convenience method to update the block on both the client and serverbooleansetBlockState(BlockPos pos, IBlockState newState, int flags)+ Convenience method to update the block on both the client and serverbooleansetBlockToAir(BlockPos pos)voidsetEntityState(Entity entityIn, byte state)+ sends a Packet 38 (Entity Status) to all tracked players of that entityvoidsetInitialSpawnLocation()+ Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.voidsetItemData(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.voidsetLastLightningBolt(int lastLightningBoltIn)voidsetLightFor(EnumSkyBlock type, BlockPos pos, int lightValue)voidsetRainStrength(float strength)+ Sets the strength of the rain.EaglercraftRandomsetRandomSeed(int parInt1, int parInt2, int parInt3)+ puts the World Random seed to a specific state dependant on the inputsvoidsetSkylightSubtracted(int newSkylightSubtracted)voidsetSpawnPoint(BlockPos pos)voidsetThunderStrength(float strength)+ Sets the strength of the thunder.voidsetTileEntity(BlockPos pos, TileEntity tileEntityIn)voidsetTotalWorldTime(long worldTime)voidsetWorldTime(long time)+ Sets the world time.booleanspawnEntityInWorld(Entity entityIn)+ Called when an entity is spawned in the world.voidspawnParticle(EnumParticleTypes particleType, boolean xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, double parDouble6, int... parArrayOfInt)voidspawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parArrayOfInt)voidtick()+ Runs a single tick for the worldbooleantickUpdates(boolean parFlag)+ Runs through the list of updates to run and ticks themvoidunloadEntities(java.util.Collection<Entity> entityCollection)voidupdateAllPlayersSleepingFlag()+ Updates the flag that indicates whether or not all players in the world are sleeping.protected voidupdateBlocks()voidupdateBlockTick(BlockPos pos, Block blockIn, int delay, int priority)voidupdateComparatorOutputLevel(BlockPos pos, Block blockIn)voidupdateEntities()+ Updates (and cleans up) entities and tile entitiesvoidupdateEntity(Entity ent)+ Will update the entity in the world if the chunk the entity is in is currently loaded.voidupdateEntityWithOptionalForce(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 voidupdateWeather()+ 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:
getBiomeGenForCoordsin 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:
isAirBlockin 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:
getCombinedLightin interfaceIBlockAccess
-
getLightBrightness
public float getLightBrightness(BlockPos pos)
-
getBlockState
public IBlockState getBlockState(BlockPos pos)
- Specified by:
getBlockStatein 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:
getTileEntityin 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:
getStrongPowerin interfaceIBlockAccess
-
getWorldType
public WorldType getWorldType()
- Specified by:
getWorldTypein 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:
extendedLevelsInChunkCachein 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
-
-