summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeLines
...
* Use 4787c23dce0f5ac856d8d398225828971a93a3ff Guava patch for onlinePlayersWesley Wolfe2014-07-01-3/+1
| | | | | | | | This change improves the quality of life for plugin developers using iterator iteration with side-effects. In the specified Guava patch, the internal iterator no longer relies on the AbstractList iterator which iterates by index, and will instead wrap the provided iterator in a transformer given the Function.
* Implement new getOnlinePlayers. Adds BUKKIt-5668Wesley Wolfe2014-06-25-14/+117
|
* [Bleeding] Fix checks for non-living entities. Fixes BUKKIT-5667t00thpick12014-06-24-2/+2
|
* [Bleeding] Ignore damage done by LivingEntity.damage(). Fixes BUKKIT-5666t00thpick12014-06-23-0/+2
| | | | | This matches behavior previous to new damage event API of not throwing events for plugin-triggered damage.
* Use compact memory format for uniform chunk section data.Travis Watkins2014-06-23-59/+272
| | | | | | | | | | | Many chunk sections contain parts of their data that are the same for every block they contain. In these cases we can save memory by saving a single value instead of an array of 4096 copies of that value. Block light and block data are most likely to be uniform followed closely by sky light data. Block ids are far less likely to be uniform but give the largest saving when they are. Because of this we use a compact format for every part of the chunk. Memory saved from this technique will vary based on the world but seems to be about 50% on normal Minecraft generated chunks.
* [Bleeding] Set projectile source for reflected fireballs. Fixes BUKKIT-5661t00thpick12014-06-22-0/+1
|
* [Bleeding] Implement new damage api. Fixes BUKKIT-5326, BUKKIT-3878.t00thpick12014-06-22-223/+263
| | | | | | | | | | | | | | This commit centralizes event handling to where damage is actually applied to the entity to avoid bugs that have resulted from nodamageticks, modifications to damage after the event has been called, and similar mishaps. This also implements new API for getting and setting of modifications made to the damage amount actually applied to the entity. This is done by storing the change in the damage amount as each modifier is applied by vanilla code. The method that actually damages the armor worn by an entity has been relocated beneath the event called as to not apply durability loss when the event has been cancelled.
* [Bleeding] Repair missing diff in Explosion. Fixes BUKKIT-5662t00thpick12014-06-22-3/+4
| | | | | | The blast protection enchantment dampers explosions, however the functionality was only added to block explosions, and not entity explosions.
* Avoid checking for loaded chunks for lighting and entity ticking.Travis Watkins2014-06-21-5/+92
| | | | | | | | | | | | | | When a chunk is loaded the server tries to ensure it has its initial light calculations done before sending it to the player. When ticking entities the server tries to ensure the entity does not walk into an unloaded chunk. To accomplish these the server checks a one chunk radius around the chunk to be lit or a two chunk radius around the chunk the entity is in. These lookups happen every tick even though their result is unlikely to change that often. To reduce the cost of these checks we replace them with a system to keep track of what neighbor chunks a chunk has loaded and update it when chunks load or unload which is a much less frequent action. On a server with ten players this change removes about 100,000 calls a tick to LongObjectHashMap's containsKey method.
* Don't check unload queue before ticking things anymore.Travis Watkins2014-06-21-29/+11
| | | | | | | | | | | In commits 71a238ee and c8591397 we added checks while ticking to ensure we never ticked anything in a chunk meant to be unloaded. We did this to prevent these chunks being removed from the unload queue and leaked. However, this causes a ridiculously large number of lookups on the queue for a somewhat rare occurance. We also now have the chunk GC which will take care of these leaked chunks when they do happen. With this in mind we now remove these checks which removes almost all uses of the LongHashSet backing the unload queue.
* Add special case for handling place event with lilies. Fixes BUKKIT-5641bloodshot2014-06-01-1/+9
|
* Improve ItemStack filtering.Travis Watkins2014-06-01-0/+10
|
* Some assumptions are better than others.Nate Mortensen2014-06-01-5/+3
|
* Use UUIDs in CraftPlayer equals and hashCode methods. Fixes BUKKIT-5634Daniel Naylor2014-05-26-4/+4
|
* Handle null targets in target event. Fixes BUKKIT-5635Travis Watkins2014-05-26-3/+10
|
* Fix ItemStack state during BlockPlaceEvent. Fixes BUKKIT-5632Nate Mortensen2014-05-26-5/+15
|
* Rework mob item dropping on death. Fixes BUKKIT-5625Travis Watkins2014-05-26-688/+119
| | | | | | | | | | | | | | | | | | | After the changes in d611cff2 we started including a mob's equipment when calling EntityDeathEvent so plugins can access this data. However, the changes to enable this triggered a bug that makes skeletons and pig zombies no longer drop equipment because they handle this differently than the rest. On top of this we don't handle dropping equipment for mobs that cannot pick up items in vanilla even though vanilla does drop equipment for them if you summon them with it. We also do not include a horse's inventory in the event so they drop their saddle, armor, chest, and chest contents with no way for a plugin to control this. To solve this issues we revert mob item dropping back to vanilla logic and instead just capture all their drops in the method they all call to spawn them into the world. We also move horse inventory dropping so it happens at a time when we're capturing these drops. With these changes all items mobs drop on death should now be included in the event and we have less diff to worry about for future updates.
* Fix polarity of Bat.isAwake() and Bat.setAwake(boolean). Fixes BUKKIT-5624Wesley Wolfe2014-05-20-2/+2
|
* Ensure we always log commands and log the right thing.Travis Watkins2014-05-14-1/+2
| | | | | | | | Waiting to log until after PlayerCommandPreprocessEvent makes the server not log anything if the event is cancelled. It also makes the server log what a plugin changed the command to instead of what the player actually tried to run. As the point of the log is to have a record of every command a player attempts to run these are both not desirable.
* Update CraftBukkit to use new YamlConfiguration encoding changesWesley Wolfe2014-05-14-6/+7
|
* Implement awake flag for bats. Adds BUKKIT-5606Wesley Wolfe2014-05-13-0/+10
|
* Handle chat packets correctlyWesley Wolfe2014-05-13-4/+4
|
* Handle inventory max stack sizes even better. Fixes BUKKIT-5595Travis Watkins2014-05-13-1/+6
| | | | | | | | | | | | In 7e37cf96 we modified the container logic to handle custom max stack sizes better and ensure the client stays in sync with this scenario. This had the effect of sending an extra set slot packet for every inventory click a player did which was not wanted. These extra packets also cause the client to recalculate recipes which breaks the result slot for custom recipes. To avoid the extra packets in general we now only send them if the max stack is not the one we started with. In the case of a setting a custom max stack size on a workbench this is still not enough so we also now send another extra packet to make sure the result slot is always correct.
* Only set skull profile if it is a player skull. Fixes BUKKIT-5605Travis Watkins2014-05-12-6/+7
|
* Avoid using the user cache in skull meta.Travis Watkins2014-05-03-5/+5
| | | | | | | | | | | | To handle changes in 1.7.9 we changed skull meta to use GameProfile instances instead of strings of player names. This reflects what vanilla is actually storing for skulls now. As skulls still require a name our API was not changed and we instead look up the rest of the profile information from the name. The way this was implemented made it so that deserializing a skull or setting its name potentially involved a network request. As skull meta itself does not actually require a complete profile we now simply create one that only contains a name and leave populating it to the server when it is actually needed.
* [Bleeding] Fix stack overflow with Ender Crystals. Fixes BUKKIT-5583GJ2014-05-03-3/+3
|
* Implement inventory creation by type and title. Fixes BUKKIT-4045eueln2014-04-30-0/+13
| | | | | | | | | | | | | With the current API it is possible to create an inventory with a specific type, but it is not possible to give such an inventory a title other than the default. The commit changes that by adding a method to optionally supply the title for the given inventory type and holder, creating the functionality to display any supported inventory type with a 32 character length String. If the inventory title supplied is larger than 32 characters then an IllegalArgumentException is thrown stating so.
* [Bleeding] Recheck persistence for chicken jockeys each tick. Fixes BUKKIT-5577GJ2014-04-29-0/+5
|
* [Bleeding] Include equipment in EntityDeathEvent loot. Fixes BUKKIT-5566GJ2014-04-29-4/+23
|
* [Bleeding] Allow generation of cocoa trees.GJ2014-04-28-0/+3
|
* [Bleeding] Correct issues with MEGA_REDWOOD trees. Fixes BUKKIT-5568GJ2014-04-28-2/+2
| | | | | | In commit 6efeddfe57, TALL_REDWOOD was used instead of the proper TreeType of MEGA_REDWOOD. Additionally, this fixes an issue in CraftWorld with an improper boolean flag related to the generation of MEGA_REDWOOD trees.
* Refactored BlockPlaceEvent and BlockChangeDelegate. Adds BUKKIT-5558bloodshot2014-04-23-2635/+323
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Don't limit anvil stack size.Travis Watkins2014-04-23-1/+0
| | | | | | After the changes in c549609d anvils started incorrectly limiting their inputs to single item stacks. Vanilla allows for full size stacks here and this is useful for using materials to repair items so now we do too.
* Handle inventory max stack sizes better. Fixes BUKKIT-5564Travis Watkins2014-04-23-8/+33
| | | | | | | | Make sure we check the inventory's max stack size where appropriate and don't assume the inventory slot is able to take our entire stack just because it is empty. We also ensure the client is updated with the correct slot contents and cursor contents in cases where the max stack changes result in different behavior than the client expected.
* Faux sleepers wake up normally. Fixes BUKKIT-3667Yariv Livay2014-04-18-1/+1
|
* Make AnvilInventory.getItem() use both containers. Fixes BUKKIT-2788Andre LeBlanc2014-04-18-0/+22
| | | | | | | | | The AnvilInventory reports its size as the sum of the ingredient and result inventories, but when trying to access the slots, only the ingredient inventory is used, leading to an ArrayIndexOutOfBounds exception. This change overrides getItem(I) and setItem(I) to use both inventories, with the slot number adjusted based on their size.
* Allow plugins to enchant normally unenchantable items. Adds BUKKIT-1849Andre LeBlanc2014-04-18-1/+7
| | | | | | | | | | It's currently not possible for a plugin to allow enchanting of an otherwise un-enchantable item using the enchanting table. This commit causes EnchantItemEvent to be called with an empty list of enchantments, allowing a plugin to provide it's own set of enchantments when vanilla Minecraft would not allow any. It also bypasses the unsafe enchantment check since a plugin should be permitted to apply any enchantments they like, and vanilla should not generate unsafe enchantments of its own.
* Fix setting entity's target. Fixes BUKKIT-1358PaulBGD2014-04-18-0/+2
| | | | | | Setting the goal target overrides the entity's will to do something else. This makes it so entities like wolves with attack another player with .setTarget(), instead of hanging next to their owner.
* Update client stack when block place is cancelled. Fixes BUKKIT-5284bloodshot2014-04-18-1/+3
| | | | | | | | | Currently, whenever a player places a block in a protected area the equipped itemstack size on client is never updated properly since the client thinks the block was placed. The reason this happens is because ItemStack.matches returns true since the server does not decrement stack size if a BlockPlaceEvent is cancelled. To correct this on cancel we set the flag to always update the client regardless of matching.
* Update chest animation after cancelling open event. Fixes BUKKIT-1440bloodshot2014-04-18-12/+44
| | | | | | | Currently if a plugin cancels an InventoryOpenEvent for vanilla chests, the chest animation for clients is stuck in the open state since IInventory's closeContainer method is never called. To fix the issue, closeContainer is called before exiting the display GUI method.
* Catch exceptions when abandoning conversions. Fixes BUKKIT-5436Devin Ryan2014-04-18-4/+10
| | | | | | | If a conversation is abandoned due to a player disconnecting and an exception is thrown in a ConversationAbandonedListener, the server will crash. This commit prevents the exception from propagating further up the stack and instead just logs the error.
* Check that item in hand is not null after book event. Fixes BUKKIT-5443Des Herriott2014-04-18-1/+1
|
* Call event when boat is destroyed by falling. Fixes BUKKIT-5500Brokkonaut2014-04-18-7/+14
|
* 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.
* [Bleeding] Call EntityTargetEvent in many new places.GJ2014-04-18-11/+48
| | | | | Adds BUKKIT-5388, BUKKIT-5387, BUKKIT-5386, BUKKIT-5483, BUKKIT-5484. Fixes BUKKIT-5389.
* Add files from mc-dev for diff visibility.GJ2014-04-18-0/+99
|
* [Bleeding] Call BlockRedstoneEvent for all rails. Adds BUKKIT-4080GJ2014-04-18-1/+15
| | | | | | Previously, Detector Rails were the only rails that properly called BlockRedstoneEvent when they changed from powered to unpowered. This commit adds BlockRedstoneEvent calls for both Powered Rails and Activator Rails.
* Add BlockPoweredRail.java from mc-dev for diff visibility.GJ2014-04-18-0/+132
|
* [Bleeding] Don't allow null display names. Fixes BUKKIT-5254GJ2014-04-18-1/+1
| | | | | | | | Currently, plugins can set a player's display name to null, which could cause issues for other calls to getDisplayName that aren't expecting a null value. This changes setDisplayName to follow the same logic as setPlayerListName, which sets the player's name back to their unmodified "vanilla" name if it receives a null value as a parameter.
* [Bleeding] Ice in the nether fades to air. Fixes BUKKIT-5373GJ2014-04-18-1/+1
| | | | | | | | Previously, whenever BlockFadeEvent was called for ice melting, it returned the new BlockState with a type of Material.STATIONARY_WATER. However, in the Nether, ice melting does not form water, but is simply replaced by air instead. This changes the event to use the proper BlockState based on whether the block is located in the Nether or not.