summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityLiving.java
Commit message (Collapse)AuthorAgeLines
* Put damage modifiers in Functions for event. Fixes BUKKIT-5681Travis Watkins2014-07-09-39/+69
|
* Update CraftBukkit to Minecraft 1.7.10Travis Watkins2014-07-08-113/+113
|
* [Bleeding] Implement new damage api. Fixes BUKKIT-5326, BUKKIT-3878.t00thpick12014-06-22-33/+92
| | | | | | | | | | | | | | 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.
* Rework mob item dropping on death. Fixes BUKKIT-5625Travis Watkins2014-05-26-13/+14
| | | | | | | | | | | | | | | | | | | 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.
* [Bleeding] Include equipment in EntityDeathEvent loot. Fixes BUKKIT-5566GJ2014-04-29-1/+5
|
* Correct missed diffTravis Watkins2014-03-24-1/+1
|
* Update CraftBukkit to Minecraft 1.7.5Nate Mortensen2014-03-21-207/+216
|
* Alter fall particles to respect visibility API. Fixes BUKKIT-5158t00thpick12013-12-13-1/+8
| | | | | | | Bukkits Visibility API should prevent players from seeing fall particles of players that they cannot see. This commit alters the handling to provide an EntityPlayer argument that is later used to determine if they are visible.
* Update CraftBukkit to Minecraft 1.7.2mbax2013-11-30-199/+214
|
* Update CraftBukkit to 1.6.4feildmaster2013-09-19-87/+88
|
* Fix CraftBukkit diffsWesley Wolfe2013-07-23-3/+3
|
* Add API to control scaled health. Adds BUKKIT-4590T00thpick12013-07-23-1/+23
| | | | | | | | | | | | | | | | | | | | | | | This commit implements the ability to set the scale of hearts that the client renders. When the Packet44UpdateAttributes packet is sent, the max health attribute is replaced with a scaled version, to preserve the scaled health illusion clientside. In order to accurately display the scaled health for players, a true health is stored within CraftPlayer, and the datawatcher now stores the scaled health. The getHealth() method for players still returns their true health. Changed setHealth() within EntityLiving to appropriately handle health for instances of EntityPlayer. Inlined a call to setHealth(getMaxHealth()) within the EntityLiving constructor to work around CraftEntity instantiation. Additionally fixes the health values sent when eating food within FoodMetaData and ItemFood, which previously sent the unscaled health; this commit alters them to send the properly scaled health. Additionally fixes BUKKIT-4535, BUKKIT-4536, and BUKKIT-4127
* Update CraftBukkit to 1.6.2mbax2013-07-08-121/+134
|
* Rework max health values. Fixes BUKKIT-4398Wesley Wolfe2013-07-02-21/+3
|
* Update CraftBukkit to 1.6.1Nate Mortensen2013-07-01-1432/+857
|
* Update CraftBukkit to Minecraft 1.5.2Travis Watkins2013-04-27-10/+16
|
* Don't apply fall damage when cancelled. Fixes BUKKIT-4065Travis Watkins2013-04-13-5/+7
|
* Various minor performance improvementsTravis Watkins2013-04-13-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Refactor EntityDamageEvents. Adds BUKKIT-1944 & BUKKIT-3684feildmaster2013-04-10-45/+20
|
* Cleanup comments, formatting, etcTravis Watkins2013-03-25-8/+10
|
* Update CraftBukkit to Minecraft 1.5.1Travis Watkins2013-03-20-6/+20
|
* Don't set health directly, will interfere with scoreboard system.Travis Watkins2013-03-16-2/+2
|
* Update CraftBukkit to Minecraft 1.5Travis Watkins2013-03-15-303/+383
|
* Update CraftBukkit to Minecraft 1.4.7feildmaster2013-01-17-9/+9
|
* Implement entity max health methods. Adds BUKKIT-266feildmaster2012-12-23-7/+26
|
* Update CraftBukkit to Minecraft 1.4.6feildmaster2012-12-20-182/+202
|
* Implement ItemFactory and ItemMeta values. Adds BUKKIT-15Wesley Wolfe2012-12-17-1/+1
|
* Don't run mob pickup code on players. Fixes BUKKIT-3150Travis Watkins2012-12-12-1/+2
| | | | | | | When a player has canPickUpLoot set to true the code for mob pickup is triggerd which does not know how to deal with player inventory. Since players have their own logic for picking up items we simply disable this code for them.
* Fix players not being able to pickup items due to default values.feildmaster2012-12-11-7/+8
| | | | | | | | The old flag for picking up loot was default to false, making existing players not able to pickup items. We now use this flag for Players, which gives us the problem we had in 48b46f83. To fix this, we add an incremental flag that will be cross-examined to check if the data was saved before or after the flag level was introduced. Addresses BUKKIT-3143
* Add EntityEquipment API. Adds BUKKIT-3103feildmaster2012-12-10-2/+2
| | | | | | | | Adds: - Getting/Setting equipment - getting/setting drop rates - getting/setting ability to pick up items -- As an added feature, players with this flag start off with a canceled PlayerPickupItemEvent
* Update entity state correctly when marked as persistent. Fixes BUKKIT-3123Travis Watkins2012-12-07-0/+4
| | | | | | | | | | When a mob is marked with the persistent flag (animal or anything with setRemoveWhenFarAway(false)) the entire block of code for checking if they should be despawned is skipped. However, one part of this code updates the mob state if a player is close enough to them. It turns out this state is used by the AI system to decide if the mob should move around randomly or not. To stop mobs from being frozen in place we now update this state if the persistent flag is set as well.
* Persistence isn't just animals. Fix BUKKIT-3105feildmaster2012-12-05-1/+3
| | | | Also set to this value if the persistence hasn't been updated
* Ensure animals don't despawn due to old default setting.Travis Watkins2012-12-04-1/+8
| | | | | | | | | | | The old default for the persistent flag on mobs was false which was then written out to their NBT data when they were saved. We now use this data for all mobs, not just non-animal mobs. However, this means animals that spawned before that change will now start despawning like monsters do. To avoid this we add a new flag to the mob's saved data to mark if the data was saved before or after we started using it and ignore it if it was before.
* Implement API for mob despawn when away from players. Adds BUKKIT-2986Travis Watkins2012-12-04-3/+3
| | | | | | | | As of 1.4 mobs have a flag to determine if they despawn when away from a player or not. Unfortunately animals still use their own system to prevent despawning instead of making use of this flag. This change modifies them to use the new system (defaults to true) and to add API for plugins to adjust this.
* Update CraftBukkit to Minecraft 1.4.4.Travis Watkins2012-11-13-221/+251
|
* Prevent health from wrapping around.EvilSeph2012-10-28-4/+6
|
* Update CraftBukkit to Minecraft 1.4(.2).Travis Watkins2012-10-27-319/+782
|
* Bulk pending cleanup.Wesley Wolfe2012-09-09-36/+36
|
* Optimize entity AI goal selectorTravis Watkins2012-08-19-4/+4
| | | | | | | | | | | Remove redundant ArrayList to avoid excessive object creation and CPU overhead, the entries are added to the list then immediately iterated through to run so just run them directly. Swap order of some conditionals to perform the more efficient check first as if it fails the list lookup will not be executed. Remove profiling hooks including some rather expensive calls to getSimpleName.
* Update CraftBukkit to Minecraft 1.3.1feildmaster2012-08-02-438/+406
|
* Cleaned up CraftBukkit comments in NMS.Wesley Wolfe2012-07-23-14/+8
| | | | | | | | | | | | | 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
* Add missing setLastDamageCause. Thanks MonsieurApplefeildmaster2012-07-13-1/+1
|
* Apply setLastDamageCause after processing events and the event has not been ↵feildmaster2012-07-02-0/+3
| | | | | | | | canceled. Fixes BUKKIT-1881 This allows previous causes to be available during the event, as well as making the damage cause a valid one. If EntityDamageEvent is canceled, then it's not the last DamageCause. Also prevents setting DamageCause involuntarily through construction.
* Update players when potion effects are moved from them. Fixes BUKKIT-789Travis Watkins2012-04-24-1/+1
|
* Avoid doing unnecessary range checks when we're looping from start to end.Travis Watkins2012-04-23-18/+14
| | | | | | | | | | | | | | | | | | 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.
* Optimize AI and EntityLiving tickingTravis Watkins2012-04-21-18/+28
| | | | | | | | Reduce usage of getCubes as it is an expensive call. Remove iterator usage and object creation from PathfinderGoalSelector methods as these are called very often. Update EntityLiving goal selectors less often as this is still quite an expensive task.
* Properly call EntityDeathEvent for mobs. Fixes BUKKIT-1519feildmaster2012-04-15-1/+12
|
* Updated to Minecraft version 1.2.4. Updated version string to 1.2.4-R0.1.Nathan Adams2012-03-22-62/+64
|
* [Bleeding] Account for new rare drops in EntityDeath events. Fixes BUKKIT-1105zerg9602012-03-21-8/+19
|
* Fixed EntityDamageByEntityEvent to call for every attackable entity. Fixes ↵feildmaster2012-03-15-1/+10
| | | | BUKKIT-1129, Fixes BUKKIT-1054 and Fixes BUKKIT-147.