summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/World.java
Commit message (Collapse)AuthorAgeLines
* Refactored BlockPlaceEvent and BlockChangeDelegate. Adds BUKKIT-5558bloodshot2014-04-23-12/+102
| | | | | | | | | | | | | | | | | | | | | | | | | 23 classes have been removed as they are no longer needed using the new capture logic. This should help quite a bit with future MC updates. BlockPlaceEvent Refactor Before calling Item.interactWith, a recording flag is turned on for setTypeAndData to capture a blockstate for each block that attempts to be set. When a block place event is cancelled, the recorded blockstate, stack size, and metadata will revert back to the captured state. If the event is not cancelled, a notification will be sent to clients and block physics will be updated. BlockChangeDelegate Refactor Now that we have the ability to capture blockstates through world, there is no need to modify world gen classes with BlockChangeDelegate. Instead we will simply capture blocks during world generation in order to "replay" all of the captured blockstates to send back to delegates. StructureGrowDelegate and BlockSapling.TreeGenerator have also been removed as part of this change. BlockSapling and BlockMushroom will capture blockstates the same as block placement and revert back any grow events if needed.
* Removing broken chunk caching from World. Fixes BUKKIT-5425Brokkonaut2014-04-18-16/+1
| | | | | | | | Chunk caching in the World class does not know about outdated cache values. This caused various problems when accessing previously unloaded chunks. The caching also did not improve the performance so it is removed. Synchronization is also not necessary, because all accesses to getChunkAt may only come from the main thread.
* Update CraftBukkit to Minecraft 1.7.8Travis Watkins2014-04-11-3/+18
|
* Update CraftBukkit to Minecraft 1.7.5Nate Mortensen2014-03-21-140/+138
|
* Check if entity is in list before decrementing. Fixes BUKKIT-5404EvilSeph2014-02-11-3/+5
|
* Handle removing entity while ticking. Fixes BUKKIT-1331Travis Watkins2014-02-10-6/+14
| | | | | | | | | If a plugin causes an entity to be removed from the world while the world is ticking entities the ticking loop gets out of sync and fails due to trying to go beyond the end of the entity array. To ensure this doesn't happen we store the loop position as a field so we can fix it up in the entity remove method just like the tick method does when it removes an entity.
* [Bleeding] Ignore Block Physics in Chunk population. Fixes BUKKIT-4923t00thpick12013-12-08-0/+6
| | | | | | Suppressing physics updates during Chunk population prevents infinite recursion due to custom Block Populators editing border blocks on chunks.
* Fix BlockPhysicsEvent having incorrect changed type. Fixes BUKKIT-5063AlphaBlend2013-12-07-1/+1
| | | | | This change updates the reference to the local variable representing the block being checked when calling BlockPhysicsEvent.
* Fix BlockCanBuildEvent returning null. Fixes BUKKIT-4972toastedtruth2013-12-02-1/+2
| | | | | | | | | | A Block object is now passed in place of the previous id value, so the obfuscated name for all subsequent arguments was shifted. As such, BlockCanBuildEvent was using the incorrect values for both the material and the location of the event. This is corrected by swapping the values into the correct order and providing an id based upon the Block passed into the method.
* Update CraftBukkit to Minecraft 1.7.2mbax2013-11-30-548/+475
|
* Update CraftBukkit to 1.6.4feildmaster2013-09-19-5/+5
|
* Update CraftBukkit to 1.6.2mbax2013-07-08-5/+5
|
* Update CraftBukkit to 1.6.1Nate Mortensen2013-07-01-37/+58
|
* Fix typo/logic error in previous commitTravis Watkins2013-05-02-1/+1
|
* Fix animal spawning ignoring limits. Fixes BUKKIT-4180Travis Watkins2013-05-02-1/+10
| | | | | | | | | Minecraft 1.5.2 changed mob spawning by ignoring persistent mobs from the mob count. In CraftBukkit all mobs that previously used a separate hard coded persistence system were ported to instead use this one. This causes all animals to be persistent by default and thus never be counted. To correct this issue we consider if the mob would be considered persistent in the hard coded system as well when deciding if a mob should count.
* Update CraftBukkit to Minecraft 1.5.2Travis Watkins2013-04-27-19/+19
|
* Various minor performance improvementsTravis Watkins2013-04-13-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a check to avoid doing movement work if an entity doesn't move. This usually will not ever happen in the current server but is useful when it does and will be more useful in the future. Only process mob on mob (non-player) collisions every other tick. Players tend to pack a lot of mobs into a small space (sheep farm, mob grinder, etc) so they do a lot of work processing collisions. To help alleviate some of this we only run these calculations every other tick. This has no visible effect on the client but can be a huge win on the server depending on circumstances. Use generic entity inWater checking for squids. Squids have their own logic currently for determining if they are in water. This check is almost identical to the generic entity checking which is run anyway. To avoid doing duplicate work we just remove the squid version. This does not have any noticeable effect on gameplay since the checks are so similar. Use HashSet for tile entities instead of ArrayList. Using an ArrayList for storing tile entities in a world means we have very expensive inserts and removes that aren't at the end of the array due to the array copy this causes. This is most noticeable during chunk unload when a large number of tile entities are removed from the world at once. Using a HashSet here uses a little more memory but is O(1) for all operations so removes this bottleneck.
* Make auxiliary worlds use the main scoreboard. Addresses BUKKIT-3984Wesley Wolfe2013-04-04-1/+1
| | | | | | | | | | | When a world is created using our API, it does not use secondary world server and will maintain a reference to its own scoreboard. In vanilla, this is not an issue as there is only ever one world. Similarly to maps, an overwrite to the scoreboard reference has been added for when another world has been created. This should also address BUKKIT-3982 and BUKKIT-3985
* Cleanup comments, formatting, etcTravis Watkins2013-03-25-9/+9
|
* Update CraftBukkit to Minecraft 1.5.1Travis Watkins2013-03-20-3/+7
|
* Update CraftBukkit to Minecraft 1.5Travis Watkins2013-03-15-452/+486
|
* Fix TileEntities and Blocks getting out of sync. Fixes BUKKIT-3501feildmaster2013-01-27-4/+2
| | | | | | | | | | Also fixes: BUKKIT-3477 and BUKKIT-3488 Minecraft likes to double check that tile entities get set after they are placed, however we didn't set tile entities until after our event was called. This caused the world to have multiple tile entities in a single block location; to fix this we now set tile entities before the event.
* Update CraftBukkit to Minecraft 1.4.6feildmaster2012-12-20-88/+96
|
* Update CraftBukkit to Minecraft 1.4.4.Travis Watkins2012-11-13-168/+239
|
* Update CraftBukkit to Minecraft 1.4(.2).Travis Watkins2012-10-27-244/+323
|
* Use this world instead of the one in the entity. Fixes BUKKIT-2315Travis Watkins2012-09-28-3/+3
| | | | | | In some situations an entity or tile entity can be added to the world but have its own 'world' field be null or otherwise incorrect. As the entity was added to this world to be ticked assume it actually is in this world.
* Set last accessed variables after grabbing chunk. Fixes BUKKIT-1033Wesley Wolfe2012-09-20-1/+1
| | | | | | | | | | | | | This fix changes the 'state' of the last accessed variables to be more accurate. Changing the coordinates of the last accessed chunk should never precede actually setting the last accessed chunk, as loading a chunk may at some point call back to getChunkAt with a new set of coordinates before the chunk has actually been loaded. The coordinates would have been set, but the actual chunk would not. With no check for accuracy, this causes fringe case issues such as null block states. Big thanks to @V10lator for finding where the root of the problem was occurring.
* [Bleeding] Check visibility API for sounds. Fixes BUKKIT-2210mbax2012-09-14-1/+1
| | | | | | | | | | | | This implementation of a visibility API check for sounds was created by adding extra methods carrying the source entity in WorldManager and ServerConfigurationManagerAbstract and adding a test for canSee in the SCMA sendPacketNearby method. This approach involves no logic copying, just method addition. I opted to cast to WorldManager as: 1) IWorldAccess is not in CraftBukkit at the moment 2) There is no other IWorldAccess implemented in CraftBukkit, nor is there likely to be one soon. If that day comes, easy fix.
* Bulk pending cleanup.Wesley Wolfe2012-09-09-32/+32
|
* Update to 1.3.2Travis Watkins2012-08-25-5/+5
|
* Fix entities not having valid "isValid" states. Addresses BUKKIT-2366feildmaster2012-08-22-0/+2
|
* Check unload queue so we don't accidentally leave a chunk loadedTravis Watkins2012-08-19-1/+2
|
* Add LongObjectHashMap and LongHashSetTravis Watkins2012-08-19-8/+8
| | | | | | | | | | | | | | | Replace uses of LongHashtable and LongHashset with new implementations. Remove EntryBase, LongBaseHashtable, LongHashset, and LongHashtable as they are no longer used. LongObjectHashMap does not use Entry or EntryBase classes internally for storage so has much lower object churn and greater performance. LongHashSet is not as much of performance win for our use case but for general use is up to seventeen times faster than the old implementation and is in fact faster than alternatives from "high performance" java libraries. This is being added so that if someone tries to use it in the future in a place unrelated to its current use they don't accidentally end up with something slower than the Java collections HashSet implementation.
* [Bleeding] Change Vec3DPool to a stack based poolMike Primm2012-08-19-1/+6
| | | | | | | Avoid overhead of using an ArrayList and resizing it. Also allows for reuse of objects in the pool during the same tick by explicitly releasing them back to the pool. This allows for much better cache performance as well as reduced cache footprint.
* Add iterator cache to UnsafeList and use it in hotspotsTravis Watkins2012-08-19-2/+3
| | | | | Adds a specialized iterator for the list and a pool of iterators to avoid object churn. Also optimizes the clear() method to reduce object creation.
* Don't tick chunks or entities on chunks that are queued for unload.Travis Watkins2012-08-04-1/+28
| | | | | Treat chunks in the unload queue as if they are already unloaded to prevent processing on them removing them from the unload queue and leaking.
* Update CraftBukkit to Minecraft 1.3.1feildmaster2012-08-02-889/+547
|
* Cleaned up CraftBukkit comments in NMS.Wesley Wolfe2012-07-23-5/+2
| | | | | | | | | | | | | Added newlines at the end of files Fixed improper line endings on some files Matched start - end comments Added some missing comments for diffs Fixed syntax on some spots Minimized some diff Removed some no longer used files Added comment on some required files with no changes Fixed imports of items used once Added imports for items used more than once
* Mark entities as invalid when they get despawned. Addresses BUKKIT-810Travis Watkins2012-06-28-0/+2
|
* Revert obsolete "fix" for Redstone Torchesfeildmaster2012-05-17-4/+1
|
* Avoid doing unnecessary range checks when we're looping from start to end.Travis Watkins2012-04-23-2/+3
| | | | | | | | | | | | | | | | | | Make EntityLiving call AI logic every tick again. Rework PathfinderGoalSelector logic. Adds UnsafeList for use in places where we use ArrayList and know we won't get index out of range errors. Added usage to World's tickEntities, Chunk's entitySlices to speed up searching for entities, and to PathfinderGoalSelector to speed up dealing with AI goals. Reworked logic in PathfinderGoalSelector with help from fullwall. This code no longer uses an extra ArrayList for setting up goals and only updates which goals should be run every other time it is called. Removed only calling PathfinderGoalSelector every other tick from EntityLiving as we now only setup new goals every other tick. This ensures existing goals run every tick to properly update mob movement.
* Filter entity spawning sanely.feildmaster2012-04-15-1/+1
|
* Use SpawnReason.DEFAULT instead of SpawnReason.CUSTOM, freeing CUSTOM to ↵feildmaster2012-04-14-1/+1
| | | | | | plugin spawning. This gets used in case we are missing appropriate SpawnReason's for various Entity spawns.
* Mark entities as dead when spawning fails. Treat as canceled if entity is dead.feildmaster2012-04-03-15/+14
|
* Updated to Minecraft version 1.2.4. Updated version string to 1.2.4-R0.1.Nathan Adams2012-03-22-9/+9
|
* [Bleeding] Implemented ProjectileLaunchEvent. Addresses BUKKIT-284Celtic Minstrel2012-03-15-0/+5
|
* Made golems spawning respect spawn-animals for real. Fixes BUKKIT-1124EvilSeph2012-03-11-2/+2
|
* Made iron golems spawning to defend villagers respect spawn-animals. Fixes ↵EvilSeph2012-03-10-1/+1
| | | | BUKKIT-1124
* Made zombie invasions respect spawn-monsters setting. Fixes BUKKIT-1123EvilSeph2012-03-10-1/+1
|
* Added missing filters to addEntity. Fixes BUKKIT-794EvilSeph2012-03-08-1/+1
|