public abstract class World extends java.lang.Object implements IBlockAccess, ICapabilityProvider
Modifier and Type | Field and Description |
---|---|
boolean |
captureBlockSnapshots |
java.util.ArrayList<BlockSnapshot> |
capturedBlockSnapshots |
protected IChunkProvider |
chunkProvider
Handles chunk operations and caching
|
protected int |
DIST_HASH_MAGIC
magic number used to generate fast random numbers for 3d distribution within a chunk
|
protected IntHashMap<Entity> |
entitiesById |
protected java.util.List<IWorldEventListener> |
eventListeners |
protected boolean |
findingSpawnPoint
if set, this flag forces a request to load a chunk to load the chunk rather than defaulting to the world's
chunkprovider's dummy if possible
|
boolean |
isRemote
True if the world is a 'slave' client; changes will not be saved or propagated from this world.
|
java.util.List<Entity> |
loadedEntityList
A list of all Entities in all currently-loaded chunks
|
java.util.List<TileEntity> |
loadedTileEntityList
A list of the loaded tile entities in the world
|
protected LootTableManager |
lootTable |
protected MapStorage |
mapStorage |
static double |
MAX_ENTITY_RADIUS
Used in the getEntitiesWithinAABB functions to expand the search area for entities.
|
protected PathWorldListener |
pathListener |
protected MapStorage |
perWorldStorage |
java.util.List<EntityPlayer> |
playerEntities
Array list of players in the world.
|
float |
prevRainingStrength |
float |
prevThunderingStrength |
WorldProvider |
provider
The WorldProvider instance that World uses.
|
float |
rainingStrength |
java.util.Random |
rand
RNG for World.
|
boolean |
restoringBlockSnapshots |
protected ISaveHandler |
saveHandler |
protected boolean |
scheduledUpdatesAreImmediate
boolean; if true updates scheduled by scheduleBlockUpdate happen immediately
|
protected boolean |
spawnHostileMobs
indicates if enemies are spawned or not
|
protected boolean |
spawnPeacefulMobs
A flag indicating whether we should spawn peaceful mobs.
|
Profiler |
theProfiler |
float |
thunderingStrength |
java.util.List<TileEntity> |
tickableTileEntities |
protected java.util.List<Entity> |
unloadedEntityList |
protected int |
updateLCG
Contains the current Linear Congruential Generator seed for block updates.
|
VillageCollection |
villageCollectionObj |
java.util.List<Entity> |
weatherEffects
a list of all the lightning entities
|
protected WorldInfo |
worldInfo
holds information about a world (size on disk, time, spawn point, seed, ...)
|
protected Scoreboard |
worldScoreboard |
Modifier | Constructor and Description |
---|---|
protected |
World(ISaveHandler saveHandlerIn,
WorldInfo info,
WorldProvider providerIn,
Profiler profilerIn,
boolean client) |
Modifier and Type | Method and Description |
---|---|
void |
addBlockEvent(BlockPos pos,
Block blockIn,
int eventID,
int eventParam) |
void |
addEventListener(IWorldEventListener listener)
Add a world event listener
|
void |
addTileEntities(java.util.Collection<TileEntity> tileEntityCollection) |
boolean |
addTileEntity(TileEntity tile) |
boolean |
addWeatherEffect(Entity entityIn)
adds a lightning bolt to the list of lightning bolts in this world.
|
CrashReportCategory |
addWorldInfoToCrashReport(CrashReport report)
Adds some basic stats of the world to the given crash report.
|
void |
calculateInitialSkylight()
Called on construction of the World class to setup the initial skylight values
|
protected void |
calculateInitialWeather()
Called from World constructor to set rainingStrength and thunderingStrength
|
void |
calculateInitialWeatherBody() |
int |
calculateSkylightSubtracted(float partialTicks)
Returns the amount of skylight subtracted for the current time
|
boolean |
canBlockFreeze(BlockPos pos,
boolean noWaterAdj)
Checks to see if a given block is both water and cold enough to freeze.
|
boolean |
canBlockFreezeBody(BlockPos pos,
boolean noWaterAdj) |
boolean |
canBlockFreezeNoWater(BlockPos pos) |
boolean |
canBlockFreezeWater(BlockPos pos) |
boolean |
canBlockSeeSky(BlockPos pos) |
boolean |
canMineBlockBody(EntityPlayer player,
BlockPos pos) |
boolean |
canSeeSky(BlockPos pos) |
boolean |
canSnowAt(BlockPos pos,
boolean checkLight)
Checks to see if a given block can accumulate snow from it snowing
|
boolean |
canSnowAtBody(BlockPos pos,
boolean checkLight) |
boolean |
checkBlockCollision(AxisAlignedBB bb)
Returns true if there are any blocks in the region constrained by an AxisAlignedBB
|
boolean |
checkLight(BlockPos pos) |
boolean |
checkLightFor(EnumSkyBlock lightType,
BlockPos pos) |
boolean |
checkNoEntityCollision(AxisAlignedBB bb)
Returns true if there are no solid, live entities in the specified AxisAlignedBB
|
boolean |
checkNoEntityCollision(AxisAlignedBB bb,
Entity entityIn)
Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity
|
void |
checkSessionLock()
Checks whether the session lock file was modified by another process
|
boolean |
collidesWithAnyBlock(AxisAlignedBB bbox)
Returns true if the given bbox collides with any block.
|
boolean |
containsAnyLiquid(AxisAlignedBB bb)
Checks if any of the blocks within the aabb are liquids.
|
int |
countEntities(java.lang.Class<?> entityType)
Counts how many entities of an entity class exist in the world.
|
int |
countEntities(EnumCreatureType type,
boolean forSpawnCount)
Returns a count of entities that classify themselves as the specified creature type.
|
protected abstract IChunkProvider |
createChunkProvider()
Creates the chunk provider for this world.
|
Explosion |
createExplosion(Entity entityIn,
double x,
double y,
double z,
float strength,
boolean isSmoking)
Creates an explosion in the world.
|
boolean |
destroyBlock(BlockPos pos,
boolean dropBlock)
Sets a block to air, but also plays the sound and particles and can spawn drops
|
boolean |
extinguishFire(EntityPlayer player,
BlockPos pos,
EnumFacing side)
Attempts to extinguish a fire
|
<T extends Entity> |
findNearestEntityWithinAABB(java.lang.Class<? extends T> entityType,
AxisAlignedBB aabb,
T closestTo) |
BlockPos |
findNearestStructure(java.lang.String p_190528_1_,
BlockPos p_190528_2_,
boolean p_190528_3_) |
boolean |
func_191503_g(Entity p_191503_1_) |
int |
getActualHeight()
Returns current world height.
|
Biome |
getBiome(BlockPos pos) |
Biome |
getBiomeForCoordsBody(BlockPos pos) |
BiomeProvider |
getBiomeProvider() |
float |
getBlockDensity(Vec3d vec,
AxisAlignedBB bb)
Gets the percentage of real blocks within within a bounding box, along a specified vector.
|
int |
getBlockLightOpacity(BlockPos pos)
Readded as it was removed, very useful helper function
|
IBlockState |
getBlockState(BlockPos pos) |
<T> T |
getCapability(Capability<T> capability,
EnumFacing facing)
Retrieves the handler for the capability requested on the specific side.
|
float |
getCelestialAngle(float partialTicks)
calls calculateCelestialAngle
|
float |
getCelestialAngleRadians(float partialTicks)
Return getCelestialAngle()*2*PI
|
Chunk |
getChunkFromBlockCoords(BlockPos pos) |
Chunk |
getChunkFromChunkCoords(int chunkX,
int chunkZ)
Gets the chunk at the specified location.
|
IChunkProvider |
getChunkProvider()
gets the world's chunk provider
|
int |
getChunksLowestHorizon(int x,
int z)
Deprecated.
|
EntityPlayer |
getClosestPlayer(double x,
double y,
double z,
double p_190525_7_,
<any> p_190525_9_) |
EntityPlayer |
getClosestPlayer(double posX,
double posY,
double posZ,
double distance,
boolean spectator) |
EntityPlayer |
getClosestPlayerToEntity(Entity entityIn,
double distance)
Gets the closest player to the entity within the specified distance.
|
Vec3d |
getCloudColorBody(float partialTicks) |
Vec3d |
getCloudColour(float partialTicks) |
java.util.List<AxisAlignedBB> |
getCollisionBoxes(Entity entityIn,
AxisAlignedBB aabb)
Gets a list of bounding boxes that intersect with the provided AABB.
|
int |
getCombinedLight(BlockPos pos,
int lightValue) |
java.util.Calendar |
getCurrentDate()
returns a calendar object containing the current date
|
float |
getCurrentMoonPhaseFactor()
gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25
|
float |
getCurrentMoonPhaseFactorBody() |
java.lang.String |
getDebugLoadedEntities()
This string is 'All: (number of loaded entities)' Viewable by press ing F3
|
EnumDifficulty |
getDifficulty() |
DifficultyInstance |
getDifficultyForLocation(BlockPos pos) |
<T extends Entity> |
getEntities(java.lang.Class<? extends T> entityType,
<any> filter) |
java.util.List<Entity> |
getEntitiesInAABBexcluding(Entity entityIn,
AxisAlignedBB boundingBox,
<any> predicate)
Gets all entities within the specified AABB excluding the one passed into it.
|
<T extends Entity> |
getEntitiesWithinAABB(java.lang.Class<? extends T> classEntity,
AxisAlignedBB bb)
Gets all entities of the specified class type which intersect with the AABB.
|
<T extends Entity> |
getEntitiesWithinAABB(java.lang.Class<? extends T> clazz,
AxisAlignedBB aabb,
<any> filter) |
java.util.List<Entity> |
getEntitiesWithinAABBExcludingEntity(Entity entityIn,
AxisAlignedBB bb)
Will get all entities within the specified AABB excluding the one passed into it.
|
Entity |
getEntityByID(int id)
Returns the Entity with the given ID, or null if it doesn't exist in this World.
|
Vec3d |
getFogColor(float partialTicks)
Returns vector(ish) with R/G/B for fog
|
GameRules |
getGameRules()
Gets the GameRules instance.
|
IBlockState |
getGroundAboveSeaLevel(BlockPos pos) |
int |
getHeight()
Returns maximum world height.
|
BlockPos |
getHeight(BlockPos pos)
Returns the position at this x, z coordinate in the chunk with y set to the value from the height map.
|
int |
getHeight(int x,
int z)
Returns, from the height map, the height of the highest block at this x and z coordinate.
|
double |
getHorizon()
Returns horizon height for use in rendering the sky.
|
int |
getLastLightningBolt() |
int |
getLight(BlockPos pos) |
int |
getLight(BlockPos pos,
boolean checkNeighbors) |
float |
getLightBrightness(BlockPos pos) |
int |
getLightFor(EnumSkyBlock type,
BlockPos pos) |
int |
getLightFromNeighbors(BlockPos pos) |
int |
getLightFromNeighborsFor(EnumSkyBlock type,
BlockPos pos) |
java.util.List<Entity> |
getLoadedEntityList()
Accessor for world Loaded Entity List
|
LootTableManager |
getLootTableManager() |
MapStorage |
getMapStorage() |
MinecraftServer |
getMinecraftServer() |
int |
getMoonPhase() |
EntityPlayer |
getNearestAttackablePlayer(BlockPos pos,
double maxXZDistance,
double maxYDistance) |
EntityPlayer |
getNearestAttackablePlayer(double posX,
double posY,
double posZ,
double maxXZDistance,
double maxYDistance,
<any> playerToDouble,
<any> p_184150_12_) |
EntityPlayer |
getNearestAttackablePlayer(Entity entityIn,
double maxXZDistance,
double maxYDistance) |
EntityPlayer |
getNearestPlayerNotCreative(Entity entityIn,
double distance) |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(Chunk chunkIn,
boolean p_72920_2_) |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(StructureBoundingBox structureBB,
boolean p_175712_2_) |
java.util.Iterator<Chunk> |
getPersistentChunkIterable(java.util.Iterator<Chunk> chunkIterator) |
<any> |
getPersistentChunks()
Get the persistent chunks for this world
|
MapStorage |
getPerWorldStorage() |
EntityPlayer |
getPlayerEntityByName(java.lang.String name)
Find a player by name in this world.
|
EntityPlayer |
getPlayerEntityByUUID(java.util.UUID uuid) |
<T extends Entity> |
getPlayers(java.lang.Class<? extends T> playerType,
<any> filter) |
BlockPos |
getPrecipitationHeight(BlockPos pos) |
java.lang.String |
getProviderName()
Returns the name of the current chunk provider, by calling chunkprovider.makeString()
|
float |
getRainStrength(float delta)
Returns rain strength.
|
int |
getRedstonePower(BlockPos pos,
EnumFacing facing) |
ISaveHandler |
getSaveHandler()
Returns this world's current save handler
|
Scoreboard |
getScoreboard() |
int |
getSeaLevel() |
long |
getSeed()
gets the random world seed
|
Vec3d |
getSkyColor(Entity entityIn,
float partialTicks)
Calculates the color for the skybox
|
Vec3d |
getSkyColorBody(Entity entityIn,
float partialTicks) |
int |
getSkylightSubtracted() |
BlockPos |
getSpawnPoint()
Gets the spawn point in the world
|
float |
getStarBrightness(float partialTicks)
How bright are stars in the sky
|
float |
getStarBrightnessBody(float partialTicks) |
int |
getStrongPower(BlockPos pos)
Returns the single highest strong power out of all directions using getStrongPower(BlockPos, EnumFacing)
|
int |
getStrongPower(BlockPos pos,
EnumFacing direction) |
float |
getSunBrightness(float partialTicks)
Returns the sun brightness - checks time of day, rain and thunder
|
float |
getSunBrightnessBody(float partialTicks) |
float |
getSunBrightnessFactor(float partialTicks)
The current sun brightness factor for this dimension.
|
float |
getThunderStrength(float delta) |
TileEntity |
getTileEntity(BlockPos pos) |
BlockPos |
getTopSolidOrLiquidBlock(BlockPos pos)
Finds the highest block on the x and z coordinate that is solid or liquid, and returns its y coord.
|
long |
getTotalWorldTime() |
int |
getUniqueDataId(java.lang.String key)
Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the
'idcounts' file.
|
VillageCollection |
getVillageCollection() |
WorldBorder |
getWorldBorder() |
WorldInfo |
getWorldInfo()
Returns the world's WorldInfo object
|
long |
getWorldTime() |
WorldType |
getWorldType() |
boolean |
handleMaterialAcceleration(AxisAlignedBB bb,
Material materialIn,
Entity entityIn)
handles the acceleration of an object whilst in water.
|
boolean |
hasCapability(Capability<?> capability,
EnumFacing facing)
Determines if this object has support for the capability in question on the specific side.
|
void |
immediateBlockTick(BlockPos pos,
IBlockState state,
java.util.Random random) |
World |
init() |
protected void |
initCapabilities() |
void |
initialize(WorldSettings settings) |
boolean |
isAirBlock(BlockPos pos)
Checks to see if an air block exists at the provided location.
|
boolean |
isAnyPlayerWithinRangeAt(double x,
double y,
double z,
double range) |
boolean |
isAreaLoaded(BlockPos from,
BlockPos to) |
boolean |
isAreaLoaded(BlockPos from,
BlockPos to,
boolean allowEmpty) |
boolean |
isAreaLoaded(BlockPos center,
int radius) |
boolean |
isAreaLoaded(BlockPos center,
int radius,
boolean allowEmpty) |
boolean |
isAreaLoaded(StructureBoundingBox box) |
boolean |
isAreaLoaded(StructureBoundingBox box,
boolean allowEmpty) |
boolean |
isBlockFullCube(BlockPos pos) |
int |
isBlockIndirectlyGettingPowered(BlockPos pos)
Checks if the specified block or its neighbors are powered by a neighboring block.
|
boolean |
isBlockinHighHumidity(BlockPos pos) |
boolean |
isBlockLoaded(BlockPos pos) |
boolean |
isBlockLoaded(BlockPos pos,
boolean allowEmpty) |
boolean |
isBlockModifiable(EntityPlayer player,
BlockPos pos) |
boolean |
isBlockNormalCube(BlockPos pos,
boolean _default)
Checks if a block's material is opaque, and that it takes up a full cube
|
boolean |
isBlockPowered(BlockPos pos) |
boolean |
isBlockTickPending(BlockPos pos,
Block blockType) |
boolean |
isChunkGeneratedAt(int x,
int z) |
protected abstract boolean |
isChunkLoaded(int x,
int z,
boolean allowEmpty) |
boolean |
isDaytime()
Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4
|
boolean |
isFlammableWithin(AxisAlignedBB bb) |
boolean |
isMaterialInBB(AxisAlignedBB bb,
Material materialIn)
Returns true if the given bounding box contains the given material
|
boolean |
isOutsideBuildHeight(BlockPos pos) |
boolean |
isRaining()
Returns true if the current rain strength is greater than 0.2
|
boolean |
isRainingAt(BlockPos strikePosition)
Check if precipitation is currently happening at a position
|
boolean |
isSidePowered(BlockPos pos,
EnumFacing side) |
boolean |
isSideSolid(BlockPos pos,
EnumFacing side)
Determine if the given block is considered solid on the
specified side.
|
boolean |
isSideSolid(BlockPos pos,
EnumFacing side,
boolean _default)
Determine if the given block is considered solid on the
specified side.
|
boolean |
isSpawnChunk(int x,
int z)
Returns true if the chunk is located near the spawn point
|
boolean |
isThundering()
Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9
|
boolean |
isUpdateScheduled(BlockPos pos,
Block blk)
Returns true if the identified block is scheduled to be updated.
|
boolean |
isValid(BlockPos pos)
Check if the given BlockPos has valid coordinates
|
void |
joinEntityInSurroundings(Entity entityIn)
spwans an entity and loads surrounding chunks
|
WorldSavedData |
loadData(java.lang.Class<? extends WorldSavedData> clazz,
java.lang.String dataID)
Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating
the given Class, or returns null if none such file exists.
|
void |
loadEntities(java.util.Collection<Entity> entityCollection) |
void |
makeFireworks(double x,
double y,
double z,
double motionX,
double motionY,
double motionZ,
NBTTagCompound compund) |
void |
markAndNotifyBlock(BlockPos pos,
Chunk chunk,
IBlockState iblockstate,
IBlockState newState,
int flags) |
void |
markBlockRangeForRenderUpdate(BlockPos rangeMin,
BlockPos rangeMax) |
void |
markBlockRangeForRenderUpdate(int x1,
int y1,
int z1,
int x2,
int y2,
int z2)
Notifies all listening IWorldEventListeners of an update within the given bounds.
|
void |
markBlocksDirtyVertical(int x1,
int z1,
int x2,
int z2)
marks a vertical line of blocks as dirty
|
void |
markChunkDirty(BlockPos pos,
TileEntity unusedTileEntity) |
void |
markTileEntityForRemoval(TileEntity tileEntityIn)
Adds the specified TileEntity to the pending removal list.
|
boolean |
mayPlace(Block p_190527_1_,
BlockPos p_190527_2_,
boolean p_190527_3_,
EnumFacing p_190527_4_,
Entity p_190527_5_) |
void |
neighborChanged(BlockPos pos,
Block p_190524_2_,
BlockPos p_190524_3_) |
Explosion |
newExplosion(Entity entityIn,
double x,
double y,
double z,
float strength,
boolean isFlaming,
boolean isSmoking)
returns a new explosion.
|
void |
notifyBlockUpdate(BlockPos pos,
IBlockState oldState,
IBlockState newState,
int flags) |
void |
notifyLightSet(BlockPos pos) |
void |
notifyNeighborsOfStateChange(BlockPos pos,
Block blockType,
boolean updateObservers) |
void |
notifyNeighborsOfStateExcept(BlockPos pos,
Block blockType,
EnumFacing skipSide) |
void |
notifyNeighborsRespectDebug(BlockPos pos,
Block blockType,
boolean p_175722_3_) |
void |
observedNeighborChanged(BlockPos pos,
Block p_190529_2_,
BlockPos p_190529_3_) |
void |
onEntityAdded(Entity entityIn) |
void |
onEntityRemoved(Entity entityIn) |
void |
playBroadcastSound(int id,
BlockPos pos,
int data) |
void |
playEvent(EntityPlayer player,
int type,
BlockPos pos,
int data) |
void |
playEvent(int type,
BlockPos pos,
int data) |
protected void |
playMoodSoundAndCheckLight(int p_147467_1_,
int p_147467_2_,
Chunk chunkIn) |
void |
playRecord(BlockPos blockPositionIn,
SoundEvent soundEventIn) |
void |
playSound(double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch,
boolean distanceDelay) |
void |
playSound(EntityPlayer player,
BlockPos pos,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch)
Plays the specified sound for a player at the center of the given block position.
|
void |
playSound(EntityPlayer player,
double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch) |
RayTraceResult |
rayTraceBlocks(Vec3d start,
Vec3d end)
ray traces all blocks, including non-collideable ones
|
RayTraceResult |
rayTraceBlocks(Vec3d start,
Vec3d end,
boolean stopOnLiquid) |
RayTraceResult |
rayTraceBlocks(Vec3d vec31,
Vec3d vec32,
boolean stopOnLiquid,
boolean ignoreBlockWithoutBoundingBox,
boolean returnLastUncollidableBlock)
Performs a raycast against all blocks in the world.
|
void |
removeEntity(Entity entityIn)
Schedule the entity for removal during the next tick.
|
void |
removeEntityDangerously(Entity entityIn)
Do NOT use this method to remove normal entities- use normal removeEntity
|
void |
removeEventListener(IWorldEventListener listener)
Remove a world event listener
|
void |
removeTileEntity(BlockPos pos) |
void |
scheduleBlockUpdate(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
scheduleUpdate(BlockPos pos,
Block blockIn,
int delay) |
void |
sendBlockBreakProgress(int breakerId,
BlockPos pos,
int progress) |
void |
sendPacketToServer(Packet<?> packetIn) |
void |
sendQuittingDisconnectingPacket()
If on MP, sends a quitting packet.
|
void |
setAllowedSpawnTypes(boolean hostile,
boolean peaceful)
first boolean for hostile mobs and second for peaceful mobs
|
boolean |
setBlockState(BlockPos pos,
IBlockState state)
Convenience method to update the block on both the client and server
|
boolean |
setBlockState(BlockPos pos,
IBlockState newState,
int flags)
Sets the block state at a given location.
|
boolean |
setBlockToAir(BlockPos pos) |
void |
setData(java.lang.String dataID,
WorldSavedData worldSavedDataIn)
Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same
id.
|
void |
setEntityState(Entity entityIn,
byte state)
sends a Packet 38 (Entity Status) to all tracked players of that entity
|
void |
setInitialSpawnLocation()
Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
|
void |
setLastLightningBolt(int lastLightningBoltIn) |
void |
setLightFor(EnumSkyBlock type,
BlockPos pos,
int lightValue) |
void |
setRainStrength(float strength)
Sets the strength of the rain.
|
java.util.Random |
setRandomSeed(int p_72843_1_,
int p_72843_2_,
int p_72843_3_)
puts the World Random seed to a specific state dependant on the inputs
|
void |
setSeaLevel(int seaLevelIn)
Warning this value may not be respected in all cases as it is still hardcoded in many places.
|
void |
setSkylightSubtracted(int newSkylightSubtracted) |
void |
setSpawnPoint(BlockPos pos) |
void |
setThunderStrength(float strength)
Sets the strength of the thunder.
|
void |
setTileEntity(BlockPos pos,
TileEntity tileEntityIn) |
void |
setTotalWorldTime(long worldTime) |
void |
setWorldTime(long time)
Sets the world time.
|
void |
spawnAlwaysVisibleParticle(int p_190523_1_,
double p_190523_2_,
double p_190523_4_,
double p_190523_6_,
double p_190523_8_,
double p_190523_10_,
double p_190523_12_,
int... p_190523_14_) |
boolean |
spawnEntity(Entity entityIn)
Called when an entity is spawned in the world.
|
void |
spawnParticle(EnumParticleTypes particleType,
boolean ignoreRange,
double xCoord,
double yCoord,
double zCoord,
double xSpeed,
double ySpeed,
double zSpeed,
int... parameters) |
void |
spawnParticle(EnumParticleTypes particleType,
double xCoord,
double yCoord,
double zCoord,
double xSpeed,
double ySpeed,
double zSpeed,
int... parameters) |
void |
tick()
Runs a single tick for the world
|
protected void |
tickPlayers() |
boolean |
tickUpdates(boolean p_72955_1_)
Runs through the list of updates to run and ticks them
|
void |
unloadEntities(java.util.Collection<Entity> entityCollection) |
void |
updateAllPlayersSleepingFlag()
Updates the flag that indicates whether or not all players in the world are sleeping.
|
protected void |
updateBlocks() |
void |
updateBlockTick(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
updateComparatorOutputLevel(BlockPos pos,
Block blockIn) |
void |
updateEntities()
Updates (and cleans up) entities and tile entities
|
void |
updateEntity(Entity ent)
Forcefully updates the entity.
|
void |
updateEntityWithOptionalForce(Entity entityIn,
boolean forceUpdate)
Updates the entity in the world if the chunk the entity is in is currently loaded or its forced to update.
|
void |
updateObservingBlocksAt(BlockPos pos,
Block blockType) |
protected void |
updateWeather()
Updates all weather states.
|
void |
updateWeatherBody() |
public static double MAX_ENTITY_RADIUS
protected boolean scheduledUpdatesAreImmediate
public final java.util.List<Entity> loadedEntityList
protected final java.util.List<Entity> unloadedEntityList
public final java.util.List<TileEntity> loadedTileEntityList
public final java.util.List<TileEntity> tickableTileEntities
public final java.util.List<EntityPlayer> playerEntities
public final java.util.List<Entity> weatherEffects
protected final IntHashMap<Entity> entitiesById
protected int updateLCG
protected final int DIST_HASH_MAGIC
public float prevRainingStrength
public float rainingStrength
public float prevThunderingStrength
public float thunderingStrength
public final java.util.Random rand
public final WorldProvider provider
protected PathWorldListener pathListener
protected java.util.List<IWorldEventListener> eventListeners
protected IChunkProvider chunkProvider
protected final ISaveHandler saveHandler
protected WorldInfo worldInfo
protected boolean findingSpawnPoint
protected MapStorage mapStorage
public VillageCollection villageCollectionObj
protected LootTableManager lootTable
public final Profiler theProfiler
protected Scoreboard worldScoreboard
public final boolean isRemote
protected boolean spawnHostileMobs
protected boolean spawnPeacefulMobs
public boolean restoringBlockSnapshots
public boolean captureBlockSnapshots
public java.util.ArrayList<BlockSnapshot> capturedBlockSnapshots
protected MapStorage perWorldStorage
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
public World init()
public Biome getBiome(BlockPos pos)
getBiome
in interface IBlockAccess
public BiomeProvider getBiomeProvider()
protected abstract IChunkProvider createChunkProvider()
public void initialize(WorldSettings settings)
public MinecraftServer getMinecraftServer()
public void setInitialSpawnLocation()
public IBlockState getGroundAboveSeaLevel(BlockPos pos)
public boolean isValid(BlockPos pos)
public boolean isOutsideBuildHeight(BlockPos pos)
public boolean isAirBlock(BlockPos pos)
isAirBlock
in interface IBlockAccess
public boolean isBlockLoaded(BlockPos pos)
public boolean isBlockLoaded(BlockPos pos, boolean allowEmpty)
public boolean isAreaLoaded(BlockPos center, int radius)
public boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty)
public boolean isAreaLoaded(StructureBoundingBox box)
public boolean isAreaLoaded(StructureBoundingBox box, boolean allowEmpty)
protected abstract boolean isChunkLoaded(int x, int z, boolean allowEmpty)
public Chunk getChunkFromChunkCoords(int chunkX, int chunkZ)
public boolean isChunkGeneratedAt(int x, int z)
public boolean setBlockState(BlockPos pos, IBlockState newState, int flags)
public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState iblockstate, IBlockState newState, int flags)
public boolean setBlockToAir(BlockPos pos)
public boolean destroyBlock(BlockPos pos, boolean dropBlock)
public boolean setBlockState(BlockPos pos, IBlockState state)
public void notifyBlockUpdate(BlockPos pos, IBlockState oldState, IBlockState newState, int flags)
public void notifyNeighborsRespectDebug(BlockPos pos, Block blockType, boolean p_175722_3_)
public void markBlocksDirtyVertical(int x1, int z1, int x2, int z2)
public void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax)
public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)
public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType, boolean updateObservers)
public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide)
public void observedNeighborChanged(BlockPos pos, Block p_190529_2_, BlockPos p_190529_3_)
public boolean canSeeSky(BlockPos pos)
public boolean canBlockSeeSky(BlockPos pos)
public int getLight(BlockPos pos)
public int getLightFromNeighbors(BlockPos pos)
public int getLight(BlockPos pos, boolean checkNeighbors)
public BlockPos getHeight(BlockPos pos)
public int getHeight(int x, int z)
@Deprecated public int getChunksLowestHorizon(int x, int z)
public int getLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos)
public int getLightFor(EnumSkyBlock type, BlockPos pos)
public void setLightFor(EnumSkyBlock type, BlockPos pos, int lightValue)
public void notifyLightSet(BlockPos pos)
public int getCombinedLight(BlockPos pos, int lightValue)
getCombinedLight
in interface IBlockAccess
public float getLightBrightness(BlockPos pos)
public IBlockState getBlockState(BlockPos pos)
getBlockState
in interface IBlockAccess
public boolean isDaytime()
public RayTraceResult rayTraceBlocks(Vec3d start, Vec3d end)
public RayTraceResult rayTraceBlocks(Vec3d start, Vec3d end, boolean stopOnLiquid)
public RayTraceResult rayTraceBlocks(Vec3d vec31, Vec3d vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock)
public void playSound(EntityPlayer player, BlockPos pos, SoundEvent soundIn, SoundCategory category, float volume, float pitch)
public void playSound(EntityPlayer player, double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch)
public void playSound(double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch, boolean distanceDelay)
public void playRecord(BlockPos blockPositionIn, SoundEvent soundEventIn)
public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters)
public void spawnAlwaysVisibleParticle(int p_190523_1_, double p_190523_2_, double p_190523_4_, double p_190523_6_, double p_190523_8_, double p_190523_10_, double p_190523_12_, int... p_190523_14_)
public void spawnParticle(EnumParticleTypes particleType, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters)
public boolean addWeatherEffect(Entity entityIn)
public boolean spawnEntity(Entity entityIn)
public void onEntityAdded(Entity entityIn)
public void onEntityRemoved(Entity entityIn)
public void removeEntity(Entity entityIn)
public void removeEntityDangerously(Entity entityIn)
public void addEventListener(IWorldEventListener listener)
public java.util.List<AxisAlignedBB> getCollisionBoxes(Entity entityIn, AxisAlignedBB aabb)
public void removeEventListener(IWorldEventListener listener)
public boolean func_191503_g(Entity p_191503_1_)
public boolean collidesWithAnyBlock(AxisAlignedBB bbox)
public int calculateSkylightSubtracted(float partialTicks)
public float getSunBrightnessFactor(float partialTicks)
public float getSunBrightness(float partialTicks)
public float getSunBrightnessBody(float partialTicks)
public Vec3d getSkyColor(Entity entityIn, float partialTicks)
public float getCelestialAngle(float partialTicks)
public int getMoonPhase()
public float getCurrentMoonPhaseFactor()
public float getCurrentMoonPhaseFactorBody()
public float getCelestialAngleRadians(float partialTicks)
public Vec3d getCloudColour(float partialTicks)
public Vec3d getCloudColorBody(float partialTicks)
public Vec3d getFogColor(float partialTicks)
public BlockPos getTopSolidOrLiquidBlock(BlockPos pos)
public float getStarBrightness(float partialTicks)
public float getStarBrightnessBody(float partialTicks)
public boolean isUpdateScheduled(BlockPos pos, Block blk)
public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)
public void updateEntities()
protected void tickPlayers()
public boolean addTileEntity(TileEntity tile)
public void addTileEntities(java.util.Collection<TileEntity> tileEntityCollection)
public void updateEntity(Entity ent)
public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
public boolean checkNoEntityCollision(AxisAlignedBB bb)
public boolean checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn)
public boolean checkBlockCollision(AxisAlignedBB bb)
public boolean containsAnyLiquid(AxisAlignedBB bb)
public boolean isFlammableWithin(AxisAlignedBB bb)
public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)
public boolean isMaterialInBB(AxisAlignedBB bb, Material materialIn)
public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking)
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
public float getBlockDensity(Vec3d vec, AxisAlignedBB bb)
public boolean extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side)
public java.lang.String getDebugLoadedEntities()
public java.lang.String getProviderName()
public TileEntity getTileEntity(BlockPos pos)
getTileEntity
in interface IBlockAccess
public void setTileEntity(BlockPos pos, TileEntity tileEntityIn)
public void removeTileEntity(BlockPos pos)
public void markTileEntityForRemoval(TileEntity tileEntityIn)
public boolean isBlockFullCube(BlockPos pos)
public boolean isBlockNormalCube(BlockPos pos, boolean _default)
public void calculateInitialSkylight()
public void setAllowedSpawnTypes(boolean hostile, boolean peaceful)
public void tick()
protected void calculateInitialWeather()
public void calculateInitialWeatherBody()
protected void updateWeather()
public void updateWeatherBody()
protected void playMoodSoundAndCheckLight(int p_147467_1_, int p_147467_2_, Chunk chunkIn)
protected void updateBlocks()
public void immediateBlockTick(BlockPos pos, IBlockState state, java.util.Random random)
public boolean canBlockFreezeWater(BlockPos pos)
public boolean canBlockFreezeNoWater(BlockPos pos)
public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj)
public boolean canBlockFreezeBody(BlockPos pos, boolean noWaterAdj)
public boolean canSnowAt(BlockPos pos, boolean checkLight)
public boolean canSnowAtBody(BlockPos pos, boolean checkLight)
public boolean checkLight(BlockPos pos)
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos)
public boolean tickUpdates(boolean p_72955_1_)
public java.util.List<NextTickListEntry> getPendingBlockUpdates(Chunk chunkIn, boolean p_72920_2_)
public java.util.List<NextTickListEntry> getPendingBlockUpdates(StructureBoundingBox structureBB, boolean p_175712_2_)
public java.util.List<Entity> getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb)
public java.util.List<Entity> getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, <any> predicate)
public <T extends Entity> java.util.List<T> getEntities(java.lang.Class<? extends T> entityType, <any> filter)
public <T extends Entity> java.util.List<T> getPlayers(java.lang.Class<? extends T> playerType, <any> filter)
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(java.lang.Class<? extends T> classEntity, AxisAlignedBB bb)
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(java.lang.Class<? extends T> clazz, AxisAlignedBB aabb, <any> filter)
public <T extends Entity> T findNearestEntityWithinAABB(java.lang.Class<? extends T> entityType, AxisAlignedBB aabb, T closestTo)
public Entity getEntityByID(int id)
public java.util.List<Entity> getLoadedEntityList()
public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity)
public int countEntities(java.lang.Class<?> entityType)
public void loadEntities(java.util.Collection<Entity> entityCollection)
public void unloadEntities(java.util.Collection<Entity> entityCollection)
public boolean mayPlace(Block p_190527_1_, BlockPos p_190527_2_, boolean p_190527_3_, EnumFacing p_190527_4_, Entity p_190527_5_)
public int getSeaLevel()
public void setSeaLevel(int seaLevelIn)
public int getStrongPower(BlockPos pos, EnumFacing direction)
getStrongPower
in interface IBlockAccess
public WorldType getWorldType()
getWorldType
in interface IBlockAccess
public int getStrongPower(BlockPos pos)
public boolean isSidePowered(BlockPos pos, EnumFacing side)
public int getRedstonePower(BlockPos pos, EnumFacing facing)
public boolean isBlockPowered(BlockPos pos)
public int isBlockIndirectlyGettingPowered(BlockPos pos)
public EntityPlayer getClosestPlayerToEntity(Entity entityIn, double distance)
public EntityPlayer getNearestPlayerNotCreative(Entity entityIn, double distance)
public EntityPlayer getClosestPlayer(double posX, double posY, double posZ, double distance, boolean spectator)
public EntityPlayer getClosestPlayer(double x, double y, double z, double p_190525_7_, <any> p_190525_9_)
public boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range)
public EntityPlayer getNearestAttackablePlayer(Entity entityIn, double maxXZDistance, double maxYDistance)
public EntityPlayer getNearestAttackablePlayer(BlockPos pos, double maxXZDistance, double maxYDistance)
public EntityPlayer getNearestAttackablePlayer(double posX, double posY, double posZ, double maxXZDistance, double maxYDistance, <any> playerToDouble, <any> p_184150_12_)
public EntityPlayer getPlayerEntityByName(java.lang.String name)
public EntityPlayer getPlayerEntityByUUID(java.util.UUID uuid)
public void sendQuittingDisconnectingPacket()
public void checkSessionLock() throws MinecraftException
MinecraftException
public void setTotalWorldTime(long worldTime)
public long getSeed()
public long getTotalWorldTime()
public long getWorldTime()
public void setWorldTime(long time)
public BlockPos getSpawnPoint()
public void setSpawnPoint(BlockPos pos)
public void joinEntityInSurroundings(Entity entityIn)
public boolean isBlockModifiable(EntityPlayer player, BlockPos pos)
public boolean canMineBlockBody(EntityPlayer player, BlockPos pos)
public void setEntityState(Entity entityIn, byte state)
public IChunkProvider getChunkProvider()
public ISaveHandler getSaveHandler()
public WorldInfo getWorldInfo()
public GameRules getGameRules()
public void updateAllPlayersSleepingFlag()
public float getThunderStrength(float delta)
public void setThunderStrength(float strength)
public float getRainStrength(float delta)
public void setRainStrength(float strength)
public boolean isThundering()
public boolean isRaining()
public boolean isRainingAt(BlockPos strikePosition)
public boolean isBlockinHighHumidity(BlockPos pos)
public MapStorage getMapStorage()
public void setData(java.lang.String dataID, WorldSavedData worldSavedDataIn)
public WorldSavedData loadData(java.lang.Class<? extends WorldSavedData> clazz, java.lang.String dataID)
public int getUniqueDataId(java.lang.String key)
public void playBroadcastSound(int id, BlockPos pos, int data)
public void playEvent(int type, BlockPos pos, int data)
public void playEvent(EntityPlayer player, int type, BlockPos pos, int data)
public int getHeight()
public int getActualHeight()
public java.util.Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_)
public CrashReportCategory addWorldInfoToCrashReport(CrashReport report)
public double getHorizon()
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
public java.util.Calendar getCurrentDate()
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
public Scoreboard getScoreboard()
public DifficultyInstance getDifficultyForLocation(BlockPos pos)
public EnumDifficulty getDifficulty()
public int getSkylightSubtracted()
public void setSkylightSubtracted(int newSkylightSubtracted)
public int getLastLightningBolt()
public void setLastLightningBolt(int lastLightningBoltIn)
public VillageCollection getVillageCollection()
public WorldBorder getWorldBorder()
public boolean isSpawnChunk(int x, int z)
public boolean isSideSolid(BlockPos pos, EnumFacing side)
pos
- Block Positionside
- The Side in questionpublic boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default)
isSideSolid
in interface IBlockAccess
pos
- Block Positionside
- The Side in question_default
- The default to return if the block doesn't exist.public <any> getPersistentChunks()
public java.util.Iterator<Chunk> getPersistentChunkIterable(java.util.Iterator<Chunk> chunkIterator)
public int getBlockLightOpacity(BlockPos pos)
pos
- Block positionpublic int countEntities(EnumCreatureType type, boolean forSpawnCount)
protected void initCapabilities()
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
ICapabilityProvider
hasCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'public <T> T getCapability(Capability<T> capability, EnumFacing facing)
ICapabilityProvider
getCapability
in interface ICapabilityProvider
capability
- The capability to checkfacing
- The Side to check from:
CAN BE NULL. Null is defined to represent 'internal' or 'self'ICapabilityProvider.hasCapability(Capability, EnumFacing)
would return false.public MapStorage getPerWorldStorage()
public void sendPacketToServer(Packet<?> packetIn)
public LootTableManager getLootTableManager()