Commit Graph
166 Commits
Author SHA1 Message Date
feildmaster dcb9d6a5ef Update CraftBukkit to 1.6.4 2013-09-19 20:01:02 -05:00
Wesley Wolfe 8a7c582d54 Ignore null sound by contract. Fixes BUKKIT-4641 2013-08-02 20:05:22 -05:00
h31ix f959530f6b Add raw sound string playSound method. Adds BUKKIT-2443
A method has been added to Player which allows the server to send a sound string to the client. Assuming the client has the specified sound, it will be played. This is needed by the implementation of the /playsound command.
2013-08-02 00:13:20 -05:00
T00thpick1 1192f2a53a Add API to control scaled health. Adds BUKKIT-4590
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
2013-07-23 21:52:17 -05:00
Wesley Wolfe adcb293a03 Fix scaling for player health. Fixes BUKKIT-4431 2013-07-02 23:09:43 -05:00
Nate Mortensen 6c09066e22 Update CraftBukkit to 1.6.1 2013-07-01 12:10:06 -05:00
Wesley Wolfe 7939572c33 Check connection status before setting scoreboard. Fixes BUKKIT-4064
Two connection status checks were added to setting a scoreboard for a
player. The first checks to see if a player has logged in yet, which
implicates the ability to receive packets. The second checks to affirm
that the CraftPlayer reference is still to a logged in player; setting
it while not logged in would maintain a stale player reference in the
scoreboard manager.
2013-04-12 21:31:24 -05:00
mbax d95a4705cb Implement Scoreboard API. Adds BUKKIT-3776
This implementation facilitates the correspondence of the Bukkit Scoreboard
API to the internal minecraft implementation.

When the first scoreboard is loaded, the scoreboard manager will be created.
It uses the newly added WeakCollection for handling plugin scoreboard
references to update the respective objectives. When a scoreboard contains no
more active references, it should be garbage collected.

An active reference can be held by a still registered objective, team, and
transitively a score for a still registered objective. An internal reference
will also be kept if a player's specific scoreboard has been set, and will
remain persistent until that player logs out.

A player's specific scoreboard becomes the scoreboard used when determining
team structure for the player's attacking damage and the player's vision.
2013-04-04 01:13:21 -05:00
Travis Watkins 5f089137ee Cleanup comments, formatting, etc 2013-03-25 00:51:36 -05:00
T00thpick1 1bde25bb33 Implement per-player Weather API. Adds BUKKIT-812 2013-03-18 13:03:54 -05:00
Andrzej Pomirski 993e19b3fb Close inventory on teleport. FIXES BUKKIT-3021. 2013-02-10 17:22:34 -06:00
James Clarke 4d3865a036 Fix players spawning above portals. Fixes BUKKIT-3542.
Vanilla does not check for blocks in which the player could
suffocate when changing dimension, so portals will happily spawn
players in blocks when using a portal under certain
circumstances. However, we currently check for these instances
and move the player up until they will not suffocate. This means
that players can sometimes be taken to above the target portal,
making it seem as if a portal was not created. Instead, we now
disable this suffocation check when moveToWorld is called from
changeDimension, mirroring vanilla behavior more accurately.
2013-02-04 18:53:05 -06:00
feildmaster b4b7cacf5e Fix NPE when getting bed spawn location. 2013-01-29 17:25:39 -06:00
feildmaster 37975946a2 Fix contract with Player.getBedSpawnLocation. Fixes BUKKIT-3525
Getting the bed spawn location is supposed to check if the bed is
valid, however, it currently did not do so.
2013-01-29 10:11:57 -06:00
feildmaster e59af9908b Update CraftBukkit to Minecraft 1.4.7 2013-01-17 03:50:24 -06:00
feildmaster 7b5a8d0c23 Don't teleport entities that are considered dead. Addresses BUKKIT-1331
Teleportation should never be processed on dead entities. If you wish
to teleport an entity, do it on a living entity. If you wish to
teleport a player, set their respawn location in PlayerRespawnEvent.
2012-12-29 19:18:36 -06:00
feildmaster ced0646351 Implement entity max health methods. Adds BUKKIT-266 2012-12-23 07:29:06 -06:00
Wojciech Stryjewski f377a7680f Add API to allow plugins to request players switch to a texture pack. Adds BUKKIT-2579
The setTexturePack method causes the player's client to
download and switch to a texture pack specified by a URL.

Note: Players can disable server textures on their client, in which
case this API would not affect them.
2012-12-20 22:09:38 -05:00
feildmaster 23b6764374 Update CraftBukkit to Minecraft 1.4.6 2012-12-20 10:43:00 -06:00
EdGruberman f18b3cdc76 [Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500 2012-12-10 01:40:20 -06:00
feildmaster 71b0510f88 Fix teleporting entities with vehicles/passengers teleporting you illegally. Fixes BUKKIT-2821
Also some formatting...
2012-11-20 19:41:56 -05:00
Wesley Wolfe d039986be7 No teleporting people back into the server. Fixes BUKKIT-2298
Stale player references will add a player back into the world when
teleporting them, causing a cascade of issues relating to ghost entities
and servers failing to stop.
2012-11-19 21:38:31 -06:00
EvilSeph 3047a424bb Expose API for giving and taking experience levels for use with ExpCommand's new behaviour with Minecraft 1.4. Adds BUKKIT-2739 2012-10-29 23:18:37 -04:00
Travis Watkins 60819c6693 Update CraftBukkit to Minecraft 1.4(.2). 2012-10-27 22:19:03 -04:00
Travis Watkins 506a1a0765 Ensure entity isn't destroyed when trying to show it. Fixes BUKKIT-2038
If two players (or a player and any other entity) are teleported to the
same location in the same tick they will both get added to the other's
destroy queue then have a new entity spawn packet sent. Next tick the
destroy queue will be processed and they will then be invisible to each
other. To prevent this situation we remove the entity from the destroy
queue when sending out a spawn packet for them.
2012-10-13 15:27:45 -05:00
Travis Watkins b5580b6d95 Remove player from destroy queue when they go visible. Fixes BUKKIT-2071
If a plugin calls player.hidePlayer(other); then player.showPlayer(other);
in the same tick the other player will be added to the entity destroy queue
then a spawn packet will be sent. On the next tick the queue will be
processed and a destroy packet will be sent that renders the other player
invisible. To correct this we ensure the destroy queue is in sync with use
of the vanish API.
2012-09-28 14:53:28 -05:00
Wesley Wolfe 03f12497b2 Map org.bukkit.Sound to String values for sending to client.
This change was done to remove the internal sound names from the API.
Along with moving the internal names into CraftBukkit, a unit test was
added for any new sounds added in the API to assure they have a non-null
mapping.
2012-09-26 19:02:05 -04:00
Wesley Wolfe e2b1514daf Bulk pending cleanup. 2012-09-09 23:19:28 -05:00
feildmaster 161ab5edc6 Implement API for Sound, and playing the sounds for Worlds and Players. Adds BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019 2012-08-21 19:13:19 -05:00
Wesley Wolfe 342f9c3bd3 Implement player speed API. Addresses BUKKIT-2205 2012-08-10 00:00:04 -05:00
Wesley Wolfe 02d6703da7 Implement new AsyncPlayerChatEvent. Addresses BUKKIT-2064
Added two utility collections for use with PlayerChatEvents allowing lazier
initialization of events and less need to synchronize against the player
list.

Provided a hidden queue system for similar logic to pre-1.3 chat. When a
plugin is listening for the deprecated PlayerChatEvent, all chat will be
delayed to be mirror executed from the main thread. All developers are
encouraged to immediately update to the developmental Bukkit chat API as a
minimum transition for server stability.

Additionally, changes were required to bring thread-safety to the flow
logic. CopyOnWriteArrayList is the only viable means to produce thread
safety with minimal diff; using a sane pre-implemented collection would
require reworking of sections of NMS logic.

As a minor change, implemented expected functionality for
PlayerCommandPreProcessEvent. Setting the player should now change the
player executing the command.
2012-08-03 23:44:45 -05:00
feildmaster a43d621c01 Update CraftBukkit to Minecraft 1.3.1 2012-08-02 04:58:50 -05:00
feildmaster dba9349ed4 Factor invulnerableTicks into getNoDamageTicks. Fixes BUKKIT-1324 2012-07-04 15:12:29 -05:00
Wesley Wolfe 57763845d0 Implement plugin channel events. Addresses BUKKIT-1844 2012-06-21 02:39:59 -05:00
Wesley Wolfe c43012ef1c Fixed broken hashCode() 2012-05-24 23:01:33 -05:00
Travis Watkins c1bc0df718 Add in checks for potential NPEs. Fixes BUKKIT-1706 and BUKKIT-1590. 2012-05-24 19:12:56 -05:00
feildmaster 2f976705be Revert "Fix potential NPE in vanish API. Fixes BUKKIT-1541"
This reverts commit ebf121800bd3161e4af0f6d9229ccb39c31fc278.

If the handle ever becomes null we need to know about it so we can debug it further.
2012-04-27 12:48:40 -05:00
feildmaster 99aeb32d0d Remove Player cache and edit CraftPlayer.equals to account for EntityID. Fixes BUKKIT-1541 and Addresses BUKKIT-761 2012-04-27 12:33:40 -05:00
Travis Watkins 9c12dc0ef8 Fix potential NPE in vanish API. Fixes BUKKIT-1541 2012-04-24 21:57:54 -04:00
feildmaster 1dcb39074d Persist PlayerDeathEvent values. Fixes BUKKIT-1521 2012-04-14 00:30:39 -05:00
Nathan Adams 942c1c6a3e Fixed incorrect assigning to isFlying when toggling setAllowedFlight(false) 2012-03-23 14:41:53 +00:00
Nathan Adams 8fb141bfa0 Implemented new player flight methods. This implements BUKKIT-1281. This also fixes BUKKIT-1146. 2012-03-22 22:04:13 +00:00
Kevin Ingersoll 49ff166d15 Fixed potential packet loss issue with vanish API. Fixes BUKKIT-1125 2012-03-10 23:19:15 -05:00
rmichela b5e92871eb [Bleeding] Added ConversationAbandonedEvent and supporting infrastructure. Whenever a conversation exits, the ConversationAbandonedEvent is triggered with details about how the conversation ended and what, if anything caused it to end. Fixes BUKKIT-986 2012-03-08 01:29:49 -05:00
Nathan Adams 543c4879fe Updated CraftBukkit to 1.2 2012-03-01 14:38:31 +00:00
rmichela 1161de3f63 [Bleeding] Added Conversations API. Addresses BUKKIT-864 2012-03-01 04:33:59 -05:00
rmichela 818a61040e [Bleeding] Added Help API. Addresses BUKKIT-863 2012-03-01 04:33:58 -05:00
Erik Broes 33ba9f0a2f Updated to rename revision 02 2012-03-01 01:12:41 +00:00
Celtic Minstrel 0842bab48b [Bleeding] Implementation of inventory framework. Addresses BUKKIT-856
See the corresponding Bukkit commit for details.

Implementation details:
- Any packets that include an itemstack will send air stacks as null; maybe this will even eliminate the client crash that occurs if the client receives an air stack
- Better handling of null itemstacks in general (ie less converting them to air stacks)
- Inventory.setContents() can now take an array smaller than the inventory without error
- Player.updateInventory() should now correctly update the result slot in a crafting inventory

Some small credit goes to Afforess (initial implementation of openInventory() methods) and Drakia (initial implementation of InventoryOpenEvent and InventoryCloseEvent).
2012-02-29 15:19:07 -05:00
Celtic Minstrel d20091e64c Implementation of richer playEffect methods. Addresses BUKKIT-857 2012-02-29 14:59:27 -05:00