Package net.minecraft.src
Class World
java.lang.Object
net.minecraft.src.World
- All Implemented Interfaces:
IBlockAccess
- Direct Known Subclasses:
WorldClient,WorldServer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<ChunkCoordIntPair>list of same coords in m_activeChunksCoordsMapprotected LongHashMappopulated by chunks that are within the view distance (default 8 chunks) of any player, the original spawn, or any other chunk loaderprotected IChunkProviderHandles chunk operations and cachingintOption > Difficulty setting (0 - 3)protected final intmagic number used to generate fast random numbers for 3d distribution within a chunkbooleanBoolean that is set to true when trying to find a spawn pointbooleanThis is set to true for client worlds, and false for server worlds.intSet to 2 whenever a lightning bolt is generated in SSP.static final intA list of all Entities in all currently-loaded chunksA list of all TileEntities in all currently-loaded chunksArray list of players in the world.protected floatprotected floatfinal WorldProviderThe WorldProvider instance that World uses.protected floatRNG for World.protected final ISaveHandlerbooleanboolean; if true updates scheduled by scheduleBlockUpdate happen immediatelyintHow much light is subtracted from full daylightprotected booleanindicates if enemies are spawned or notprotected booleanA flag indicating whether we should spawn peaceful mobs.final Profilerprotected floatprotected Listprotected intContains the current Linear Congruential Generator seed for block updates.final VillageCollectiona list of all the lightning entitiesprotected Listholds information about a world (size on disk, time, spawn point, seed, ...)protected Scoreboard -
Constructor Summary
ConstructorsConstructorDescriptionWorld(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler, ILogAgent par6ILogAgent) World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAreaAroundChunkToActiveChunkMap(int iChunkX, int iChunkZ) voidaddBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) Adds a block event with the given Args to the blockEventCache.protected voidaddEntityToActiveChunkMap(Entity entity) voidaddLoadedEntities(List par1List) // +++START EDIT+++ // ---END EDIT--- adds entities to the loaded entities list, and loads thier skins.voidaddTileEntity(Collection par1Collection) protected voidaddToActiveChunkMap(int iChunkX, int iChunkZ) booleanaddWeatherEffect(Entity par1Entity) adds a lightning bolt to the list of lightning bolts in this world.voidaddWorldAccess(IWorldAccess par1IWorldAccess) Adds a IWorldAccess to the list of worldAccessesaddWorldInfoToCrashReport(CrashReport par1CrashReport) Adds some basic stats of the world to the given crash report.booleanblockExists(int par1, int par2, int par3) Returns whether a block exists at world coordinates x, y, zintblockGetRenderType(int par1, int par2, int par3) Returns the render type of the block at the given coordinate.booleanblockHasTileEntity(int par1, int par2, int par3) Checks if a block at a given position should have a tile entity.voidCalled on construction of the World class to setup the initial skylight valuesintcalculateSkylightSubtracted(float par1) Returns the amount of skylight subtracted for the current timebooleancanBlockFreeze(int par1, int par2, int par3, boolean par4) checks to see if a given block is both water, and cold enough to freeze - if the par4 boolean is set, this will only return true if there is a non-water block immediately adjacent to the specified blockbooleancanBlockSeeTheSky(int par1, int par2, int par3) Checks if the specified block is able to see the skybooleancanBlockSuffocateEntity(int par1, int par2, int par3) booleancanLightningStrikeAt(int par1, int par2, int par3) FCNOTE: Terribly named.booleancanLightningStrikeAtPos(int i, int j, int k) booleancanMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) Called when checking if a certain block can be mined or not.booleancanPlaceEntityOnSide(int par1, int par2, int par3, int par4, boolean par5, int par6, Entity par7Entity, ItemStack par8ItemStack) Returns true if the given Entity can be placed on the given side of the given block position.booleancanSnowAt(int x, int y, int z) Tests whether or not snow can be placed at a given locationbooleancheckBlockCollision(AxisAlignedBB par1AxisAlignedBB) Returns true if there are any blocks in the region constrained by an AxisAlignedBBbooleancheckChunksExist(int par1, int par2, int par3, int par4, int par5, int par6) Checks between a min and max all the chunks inbetween actually exist.checkLocationForMouseOverRayTrace(int i, int j, int k, Vec3 startVec, Vec3 endVec) booleancheckNoEntityCollision(AxisAlignedBB par1AxisAlignedBB) Returns true if there are no solid, live entities in the specified AxisAlignedBBbooleancheckNoEntityCollision(AxisAlignedBB par1AxisAlignedBB, Entity par2Entity) Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entityvoidChecks whether the session lock file was modified by another processprotected booleanchunkExists(int par1, int par2) Returns whether a chunk exists at chunk coordinates x, yprotected voidPerforms a raycast against all blocks in the world except liquids.Performs a raycast against all blocks in the world, and optionally liquids.voidfloatintcountEntitiesThatApplyToSpawnCap(Class classToCount) protected abstract IChunkProviderCreates the chunk provider for this world.createExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9) Creates an explosion.booleandestroyBlock(int par1, int par2, int par3, boolean par4) Destroys a block and optionally drops items.voiddestroyBlockInWorldPartially(int par1, int par2, int par3, int par4, int par5) Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed valuebooleandoChunksNearChunkExist(int par1, int par2, int par3, int par4) Checks if any of the chunks within distance (argument 4) blocks of the given block existbooleandoesBlockHaveSolidTopSurface(int i, int j, int k) Returns true if the block at the given coordinate has a solid (buildable) top surface.booleanset by !booleanextinguishFire(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5) If the block in the given direction of the given coordinate is fire, extinguish it.findClosestStructure(String par1Str, int par2, int par3, int par4) Returns the location of the closest structure of the specified type.findClosestStructureAll(String par1Str, int par2, int par3, int par4, int chunkSearchRadius, int minAbandonment) Returns the location of the closest structure of the specified type.findNearestEntityWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, Entity par3Entity) voidfunc_82738_a(long par1) voidfunc_82739_e(int par1, int par2, int par3, int par4, int par5) FCNOTE: Sends an auxSFX to all players, regardless of distance to the effect.voidfunc_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) voidfunc_96440_m(int par1, int par2, int par3, int par4) int"Active" chunks handle stuff like random block updates (grass growing, etc.)intReturns current world height.intgetActualTopSolidOrLiquidBlockHeight(int x, int z) intgetAmbientBeaconEffectAtLocation(String effectName, int locX, int locY, int locZ) getBiomeGenForCoords(int par1, int par2) Gets the biome for a given set of x/z coordinatesfloatgetBlockDensity(Vec3 par1Vec3, AxisAlignedBB par2AxisAlignedBB) Gets the percentage of real blocks within a bounding box, along a specified vector.intgetBlockId(int par1, int par2, int par3) Returns the block ID at coords x,y,zintgetBlockLightValue(int par1, int par2, int par3) Gets the light value of a block locationintgetBlockLightValue_do(int par1, int par2, int par3, boolean par4) Gets the light value of a block location.intgetBlockLightValueNoSky(int x, int y, int z) getBlockMaterial(int par1, int par2, int par3) Returns the block's material.intgetBlockMetadata(int par1, int par2, int par3) Returns the block metadata at coords x,y,zintgetBlockNaturalLightValue(int i, int j, int k) intgetBlockNaturalLightValueMaximum(int i, int j, int k) intgetBlockPowerInput(int par1, int par2, int par3) Returns the highest redstone signal strength powering the given block.getBlockTileEntity(int par1, int par2, int par3) Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity existsfloatgetBrightness(int par1, int par2, int par3, int par4) floatgetCelestialAngle(float par1) calls calculateCelestialAnglefloatgetCelestialAngleRadians(float par1) Return getCelestialAngle()*2*PIgetChunkFromBlockCoords(int par1, int par2) Returns a chunk looked up by block coordinates.getChunkFromChunkCoords(int par1, int par2) Returns back a chunk looked up by chunk coordinates Args: x, yintgetChunkHeightMapMinimum(int par1, int par2) Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded.gets the IChunkProvider this world uses.intThe "view distance" is actually the range at which chunks are loaded, specified as a vanilla server parameter (default is 10 chunks).getClosestEntityMatchingCriteriaWithinRange(double dSourcePosX, double dSourcePosY, double dSourcePosZ, double dRange, ClosestEntitySelectionCriteria criteria) getClosestPlayer(double par1, double par3, double par5, double par7) Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not limit the distance).getClosestPlayerToEntity(Entity par1Entity, double par2) Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored).getClosestVulnerablePlayer(double par1, double par3, double par5, double par7) Returns the closest vulnerable player within the given radius, or null if none is found.getClosestVulnerablePlayerToEntity(Entity par1Entity, double par2) Returns the closest vulnerable player to this entity within the given radius, or null if none is foundgetCloudColour(float par1) getCollidingBlockBounds(AxisAlignedBB par1AxisAlignedBB) calculates and returns a list of colliding bounding boxes within a given AABBgetCollidingBoundingBoxes(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision.returns a calendar object containing the current datefloatgets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25abstract <T> TgetData(DataEntry.WorldDataEntry<T> entry) This string is 'All: (number of loaded entities)' Viewable by press ing F3<T> TgetDifficultyParameter(Class<? extends DifficultyParam<T>> param) getEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB) Returns all entities of the specified class type which intersect with the AABB.getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) Will get all entities within the specified AABB excluding the one passed into it.getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) abstract EntitygetEntityByID(int var1) Returns the Entity with the given ID, or null if it doesn't exist in this World.getEntityPathToXYZ(Entity par1Entity, int par2, int par3, int par4, float par5, boolean par6, boolean par7, boolean par8, boolean par9) intgetFirstUncoveredBlock(int par1, int par2) Returns the block ID of the first block at this (x,z) location with air above it, searching from sea level upwards.getFogColor(float par1) Returns vector(ish) with R/G/B for fogintgetFullBlockLightValue(int par1, int par2, int par3) Does the same as getBlockLightValue_do but without checking if its not a normal blockGets the GameRules instance.intReturns current world height.intgetHeightValue(int par1, int par2) Returns the y coordinate with a block in it at this x, z coordinatedoubleReturns horizon height for use in rendering the sky.intgetIndirectPowerLevelTo(int par1, int par2, int par3, int par4) Gets the power level from a certain block face.booleangetIndirectPowerOutput(int par1, int par2, int par3, int par4) Returns the indirect signal strength being outputted by the given block in the *opposite* of the given direction.floatgetLightBrightness(int par1, int par2, int par3) Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values aren't linear for brightness).intgetLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) Any Light rendered on a 1.8 Block goes through hereAccessor for world Loaded Entity ListfloatgetLocationTensionFactor(double par1, double par3, double par5) returns a float value that can be used to determine how likely something is to go awry in the area.getMinecartSoundUpdater(EntityMinecart par1EntityMinecart) intdoublegetModifiedPlayerTargetingDistance(EntityPlayer player, double targetDistance) intfloatgetNaturalLightBrightness(int i, int j, int k) intgetPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) getPendingBlockUpdates(Chunk par1Chunk, boolean par2) getPlayerEntityByName(String par1Str) Find a player by name in this world.intgetPrecipitationHeight(int par1, int par2) Gets the height to which rain/snow will fall.Returns the name of the current chunk provider, by calling chunkprovider.makeString()floatgetRainStrength(float par1) Not sure about this actually.intgetSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) Returns saved light value without taking into account the time of day.Returns this world's current save handlerlonggetSeed()Retrieve the world seed from level.datintgetSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME.getSkyColor(Entity par1Entity, float par2) Calculates the color for the skyboxReturns the coordinates of the spawn pointfloatgetStarBrightness(float par1) How bright are stars in the skyintgetStrongestIndirectPower(int par1, int par2, int par3) floatgetSunBrightness(float par1) Returns the sun brightness - checks time of day, rain and thunderfloatgetTensionFactorForBlock(int par1, int par2, int par3) returns a float value that can be used to determine how likely something is to go awry in the area.intgetTopSolidOrLiquidBlock(int par1, int par2) Finds the highest block on the x, z coordinate that is solid and returns its y coord.longintgetUniqueDataId(String par1Str) Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the 'idcounts' file.floatgetWeightedThunderStrength(float par1) Gets the World's WorldInfo instancelongReturn the Vec3Pool object for this world.booleanhandleMaterialAcceleration(AxisAlignedBB par1AxisAlignedBB, Material par2Material, Entity par3Entity) handles the acceleration of an object whilst in water.protected voidinitialize(WorldSettings par1WorldSettings) static booleanbooleanisAABBInMaterial(AxisAlignedBB par1AxisAlignedBB, Material par2Material) checks if the given AABB is in the material given.booleanisAirBlock(int par1, int par2, int par3) Returns true if the block at the specified coordinates is emptybooleanisAnyLiquid(AxisAlignedBB par1AxisAlignedBB) Returns if any of the blocks within the aabb are liquids.booleanisBlockFreezable(int par1, int par2, int par3) checks to see if a given block is both water and is cold enough to freezebooleanisBlockFreezableNaturally(int par1, int par2, int par3) checks to see if a given block is both water and has at least one immediately adjacent non-water blockbooleanisBlockFullCube(int par1, int par2, int par3) booleanisBlockGettingPowered(int i, int j, int k) booleanisBlockHighHumidity(int par1, int par2, int par3) Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely highbooleanisBlockIndirectlyGettingPowered(int par1, int par2, int par3) Used to see if one of the blocks next to you or your block is getting power from a neighboring block.booleanisBlockNormalCube(int par1, int par2, int par3) Indicate if a material is a normal solid opaque cube.booleanisBlockNormalCubeDefault(int par1, int par2, int par3, boolean par4) // +++START EDIT+++ // ---END EDIT--- Checks if the block is a solid, normal cube.booleanisBlockOpaqueCube(int par1, int par2, int par3) Returns true if the block at the specified coordinates is an opaque cube.booleanisBlockPosActive(int i, int j, int k) intisBlockProvidingPowerTo(int par1, int par2, int par3, int par4) Is this block powering in the specified direction Args: x, y, z, directionbooleanisBlockRedstoneConductor(int x, int y, int z) Indicate if a block should conduct redstone powerbooleanisBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) Returns true if the given block will receive a scheduled tick in this tick.booleanisBoundingBoxBurning(Entity entity) Returns whether or not the given bounding box is on fire or notbooleanisChunkActive(int iChunkX, int iChunkZ) booleanChecks whether its daytime by seeing if the light subtracted from the skylight is less than 4booleanisMaterialInBB(AxisAlignedBB par1AxisAlignedBB, Material par2Material) Returns true if the given bounding box contains the given materialbooleanisPrecipitatingAtPos(int i, int k) booleanisPrecipitatingAtPos(int i, int j, int k) booleanReturns true if the current rain strength is greater than 0.2booleanisRainingAtPos(int i, int j, int k) booleanisSnowingAtPos(int i, int j, int k) booleanbooleanReturns true if the current thunder strength (weighted with the rain strength) is greater than 0.9booleanisUpdatePendingThisTickForBlock(int i, int j, int k, int iBlockID) Wrapper function for clarity: while ticks are being processed they are not still scheduled, but are in a separate list for this tick.booleanisUpdateScheduledForBlock(int i, int j, int k, int iBlockID) voidjoinEntityInSurroundings(Entity par1Entity) spwans an entity and loads surrounding chunksloadItemData(Class par1Class, String par2Str) 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 dataidvoidmarkBlockForRenderUpdate(int par1, int par2, int par3) On the client, re-renders this block.voidmarkBlockForUpdate(int par1, int par2, int par3) On the client, re-renders the block.voidmarkBlockRangeForRenderUpdate(int par1, int par2, int par3, int par4, int par5, int par6) On the client, re-renders all blocks in this range, inclusive.voidmarkBlocksDirtyVertical(int par1, int par2, int par3, int par4) marks a vertical line of blocks as dirtyvoidmarkTileEntityChunkModified(int par1, int par2, int par3, TileEntity par4TileEntity) Args: X, Y, Z, tile entity Marks the chunk the tile entity is in as modified.voidmarkTileEntityForDespawn(TileEntity par1TileEntity) adds tile entity to despawn list (renamed from markEntityForDespawn)voidprotected voidmoodSoundAndLightCheck(int par1, int par2, Chunk par3Chunk) mouseOverRayTrace(Vec3 startVec, Vec3 endVec) Ray tracing with consideration for blocks that extend past their vertical bounds, like with ground cover or weeds.newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) returns a new explosion.newExplosionNoFX(Entity par1Entity, double dPosX, double dPosY, double dPosZ, float fExplosionSize, boolean bCreatesFlames, boolean bDestroysBlocks) Copy of newExplosion() that suppresses the audio/visual effectsvoidnotifyBlockChange(int par1, int par2, int par3, int par4) The block type change and need to notify other systems Args: x, y, z, blockIDvoidnotifyBlockOfNeighborChange(int par1, int par2, int par3, int par4) Notifies a block that one of its neighbor change to the specified type Args: x, y, z, blockIDvoidnotifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4) Notifies neighboring blocks that this specified block changed Args: x, y, z, blockIDvoidnotifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4, int par5) Calls notifyBlockOfNeighborChange on adjacent blocks, except the one on the given side.voidnotifyNearbyAnimalsOfPlayerBlockAddOrRemove(EntityPlayer player, Block block, int i, int j, int k) protected voidonEntityAdded(Entity par1Entity) protected voidonEntityRemoved(Entity par1Entity) voidplayAuxSFX(int par1, int par2, int par3, int par4, int par5) See description for playAuxSFX.voidplayAuxSFXAtEntity(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) See description for playAuxSFX.voidplayRecord(String par1Str, int par2, int par3, int par4) Plays a record at the specified coordinates of the specified name.voidvoidplaySound(double par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) par8 is loudness, all pars passed to minecraftInstance.sndManager.playSoundvoidplaySoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) Plays a sound at the entity's position.voidplaySoundEffect(double par1, double par3, double par5, String par7Str, float par8, float par9) Play a sound effect.voidplaySoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) Plays sound to all near players except the player reference givenrayTraceBlocks_do_do(Vec3 startVec, Vec3 endVec, boolean bHitFluidSources, boolean bIgnoreNonMovementBlockingBlocks) voidremoveBlockTileEntity(int par1, int par2, int par3) Removes the TileEntity for a given block in X,Y,Z coordinatesvoidremoveEntity(Entity par1Entity) Schedule the entity for removal during the next tick.voidremovePlayerEntityDangerously(Entity par1Entity) Do NOT use this method to remove normal entities- use normal removeEntityvoidremoveWorldAccess(IWorldAccess par1IWorldAccess) Removes a worldAccess from the worldAccesses objectvoidscheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) Schedules a tick to a block with a delay (Most commonly the tick rate)voidscheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) Schedules a block update from the saved information in a chunk.voidscheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) voidIf on MP, sends a quitting packet.protected voidvoidsetAllowedSpawnTypes(boolean par1, boolean par2) Set which types of mobs are allowed to spawn (peaceful vs hostile).booleansetBlock(int par1, int par2, int par3, int par4) Sets a block and notifies relevant systems with the block change Args: x, y, z, blockIDbooleansetBlock(int par1, int par2, int par3, int par4, int par5, int par6) FCNOTE: Bit 1 notify neighbors.booleansetBlockAndMetadata(int i, int j, int k, int iBlockID, int iMetadata) booleansetBlockAndMetadataWithNotify(int i, int j, int k, int iBlockID, int iMetadata) booleansetBlockMetadata(int i, int j, int k, int iMetadata) booleansetBlockMetadataWithClient(int i, int j, int k, int iMetadata) booleansetBlockMetadataWithNotify(int i, int j, int k, int iMetadata) booleansetBlockMetadataWithNotify(int par1, int par2, int par3, int par4, int par5) FCNOTE: Bit 1 notify neighbors.booleanSetBlockMetadataWithNotify(int i, int j, int k, int iMetadata, int iNotifyBitField) Alias to avoid inconsistent naming between client and server Bit 1 notify neighbors.booleansetBlockMetadataWithNotifyNoClient(int i, int j, int k, int iMetadata) voidsetBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) Sets the TileEntity for a given block in X, Y, Z coordinatesbooleansetBlockToAir(int par1, int par2, int par3) Sets a block to 0 and notifies relevant systems with the block change Args: x, y, zbooleansetBlockWithNotify(int i, int j, int k, int iBlockID) abstract <T> voidsetData(DataEntry.WorldDataEntry<T> entry, T value) voidsetEntityState(Entity par1Entity, byte par2) sends a Packet 38 (Entity Status) to all tracked players of that entityvoidsetItemData(String par1Str, WorldSavedData par2WorldSavedData) Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same id.voidsetLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) Sets the light value either into the sky map or block map depending on if enumSkyBlock is set to sky or block.voidsetRainStrength(float par1) setRandomSeed(int par1, int par2, int par3) puts the World Random seed to a specific state dependant on the inputsvoidSets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.voidsetSpawnLocation(int par1, int par2, int par3) voidsetWorldTime(long par1) Sets the world time.booleanspawnEntityInWorld(Entity par1Entity) Called to place all entities as part of a worldvoidspawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) Spawns a particle.voidtick()Runs a single tick for the worldprotected voidplays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a playerbooleantickUpdates(boolean par1) Runs through the list of updates to run and ticks themvoidunloadEntities(List par1List) Adds a list of entities to be unloaded on the next pass of World.updateEntities()protected voidvoidupdateAllLightTypes(int par1, int par2, int par3) voidUpdates the flag that indicates whether or not all players in the world are sleeping.voidUpdates (and cleans up) entities and tile entitiesvoidupdateEntity(Entity par1Entity) Will update the entity in the world if the chunk the entity is in is currently loaded.voidupdateEntityWithOptionalForce(Entity par1Entity, boolean par2) Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update.voidupdateLightByType(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.src.IBlockAccess
editClass
-
Field Details
-
scheduledUpdatesAreImmediate
public boolean scheduledUpdatesAreImmediateboolean; if true updates scheduled by scheduleBlockUpdate happen immediately -
loadedEntityList
A list of all Entities in all currently-loaded chunks -
unloadedEntityList
-
loadedTileEntityList
A list of all TileEntities in all currently-loaded chunks -
playerEntities
Array list of players in the world. -
weatherEffects
a list of all the lightning entities -
skylightSubtracted
public int skylightSubtractedHow much light is subtracted from full daylight -
updateLCG
protected int updateLCGContains 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_MAGICmagic number used to generate fast random numbers for 3d distribution within a chunk- See Also:
-
prevRainingStrength
protected float prevRainingStrength -
rainingStrength
protected float rainingStrength -
prevThunderingStrength
protected float prevThunderingStrength -
thunderingStrength
protected float thunderingStrength -
lastLightningBolt
public int lastLightningBoltSet to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be unused. -
difficultySetting
public int difficultySettingOption > Difficulty setting (0 - 3) -
rand
RNG for World. -
provider
The WorldProvider instance that World uses. -
worldAccesses
-
chunkProvider
Handles chunk operations and caching -
saveHandler
-
worldInfo
holds information about a world (size on disk, time, spawn point, seed, ...) -
findingSpawnPoint
public boolean findingSpawnPointBoolean that is set to true when trying to find a spawn point -
mapStorage
-
villageCollectionObj
-
theProfiler
-
worldScoreboard
-
spawnHostileMobs
protected boolean spawnHostileMobsindicates if enemies are spawned or not -
spawnPeacefulMobs
protected boolean spawnPeacefulMobsA flag indicating whether we should spawn peaceful mobs. -
activeChunksCoordsMap
populated by chunks that are within the view distance (default 8 chunks) of any player, the original spawn, or any other chunk loader -
activeChunksCoordsList
list of same coords in m_activeChunksCoordsMap -
isRemote
public boolean isRemoteThis is set to true for client worlds, and false for server worlds. -
LOADED_CHUNKS_UPDATE_RANGE
public static final int LOADED_CHUNKS_UPDATE_RANGE- See Also:
-
-
Constructor Details
-
World
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler, ILogAgent par6ILogAgent) -
World
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent)
-
-
Method Details
-
getBiomeGenForCoords
Gets the biome for a given set of x/z coordinates- Specified by:
getBiomeGenForCoordsin interfaceIBlockAccess
-
getWorldChunkManager
-
createChunkProvider
Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? -
initialize
-
setSpawnLocation
public void setSpawnLocation()Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. -
getFirstUncoveredBlock
public int getFirstUncoveredBlock(int par1, int par2) Returns the block ID of the first block at this (x,z) location with air above it, searching from sea level upwards. -
getBlockId
public int getBlockId(int par1, int par2, int par3) Returns the block ID at coords x,y,z- Specified by:
getBlockIdin interfaceIBlockAccess
-
isAirBlock
public boolean isAirBlock(int par1, int par2, int par3) Returns true if the block at the specified coordinates is empty- Specified by:
isAirBlockin interfaceIBlockAccess
-
blockHasTileEntity
public boolean blockHasTileEntity(int par1, int par2, int par3) Checks if a block at a given position should have a tile entity. -
blockGetRenderType
public int blockGetRenderType(int par1, int par2, int par3) Returns the render type of the block at the given coordinate. -
blockExists
public boolean blockExists(int par1, int par2, int par3) Returns whether a block exists at world coordinates x, y, z -
doChunksNearChunkExist
public boolean doChunksNearChunkExist(int par1, int par2, int par3, int par4) Checks if any of the chunks within distance (argument 4) blocks of the given block exist -
checkChunksExist
public boolean checkChunksExist(int par1, int par2, int par3, int par4, int par5, int par6) Checks between a min and max all the chunks inbetween actually exist. Args: minX, minY, minZ, maxX, maxY, maxZ -
chunkExists
protected boolean chunkExists(int par1, int par2) Returns whether a chunk exists at chunk coordinates x, y -
getChunkFromBlockCoords
Returns a chunk looked up by block coordinates. Args: x, z -
getChunkFromChunkCoords
Returns back a chunk looked up by chunk coordinates Args: x, y -
setBlock
public boolean setBlock(int par1, int par2, int par3, int par4, int par5, int par6) FCNOTE: Bit 1 notify neighbors. Bit 2 sends change to clients. Bit 4 seems to prevent a render update when called on client -
getBlockMaterial
Returns the block's material.- Specified by:
getBlockMaterialin interfaceIBlockAccess
-
getBlockMetadata
public int getBlockMetadata(int par1, int par2, int par3) Returns the block metadata at coords x,y,z- Specified by:
getBlockMetadatain interfaceIBlockAccess
-
setBlockMetadataWithNotify
public boolean setBlockMetadataWithNotify(int par1, int par2, int par3, int par4, int par5) FCNOTE: Bit 1 notify neighbors. Bit 2 sends change to clients. Bit 4 seems to prevent a render update when called on client -
setBlockToAir
public boolean setBlockToAir(int par1, int par2, int par3) Sets a block to 0 and notifies relevant systems with the block change Args: x, y, z -
destroyBlock
public boolean destroyBlock(int par1, int par2, int par3, boolean par4) Destroys a block and optionally drops items. Args: X, Y, Z, dropItems -
setBlock
public boolean setBlock(int par1, int par2, int par3, int par4) Sets a block and notifies relevant systems with the block change Args: x, y, z, blockID -
markBlockForUpdate
public void markBlockForUpdate(int par1, int par2, int par3) On the client, re-renders the block. On the server, sends the block to the client (which will re-render it only if the ID or MD changes), including the tile entity description packet if applicable. Args: x, y, z -
notifyBlockChange
public void notifyBlockChange(int par1, int par2, int par3, int par4) The block type change and need to notify other systems Args: x, y, z, blockID -
markBlocksDirtyVertical
public void markBlocksDirtyVertical(int par1, int par2, int par3, int par4) marks a vertical line of blocks as dirty -
markBlockRangeForRenderUpdate
public void markBlockRangeForRenderUpdate(int par1, int par2, int par3, int par4, int par5, int par6) On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min z, max x, max y, max z -
notifyBlocksOfNeighborChange
public void notifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4) Notifies neighboring blocks that this specified block changed Args: x, y, z, blockID -
notifyBlocksOfNeighborChange
public void notifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4, int par5) Calls notifyBlockOfNeighborChange on adjacent blocks, except the one on the given side. Args: X, Y, Z, changingBlockID, side -
notifyBlockOfNeighborChange
public void notifyBlockOfNeighborChange(int par1, int par2, int par3, int par4) Notifies a block that one of its neighbor change to the specified type Args: x, y, z, blockID -
isBlockTickScheduledThisTick
public boolean isBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, blockID -
canBlockSeeTheSky
public boolean canBlockSeeTheSky(int par1, int par2, int par3) Checks if the specified block is able to see the sky -
getFullBlockLightValue
public int getFullBlockLightValue(int par1, int par2, int par3) Does the same as getBlockLightValue_do but without checking if its not a normal block -
getBlockLightValue
public int getBlockLightValue(int par1, int par2, int par3) Gets the light value of a block location -
getBlockLightValue_do
public int getBlockLightValue_do(int par1, int par2, int par3, boolean par4) Gets the light value of a block location. This is the actual function that gets the value and has a bool flag that indicates if its a half step block to get the maximum light value of a direct neighboring block (left, right, forward, back, and up) -
getHeightValue
public int getHeightValue(int par1, int par2) Returns the y coordinate with a block in it at this x, z coordinate -
getChunkHeightMapMinimum
public int getChunkHeightMapMinimum(int par1, int par2) Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: X, Z -
getSkyBlockTypeBrightness
Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. Brightness for SkyBlock.Block is yellowish and independent. -
getSavedLightValue
Returns saved light value without taking into account the time of day. Either looks in the sky light map or block light map based on the enumSkyBlock arg. -
setLightValue
Sets the light value either into the sky map or block map depending on if enumSkyBlock is set to sky or block. Args: enumSkyBlock, x, y, z, lightValue -
markBlockForRenderUpdate
public void markBlockForRenderUpdate(int par1, int par2, int par3) On the client, re-renders this block. On the server, does nothing. Used for lighting updates. -
getLightBrightnessForSkyBlocks
public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) Any Light rendered on a 1.8 Block goes through here- Specified by:
getLightBrightnessForSkyBlocksin interfaceIBlockAccess
-
getBrightness
public float getBrightness(int par1, int par2, int par3, int par4) - Specified by:
getBrightnessin interfaceIBlockAccess
-
getLightBrightness
public float getLightBrightness(int par1, int par2, int par3) Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values aren't linear for brightness). Args: x, y, z- Specified by:
getLightBrightnessin interfaceIBlockAccess
-
isDaytime
public boolean isDaytime()Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4 -
clip
Performs a raycast against all blocks in the world except liquids. -
clip
Performs a raycast against all blocks in the world, and optionally liquids. -
playSoundAtEntity
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 par1EntityPlayer, String par2Str, float par3, float par4) Plays sound to all near players except the player reference given -
playSoundEffect
public void playSoundEffect(double par1, double par3, double par5, String par7Str, float par8, float par9) 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 par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound -
playRecord
Plays a record at the specified coordinates of the specified name. Args: recordName, x, y, z -
spawnParticle
public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) Spawns a particle. Args particleName, x, y, z, velX, velY, velZ -
addWeatherEffect
adds a lightning bolt to the list of lightning bolts in this world. -
spawnEntityInWorld
Called to place all entities as part of a world -
onEntityAdded
-
onEntityRemoved
-
removeEntity
Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. -
removePlayerEntityDangerously
Do NOT use this method to remove normal entities- use normal removeEntity -
addWorldAccess
Adds a IWorldAccess to the list of worldAccesses -
removeWorldAccess
Removes a worldAccess from the worldAccesses object -
getCollidingBoundingBoxes
Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity, aabb -
getCollidingBlockBounds
calculates and returns a list of colliding bounding boxes within a given AABB -
calculateSkylightSubtracted
public int calculateSkylightSubtracted(float par1) Returns the amount of skylight subtracted for the current time -
getSunBrightness
public float getSunBrightness(float par1) Returns the sun brightness - checks time of day, rain and thunder -
getSkyColor
Calculates the color for the skybox -
getCelestialAngle
public float getCelestialAngle(float par1) 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 par1) Return getCelestialAngle()*2*PI -
getCloudColour
-
getFogColor
Returns vector(ish) with R/G/B for fog -
getPrecipitationHeight
public int getPrecipitationHeight(int par1, int par2) Gets the height to which rain/snow will fall. Calculates it if not already stored. -
getTopSolidOrLiquidBlock
public int getTopSolidOrLiquidBlock(int par1, int par2) Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z // +++START EDIT+++ FCNOTE: Despite name, actually returns the block ABOVE the top one, and does not count liquids // ---END EDIT--- -
getActualTopSolidOrLiquidBlockHeight
public int getActualTopSolidOrLiquidBlockHeight(int x, int z) -
getStarBrightness
public float getStarBrightness(float par1) How bright are stars in the sky -
scheduleBlockUpdate
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) Schedules a tick to a block with a delay (Most commonly the tick rate) -
scheduleBlockUpdateWithPriority
public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) -
scheduleBlockUpdateFromLoad
public void scheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) Schedules a block update from the saved information in a chunk. Called when the chunk is loaded. -
updateEntities
public void updateEntities()Updates (and cleans up) entities and tile entities -
addTileEntity
-
updateEntity
Will update the entity in the world if the chunk the entity is in is currently loaded. Args: entity -
updateEntityWithOptionalForce
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 // +++START EDIT+++ FCNOTE: 2nd parameter is more "bOnlyUpdateInLoadedChunks" rather than what is said above The "OptionalForce" in the function name refers to forcing the update, not a physical force // ---END EDIT--- -
checkNoEntityCollision
Returns true if there are no solid, live entities in the specified AxisAlignedBB -
checkNoEntityCollision
Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity -
checkBlockCollision
Returns true if there are any blocks in the region constrained by an AxisAlignedBB -
isAnyLiquid
Returns if any of the blocks within the aabb are liquids. Args: aabb -
isBoundingBoxBurning
Returns whether or not the given bounding box is on fire or not -
handleMaterialAcceleration
public boolean handleMaterialAcceleration(AxisAlignedBB par1AxisAlignedBB, Material par2Material, Entity par3Entity) handles the acceleration of an object whilst in water. Not sure if it is used elsewhere. -
isMaterialInBB
Returns true if the given bounding box contains the given material -
isAABBInMaterial
checks if the given AABB is in the material given. Used while swimming. -
createExplosion
public Explosion createExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9) Creates an explosion. Args: entity, x, y, z, strength -
newExplosion
public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) returns a new explosion. Does initiation (at time of writing Explosion is not finished) -
getBlockDensity
Gets the percentage of real blocks within a bounding box, along a specified vector. -
extinguishFire
public boolean extinguishFire(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5) If the block in the given direction of the given coordinate is fire, extinguish it. Args: Player, X,Y,Z, blockDirection -
getDebugLoadedEntities
This string is 'All: (number of loaded entities)' Viewable by press ing F3 -
getProviderName
Returns the name of the current chunk provider, by calling chunkprovider.makeString() -
getBlockTileEntity
Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists- Specified by:
getBlockTileEntityin interfaceIBlockAccess
-
setBlockTileEntity
Sets the TileEntity for a given block in X, Y, Z coordinates -
removeBlockTileEntity
public void removeBlockTileEntity(int par1, int par2, int par3) Removes the TileEntity for a given block in X,Y,Z coordinates -
markTileEntityForDespawn
adds tile entity to despawn list (renamed from markEntityForDespawn) -
isBlockOpaqueCube
public boolean isBlockOpaqueCube(int par1, int par2, int par3) Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z- Specified by:
isBlockOpaqueCubein interfaceIBlockAccess
-
isBlockNormalCube
public boolean isBlockNormalCube(int par1, int par2, int par3) Indicate if a material is a normal solid opaque cube.- Specified by:
isBlockNormalCubein interfaceIBlockAccess
-
canBlockSuffocateEntity
public boolean canBlockSuffocateEntity(int par1, int par2, int par3) -
isBlockFullCube
public boolean isBlockFullCube(int par1, int par2, int par3) -
isBlockNormalCubeDefault
public boolean isBlockNormalCubeDefault(int par1, int par2, int par3, boolean par4) // +++START EDIT+++ // ---END EDIT--- Checks if the block is a solid, normal cube. If the chunk does not exist, or is not loaded, it returns the boolean parameter. -
isBlockRedstoneConductor
public boolean isBlockRedstoneConductor(int x, int y, int z) Indicate if a block should conduct redstone power -
calculateInitialSkylight
public void calculateInitialSkylight()Called on construction of the World class to setup the initial skylight values -
setAllowedSpawnTypes
public void setAllowedSpawnTypes(boolean par1, boolean par2) Set which types of mobs are allowed to spawn (peaceful vs hostile). -
tick
public void tick()Runs a single tick for the world -
commandToggleDownfall
public void commandToggleDownfall() -
setActivePlayerChunksAndCheckLight
protected void setActivePlayerChunksAndCheckLight() -
moodSoundAndLightCheck
-
tickBlocksAndAmbiance
protected void tickBlocksAndAmbiance()plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a player -
isBlockFreezable
public boolean isBlockFreezable(int par1, int par2, int par3) checks to see if a given block is both water and is cold enough to freeze -
isBlockFreezableNaturally
public boolean isBlockFreezableNaturally(int par1, int par2, int par3) checks to see if a given block is both water and has at least one immediately adjacent non-water block -
canBlockFreeze
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) checks to see if a given block is both water, and cold enough to freeze - if the par4 boolean is set, this will only return true if there is a non-water block immediately adjacent to the specified block -
canSnowAt
public boolean canSnowAt(int x, int y, int z) Tests whether or not snow can be placed at a given location -
updateAllLightTypes
public void updateAllLightTypes(int par1, int par2, int par3) -
updateLightByType
-
tickUpdates
public boolean tickUpdates(boolean par1) Runs through the list of updates to run and ticks them -
getPendingBlockUpdates
-
getEntitiesWithinAABBExcludingEntity
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) Will get all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb -
getEntitiesWithinAABBExcludingEntity
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) -
getEntitiesWithinAABB
Returns all entities of the specified class type which intersect with the AABB. Args: entityClass, aabb -
selectEntitiesWithinAABB
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) -
findNearestEntityWithinAABB
public Entity findNearestEntityWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, Entity par3Entity) -
getEntityByID
Returns the Entity with the given ID, or null if it doesn't exist in this World. -
getLoadedEntityList
Accessor for world Loaded Entity List -
markTileEntityChunkModified
Args: X, Y, Z, tile entity Marks the chunk the tile entity is in as modified. This is essential as chunks that are not marked as modified may be rolled back when exiting the game. -
addLoadedEntities
// +++START EDIT+++ // ---END EDIT--- adds entities to the loaded entities list, and loads thier skins. -
unloadEntities
Adds a list of entities to be unloaded on the next pass of World.updateEntities() -
canPlaceEntityOnSide
public boolean canPlaceEntityOnSide(int par1, int par2, int par3, int par4, boolean par5, int par6, Entity par7Entity, ItemStack par8ItemStack) Returns true if the given Entity can be placed on the given side of the given block position. -
getPathEntityToEntity
public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) -
getEntityPathToXYZ
public PathEntity getEntityPathToXYZ(Entity par1Entity, int par2, int par3, int par4, float par5, boolean par6, boolean par7, boolean par8, boolean par9) -
isBlockProvidingPowerTo
public int isBlockProvidingPowerTo(int par1, int par2, int par3, int par4) Is this block powering in the specified direction Args: x, y, z, direction- Specified by:
isBlockProvidingPowerToin interfaceIBlockAccess
-
getBlockPowerInput
public int getBlockPowerInput(int par1, int par2, int par3) Returns the highest redstone signal strength powering the given block. Args: X, Y, Z. -
getIndirectPowerOutput
public boolean getIndirectPowerOutput(int par1, int par2, int par3, int par4) Returns the indirect signal strength being outputted by the given block in the *opposite* of the given direction. Args: X, Y, Z, direction -
getIndirectPowerLevelTo
public int getIndirectPowerLevelTo(int par1, int par2, int par3, int par4) Gets the power level from a certain block face. Args: x, y, z, direction -
isBlockIndirectlyGettingPowered
public boolean isBlockIndirectlyGettingPowered(int par1, int par2, int par3) Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by items like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z -
getStrongestIndirectPower
public int getStrongestIndirectPower(int par1, int par2, int par3) -
getClosestPlayerToEntity
Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored). Args: entity, dist -
getClosestPlayer
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 -
getClosestVulnerablePlayerToEntity
Returns the closest vulnerable player to this entity within the given radius, or null if none is found -
getClosestVulnerablePlayer
Returns the closest vulnerable player within the given radius, or null if none is found. -
getPlayerEntityByName
Find a player by name in this world. -
sendQuittingDisconnectingPacket
public void sendQuittingDisconnectingPacket()If on MP, sends a quitting packet. -
checkSessionLock
Checks whether the session lock file was modified by another process- Throws:
MinecraftException
-
func_82738_a
public void func_82738_a(long par1) -
getSeed
public long getSeed()Retrieve the world seed from level.dat -
getTotalWorldTime
public long getTotalWorldTime() -
getWorldTime
public long getWorldTime() -
setWorldTime
public void setWorldTime(long par1) Sets the world time. -
getSpawnPoint
Returns the coordinates of the spawn point -
setSpawnLocation
public void setSpawnLocation(int par1, int par2, int par3) -
joinEntityInSurroundings
spwans an entity and loads surrounding chunks -
canMineBlock
Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. -
setEntityState
sends a Packet 38 (Entity Status) to all tracked players of that entity -
getChunkProvider
gets the IChunkProvider this world uses. -
addBlockEvent
public void addBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will have its onBlockEvent handler called with the given parameters. Args: X,Y,Z, BlockID, EventID, EventParameter -
getSaveHandler
Returns this world's current save handler -
getWorldInfo
Gets the World's WorldInfo instance -
getGameRules
Gets the GameRules instance. -
updateAllPlayersSleepingFlag
public void updateAllPlayersSleepingFlag()Updates the flag that indicates whether or not all players in the world are sleeping. -
getWeightedThunderStrength
public float getWeightedThunderStrength(float par1) -
getRainStrength
public float getRainStrength(float par1) Not sure about this actually. Reverting this one myself. -
setRainStrength
public void setRainStrength(float par1) -
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 -
canLightningStrikeAt
public boolean canLightningStrikeAt(int par1, int par2, int par3) FCNOTE: Terribly named. Was actually whether a specific block is currently being rained on Deprecated through sending message to avoid modifying vanilla classes that use it while still ensuring that it isn't actually called. -
isBlockHighHumidity
public boolean isBlockHighHumidity(int par1, int par2, int par3) Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high -
setItemData
Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same id. -
loadItemData
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
Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the 'idcounts' file. -
func_82739_e
public void func_82739_e(int par1, int par2, int par3, int par4, int par5) FCNOTE: Sends an auxSFX to all players, regardless of distance to the effect. Good for stuff like long range wolf howls and thunder claps. -
playAuxSFX
public void playAuxSFX(int par1, int par2, int par3, int par4, int par5) See description for playAuxSFX. -
playAuxSFXAtEntity
public void playAuxSFXAtEntity(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) See description for playAuxSFX. -
getHeight
public int getHeight()Returns current world height.- Specified by:
getHeightin interfaceIBlockAccess
-
getActualHeight
public int getActualHeight()Returns current world height. -
getMinecartSoundUpdater
-
setRandomSeed
puts the World Random seed to a specific state dependant on the inputs -
findClosestStructure
Returns the location of the closest structure of the specified type. If not found returns null. -
findClosestStructureAll
public List<ChunkPosition> findClosestStructureAll(String par1Str, int par2, int par3, int par4, int chunkSearchRadius, int minAbandonment) Returns the location of the closest structure of the specified type. If not found returns null. -
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
Adds some basic stats of the world to the given crash report. -
destroyBlockInWorldPartially
public void destroyBlockInWorldPartially(int par1, int par2, int par3, int par4, int par5) Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed value -
getWorldVec3Pool
Return the Vec3Pool object for this world.- Specified by:
getWorldVec3Poolin interfaceIBlockAccess
-
getCurrentDate
returns a calendar object containing the current date -
func_92088_a
public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) -
getScoreboard
-
func_96440_m
public void func_96440_m(int par1, int par2, int par3, int par4) -
getWorldLogAgent
-
installationIntegrityTest
public static boolean installationIntegrityTest() -
modSpecificTick
public void modSpecificTick() -
isUpdateScheduledForBlock
public boolean isUpdateScheduledForBlock(int i, int j, int k, int iBlockID) -
isUpdatePendingThisTickForBlock
public boolean isUpdatePendingThisTickForBlock(int i, int j, int k, int iBlockID) Wrapper function for clarity: while ticks are being processed they are not still scheduled, but are in a separate list for this tick. -
setBlockAndMetadataWithNotify
public boolean setBlockAndMetadataWithNotify(int i, int j, int k, int iBlockID, int iMetadata) -
setBlockWithNotify
public boolean setBlockWithNotify(int i, int j, int k, int iBlockID) -
SetBlockMetadataWithNotify
public boolean SetBlockMetadataWithNotify(int i, int j, int k, int iMetadata, int iNotifyBitField) Alias to avoid inconsistent naming between client and server Bit 1 notify neighbors. Bit 2 sends change to clients. Bit 4 seems to prevent a render update when called on client -
setBlockMetadata
public boolean setBlockMetadata(int i, int j, int k, int iMetadata) -
setBlockMetadataWithNotify
public boolean setBlockMetadataWithNotify(int i, int j, int k, int iMetadata) -
setBlockMetadataWithClient
public boolean setBlockMetadataWithClient(int i, int j, int k, int iMetadata) -
setBlockMetadataWithNotifyNoClient
public boolean setBlockMetadataWithNotifyNoClient(int i, int j, int k, int iMetadata) -
setBlockAndMetadata
public boolean setBlockAndMetadata(int i, int j, int k, int iBlockID, int iMetadata) -
isBlockGettingPowered
public boolean isBlockGettingPowered(int i, int j, int k) -
rayTraceBlocks_do_do
public MovingObjectPosition rayTraceBlocks_do_do(Vec3 startVec, Vec3 endVec, boolean bHitFluidSources, boolean bIgnoreNonMovementBlockingBlocks) -
mouseOverRayTrace
Ray tracing with consideration for blocks that extend past their vertical bounds, like with ground cover or weeds. Should only be used for mouse over at it can result in funky collision resolution. -
checkLocationForMouseOverRayTrace
public MovingObjectPosition checkLocationForMouseOverRayTrace(int i, int j, int k, Vec3 startVec, Vec3 endVec) -
playSound
public void playSound(double par1, double par3, double par5, String par7Str, float par8, float par9) -
getClosestEntityMatchingCriteriaWithinRange
public Entity getClosestEntityMatchingCriteriaWithinRange(double dSourcePosX, double dSourcePosY, double dSourcePosZ, double dRange, ClosestEntitySelectionCriteria criteria) -
countEntitiesThatApplyToSpawnCap
-
getNumEntitiesThatApplyToSquidPossessionCap
public int getNumEntitiesThatApplyToSquidPossessionCap() -
notifyNearbyAnimalsOfPlayerBlockAddOrRemove
public void notifyNearbyAnimalsOfPlayerBlockAddOrRemove(EntityPlayer player, Block block, int i, int j, int k) -
getBlockNaturalLightValue
public int getBlockNaturalLightValue(int i, int j, int k) -
getBlockNaturalLightValueMaximum
public int getBlockNaturalLightValueMaximum(int i, int j, int k) -
getNaturalLightBrightness
public float getNaturalLightBrightness(int i, int j, int k) -
getBlockLightValueNoSky
public int getBlockLightValueNoSky(int x, int y, int z) -
doesBlockHaveSolidTopSurface
public boolean doesBlockHaveSolidTopSurface(int i, int j, int k) Description copied from interface:IBlockAccessReturns true if the block at the given coordinate has a solid (buildable) top surface.- Specified by:
doesBlockHaveSolidTopSurfacein interfaceIBlockAccess
-
computeOverworldSunBrightnessWithMoonPhases
public float computeOverworldSunBrightnessWithMoonPhases() -
isTheEndNigh
public boolean isTheEndNigh() -
getData
-
setData
-
getAmbientBeaconEffectAtLocation
-
newExplosionNoFX
public Explosion newExplosionNoFX(Entity par1Entity, double dPosX, double dPosY, double dPosZ, float fExplosionSize, boolean bCreatesFlames, boolean bDestroysBlocks) Copy of newExplosion() that suppresses the audio/visual effects -
getClampedViewDistanceInChunks
public int getClampedViewDistanceInChunks()The "view distance" is actually the range at which chunks are loaded, specified as a vanilla server parameter (default is 10 chunks). -
getMobSpawnRangeInChunks
public int getMobSpawnRangeInChunks() -
getActiveChunkRangeInChunks
public int getActiveChunkRangeInChunks()"Active" chunks handle stuff like random block updates (grass growing, etc.) and precipitation -
updateActiveChunkMap
protected void updateActiveChunkMap() -
addEntityToActiveChunkMap
-
addAreaAroundChunkToActiveChunkMap
protected void addAreaAroundChunkToActiveChunkMap(int iChunkX, int iChunkZ) -
clearActiveChunkMap
protected void clearActiveChunkMap() -
addToActiveChunkMap
protected void addToActiveChunkMap(int iChunkX, int iChunkZ) -
isChunkActive
public boolean isChunkActive(int iChunkX, int iChunkZ) -
isBlockPosActive
public boolean isBlockPosActive(int i, int j, int k) -
getActiveChunksCoordsList
-
updateWeather
protected void updateWeather() -
isRainingAtPos
public boolean isRainingAtPos(int i, int j, int k) -
isSnowingAtPos
public boolean isSnowingAtPos(int i, int j, int k) -
isPrecipitatingAtPos
public boolean isPrecipitatingAtPos(int i, int j, int k) -
getLocationTensionFactor
public float getLocationTensionFactor(double par1, double par3, double par5) returns a float value that can be used to determine how likely something is to go awry in the area. It increases based on how long the player is within the vicinity, the lunar phase, and game difficulty. The value can be up to 1.5 on the highest difficulty, 1.0 otherwise. -
getTensionFactorForBlock
public float getTensionFactorForBlock(int par1, int par2, int par3) returns a float value that can be used to determine how likely something is to go awry in the area. It increases based on how long the player is within the vicinity, the lunar phase, and game difficulty. The value can be up to 1.5 on the highest difficulty, 1.0 otherwise. -
isPrecipitatingAtPos
public boolean isPrecipitatingAtPos(int i, int k) -
canLightningStrikeAtPos
public boolean canLightningStrikeAtPos(int i, int j, int k) -
getModifiedPlayerTargetingDistance
-
getDifficultyParameter
-