Commit graph

1329 commits

Author SHA1 Message Date
CraftBukkit/Spigot
9fdae1c35b Update CraftBukkit to Minecraft 1.5.2
By: Travis Watkins <amaranth@ubuntu.com>
2013-04-27 04:40:05 -05:00
CraftBukkit/Spigot
f06e7acda5 Rework EntityExplodeEvent. Fixes BUKKIT-4140. Adds BUKKIT-4141
By: Wesley Wolfe <weswolf@aol.com>
2013-04-24 03:03:38 -05:00
CraftBukkit/Spigot
42fab40633 Updated version to 1.5.1-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2013-04-13 02:58:41 -04:00
CraftBukkit/Spigot
dc92f110ad Updated version to 1.5.1-R0.2 in pom.xml for BETA.
By: EvilSeph <evilseph@gmail.com>
2013-04-13 02:47:51 -04:00
CraftBukkit/Spigot
e8b9ca83cb 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.

By: Wesley Wolfe <weswolf@aol.com>
2013-04-12 21:31:24 -05:00
CraftBukkit/Spigot
1ec94b52c1 Use correct method for getting player's team. Fixes BUKKIT-4050
The method getTeam gets the team from name of, as opposed to getting the
team a player belongs to.

This also addresses BUKKIT-4002 and partially BUKKIT-4044

By: Wesley Wolfe <weswolf@aol.com>
2013-04-11 23:03:37 -05:00
CraftBukkit/Spigot
868456b95f Refactor EntityDamageEvents. Adds BUKKIT-1944 & BUKKIT-3684
By: feildmaster <admin@feildmaster.com>
2013-04-09 22:25:06 -05:00
CraftBukkit/Spigot
76976e4797 Make auxiliary worlds use the main scoreboard. Addresses BUKKIT-3984
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

By: Wesley Wolfe <weswolf@aol.com>
2013-04-04 23:35:16 -05:00
CraftBukkit/Spigot
c8eaad4f3f We compile for 1.5
By: Wesley Wolfe <weswolf@aol.com>
2013-04-04 01:22:50 -05:00
CraftBukkit/Spigot
09f861ef48 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.

By: mbax <matt@phozop.net>
2013-03-22 17:21:33 -04:00
CraftBukkit/Spigot
27e7fa2e01 Add a WeakCollection utility class.
This class is designed to be an invisible layer between a normal collection,
and one that silently loses entries because they are only weakly referencable.
Some operations have additional overhead to be semantically correct, but it
maintains the equals contract for all entries, as opposed to identity.

It does not support the equals or hash code method as it cannot easily have
the transitive and commutative properties.

By: Wesley Wolfe <weswolf@aol.com>
2013-04-02 07:52:17 -05:00
CraftBukkit/Spigot
2807928047 Updated version to 1.5.1-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2013-04-04 00:18:59 -04:00
CraftBukkit/Spigot
f80357d61e Updated version to 1.5.1-R0.1 in pom.xml for BETA.
By: EvilSeph <evilseph@gmail.com>
2013-04-03 22:40:36 -04:00
CraftBukkit/Spigot
aa06a5ace1 Properly return contents of Inventory. Fixes BUKKIT-3930
When an array of an inventory's contents is requested, we loop through the contents of the NMS inventory's ItemStacks in order to return Bukkit ItemStacks that can be used through the API. However, the NMS ItemStack can, in some cases, be larger than the physical size of the inventory. Using the size of the NMS array as a limit on the loop that follows can result in an ArrayIndexOutOfBoundsException because the Bukkit array's length is the actual size of the inventory, and thus will be smaller.

With this commit we use the smaller of the two arrays' length as the limit in the loop, thus eliminating the possibility that the smaller array will be asked for an index higher than its length.

By: h31ix <zero_gravity@outlook.com>
2013-03-29 22:43:05 -04:00
CraftBukkit/Spigot
94c1d44d57 Don't update physics when block place is cancelled. Fixes BUKKIT-3939
When a block placement happens we currently update physics on the
attempted placement and update again if the placement is cancelled.
To correct the first one we simply set the block without applying
physics. To correct the second we have to add a new method to
BlockState that lets us update without applying physics and use
this method method when putting the block back.

By: Travis Watkins <amaranth@ubuntu.com>
2013-03-31 19:18:42 -05:00
CraftBukkit/Spigot
b845332f14 Correct slot types for brewing stand. Fixes BUKKIT-3937
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-31 18:41:36 -05:00
CraftBukkit/Spigot
2772c52bf3 Throw exception for disabled plugin tasks. Fixes BUKKIT-3951
Without this check, any non-null reference to a plugin is considered
'valid' for registering a task in the scheduler. This is obviously
unintentional behavior and has been changed to throw an
IllegalPluginAccessException. It is now consistent with the
SimplePluginManager event registration contract.

This in affect also addresses BUKKIT-3950 for uninitialized plugin
references (ones without a description).

By: Wesley Wolfe <weswolf@aol.com>
2013-03-31 15:37:17 -05:00
CraftBukkit/Spigot
cd79fecc90 Include anvil result in inventory size. Fixes BUKKIT-3741
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-30 02:51:26 -05:00
CraftBukkit/Spigot
504a6af6e8 Add Beacon block state for hopper events. Fixes BUKKIT-3932
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-29 22:26:27 -05:00
CraftBukkit/Spigot
f84dc2d381 Properly copy collection references in ItemMeta.clone(). Fixes BUKKIT-3913
When cloning an item, all references are copied to the new item. For
collections, this makes internal changes become visible in both the old and
new items.

In CraftMetaItem, clone was not making copies of the appropriate collections
and has been fixed for non-null values.

In CraftMetaEnchantedBook and CraftMetaPotion, clone was using possible empty
collection references and has been changed to explicitly null-check instead.

By: Wesley Wolfe <weswolf@aol.com>
2013-03-28 20:01:01 -05:00
CraftBukkit/Spigot
3c6a12547b Improve calling of ProjectileHitEvent. Fixes BUKKIT-3872
By: Andre LeBlanc <andre@norcode.com>
2013-03-23 12:16:00 -04:00
CraftBukkit/Spigot
10245ce119 Allow fishing success rate to be adjustable. Adds BUKKIT-3837
By: Andre LeBlanc <andre@norcode.com>
2013-03-20 11:48:35 -04:00
CraftBukkit/Spigot
afa8771324 Add methods to check conflicting enchantments. Adds BUKKIT-3830
By: GJ <gjmcferrin@gmail.com>
2013-03-20 01:35:22 -04:00
CraftBukkit/Spigot
56947c94a9 Cleanup comments, formatting, etc
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-24 23:22:32 -05:00
CraftBukkit/Spigot
f0a4f87f80 Add ability to change player item in hand. Adds BUKKIT-3318
By: Patrick Seidel <psycowithespn1@aim.com>
2012-12-27 16:30:08 -05:00
CraftBukkit/Spigot
4f70ebc8b7 Add check for Thorns damage - Fixes BUKKIT-3505
By: riking <rikingcoding@gmail.com>
2013-03-23 19:41:33 -07:00
CraftBukkit/Spigot
329ac32171 Include ThrownPotion in spawn methods. Adds BUKKIT-2542
By: Carlos Cobo <toqueteos@gmail.com>
2013-03-23 15:28:23 +01:00
CraftBukkit/Spigot
6841600fbf Identify outside slot independent of inventory type. Fixes BUKKIT-2768
By: EdGruberman <ed@rjump.com>
2013-02-21 14:22:09 -07:00
CraftBukkit/Spigot
04d0f1b0b5 ANSI color codes now reset text attributes. Fixes BUKKIT-3508
The client resets all formatting after a color code is received, but currently the ANSI codes do not, and so the console does not accurately reflect the appearance of the formatted text. Instead, the ANSI color codes are now set to reset all text attributes.

By: James Clarke <jamesrtclarke@me.com>
2013-01-26 10:39:45 +00:00
CraftBukkit/Spigot
e76d070e9d Implement Dropper interface. Adds BUKKIT-3750
By: Xephi <xephirot59@gmail.com>
2013-03-21 13:43:10 +01:00
CraftBukkit/Spigot
0a6888a54f Stationary lava is also a LAVA ignition cause.
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-21 16:59:45 -05:00
CraftBukkit/Spigot
d9c6b90716 Add ability to modify ThrownPotion properties. Adds BUKKIT-3197
By: Olof Larsson <olof@sylt.nu>
2012-12-17 09:45:30 +01:00
CraftBukkit/Spigot
f60d880814 Add method to get the source of a TNTPrimed. Adds BUKKIT-3815
By: AlphaBlend <whizkid3000@hotmail.com>
2013-03-21 12:47:46 -06:00
CraftBukkit/Spigot
7d58945ede Ignore all .DS_Store files, not just the one in the project root.
By: James Clarke <jamesrtclarke@me.com>
2013-01-26 11:06:26 +00:00
CraftBukkit/Spigot
a553ddbb0b Implement unit test for hasGravity(). Adds BUKKIT-3832
By: nitnelave <nitnelave1@gmail.com>
2013-02-15 02:38:34 +01:00
CraftBukkit/Spigot
062ad22168 Update CraftBukkit to Minecraft 1.5.1
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-20 15:09:23 -05:00
CraftBukkit/Spigot
eabf3db614 BlockState for Command Blocks. Adds BUKKIT-3805.
By: Nate Mortensen <nate.richard.mortensen@gmail.com>
2013-03-18 00:32:11 -06:00
CraftBukkit/Spigot
b9af9ef239 Validate Server method input. Addresses BUKKIT-3687
CraftServer methods that implement the Server interface will throw an
IllegalArgumentException if a method cannot operate on a null input
and given a null pointer.

This causes methods to fail early and identify that a plugin is
responsible for passing in an invalid argument. This will only
change the exception thrown, if there originally was a thrown
exception. This helps with hunting down legitimate problems
with CraftBukkit.

By: Edmond Poon <sagaciouszzzz@gmail.com>
2013-03-18 23:32:10 -06:00
CraftBukkit/Spigot
2481936906 Remove point about squashing commits.
By: Warren <evilseph@gmail.com>
2013-03-18 23:49:15 -03:00
CraftBukkit/Spigot
582e158766 Add link to CONTRIBUTING.md in README
By: Kane York <rikingcoding@gmail.com>
2013-03-18 19:26:15 -07:00
CraftBukkit/Spigot
a804a206e7 Pull Contributing Guidelines and Requirements into CONTRIBUTING.md
By: EvilSeph <evilseph@gmail.com>
2013-03-18 22:09:02 -04:00
CraftBukkit/Spigot
4c1cb5c8a7 Implement per-player Weather API. Adds BUKKIT-812
By: T00thpick1 <t00thpick1dirko@gmail.com>
2012-12-20 16:51:27 -05:00
CraftBukkit/Spigot
206334875b Implement new cause versions of BlockIgniteEvent. Addresses BUKKIT-3609, BUKKIT-3656, BUKKIT-3657
By: Yariv Livay <yarivlivay@gmail.com>
2013-03-17 22:46:48 +02:00
CraftBukkit/Spigot
9262bc5393 Make CraftMinecartHopper work as InventoryHolder. Adds BUKKIT-3796
By: Michael Limiero <mike5713@gmail.com>
2013-03-17 15:50:34 -04:00
CraftBukkit/Spigot
e3356c9896 Implement Entity.isOnGround(). Adds BUKKIT-3787
By: Chad Waters <authorblues@gmail.com>
2013-03-17 11:51:11 -04:00
CraftBukkit/Spigot
2cad34e872 Use name given to command block instead of "@". Fixes BUKKIT-3803
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-17 20:18:11 -05:00
CraftBukkit/Spigot
002dd2b7cd Implement Hopper block state and inventory methods. Adds BUKKIT-3749
By: Michael Limiero <mike5713@gmail.com>
2013-03-16 00:46:35 -04:00
CraftBukkit/Spigot
f48f89f433 Handle double trapped chest inventory. Fixes BUKKIT-3772
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-16 17:14:21 -05:00
CraftBukkit/Spigot
639ef2bd3c Use Chest block state for trapped chests. Fixes BUKKIT-3762
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-16 09:46:32 -05:00
CraftBukkit/Spigot
7e0364660a Limit mob names to 64 chars to avoid client crash. Fixes BUKKIT-3753
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-16 08:31:03 -05:00
CraftBukkit/Spigot
afd0b4899b Handle the newly refactored minecarts.
By: Wesley Wolfe <weswolf@aol.com>
2013-03-15 23:09:04 -05:00
CraftBukkit/Spigot
bb2baf6ba7 Use proper naming convention for boolean methods.
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-15 14:25:37 -05:00
CraftBukkit/Spigot
18164ee949 Update CraftBukkit to Minecraft 1.5
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-13 17:33:27 -05:00
CraftBukkit/Spigot
0d9124396f Close inventory on teleport. FIXES BUKKIT-3021.
By: Andrzej Pomirski <andrzejp@dysleksja.pl>
2013-02-09 23:38:53 +01:00
CraftBukkit/Spigot
d748630f56 Set CraftTravelAgent.DEFAULT to a non-null value. Fixes BUKKIT-3578
Currently, CraftTravelAgent will call s() on the passed-in WorldServer in order to set DEFAULT. However, s() will always return null at this point, because WorldServer.P will still be null, as it is set after the constructor is called. Instead, we set CraftTravelAgent.DEFAULT to the instance that is being constructed.

By: James Clarke <jamesrtclarke@me.com>
2013-02-05 20:34:02 +00:00
CraftBukkit/Spigot
17edfeaed3 Use entity UUID instead of EntityID for metadata. Fixes BUKKIT-3582
The entity id is a non-unique, non-persistent value, and will cause
entities to lose their respective meta data on chunk unloading, and
teleportation.

By: feildmaster <admin@feildmaster.com>
2013-02-06 16:32:19 -06:00
CraftBukkit/Spigot
9250e88d04 Always return a TravelAgent; Fixes BUKKIT-3541
Recent changes caused PlayerPortalEvent to suddenly return null
unexpectedly and could end up in NPEs resulting that did not before.
This commit addresses that situation by always ensuring a TravelAgent
instance is returned.

The TravelAgent for world 0 is returned arbitrarily in an effort to
compensate for plugins that are implementation dependent and expect some
form of a TravelAgent to be accessible in the event at all times.

By: EdGruberman <ed@rjump.com>
2013-02-03 12:55:51 -07:00
CraftBukkit/Spigot
20ddd83f9a 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.

By: James Clarke <jamesrtclarke@me.com>
2013-02-03 00:32:07 +00:00
CraftBukkit/Spigot
4c1273e8a6 Updated version to 1.4.7-R1.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2013-01-30 23:44:50 -05:00
CraftBukkit/Spigot
9b6db31880 Updated version to 1.4.7-R1.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2013-01-30 23:32:21 -05:00
CraftBukkit/Spigot
067842730b Fix NPE when getting bed spawn location.
By: feildmaster <admin@feildmaster.com>
2013-01-29 17:25:39 -06:00
CraftBukkit/Spigot
88e050668f 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.

By: feildmaster <admin@feildmaster.com>
2013-01-29 10:03:05 -06:00
CraftBukkit/Spigot
2c6b6e11dd Remove erroneous break statement in scheduler. Fixes BUKKIT-3395
By: Wesley Wolfe <weswolf@aol.com>
2013-01-27 23:00:14 -06:00
CraftBukkit/Spigot
552cff7d15 Update Fireballs to account for ExplosionPower. Fixes BUKKIT-3460
Adds BUKKIT-3516

By: feildmaster <admin@feildmaster.com>
2013-01-27 14:46:58 -06:00
CraftBukkit/Spigot
78e16bd8de Compensate for allow-nether/allow-end as false; Fixes BUKKIT-3466
When either of those settings are false, the worlds are not loaded and
therefore will not be targeted for portal exits.  Existing worlds are
iterated directly to avoid defaulting to the first world if a direct
dimension match is not found.

Plugins must also specify exit from custom Bukkit worlds to comply with
original commit: https://github.com/Bukkit/CraftBukkit/commit/2dc2af0

This commit introduces a constant to clarify the dependency on the
CraftBukkit implementation of custom worlds having a dimension offset.

By: EdGruberman <ed@rjump.com>
2013-01-22 18:36:03 -07:00
CraftBukkit/Spigot
2cf54ae100 Reload ban files when reloading the server. Adds BUKKIT-3470
By: feildmaster <admin@feildmaster.com>
2013-01-23 06:24:40 -06:00
CraftBukkit/Spigot
5ff31d3a44 Fix broken null contract with Jukebox.setPlaying, Fixes BUKKIT-3429
The javadocs state that a null may be used to remove the currently
playing sound, however this causes a NullPointerException.

It also doesn't process registering the record correctly, along with
processing non-valid items.

By: feildmaster <admin@feildmaster.com>
2013-01-19 00:39:56 -06:00
CraftBukkit/Spigot
a7602dc993 [Bleeding] Add experimental support for entity portal traveling
By: EdGruberman <ed@rjump.com>
2012-12-22 11:46:24 -07:00
CraftBukkit/Spigot
5948863935 Improve the item meta deserialization code-style
Fixed the ItemMetaFireworkTest

Add set power unit tests for FireworkMeta

By: Wesley Wolfe <weswolf@aol.com>
2013-01-18 02:21:38 -06:00
CraftBukkit/Spigot
41d42b7388 Updated version to 1.4.7-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2013-01-17 05:30:48 -05:00
CraftBukkit/Spigot
beefddd3af Updated version to 1.4.7-R0.1 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2013-01-17 05:15:55 -05:00
CraftBukkit/Spigot
c529b1d5ec Update CraftBukkit to Minecraft 1.4.7
By: feildmaster <admin@feildmaster.com>
2013-01-17 03:28:44 -06:00
CraftBukkit/Spigot
58a6642ca7 Add ItemStackMapTest
This test was missing from c056293b38cb9a1296937d91746b175252be044a

By: Wesley Wolfe <weswolf@aol.com>
2013-01-15 01:22:53 -06:00
CraftBukkit/Spigot
6a7b6e848a Various ItemMeta fixes.
Fixes BUKKIT-3408, BUKKIT-3190, BUKKIT-3191, BUKKIT-3407

These changes relate mostly to semantical changes for serialization
contract, exception of changing the map scaling value from byte to boolean,
what it should have been in the first place. Appropriate unit tests were
added for CraftMapMeta, as they were missing.

By: Wesley Wolfe <weswolf@aol.com>
2013-01-09 04:45:01 -06:00
CraftBukkit/Spigot
58090423c0 Update unit test to reflect firework color fix. Fixes BUKKIT-3382
The ItemDye color-int array uses dye data values, not wool.

By: Wesley Wolfe <weswolf@aol.com>
2013-01-05 17:00:25 -06:00
CraftBukkit/Spigot
e9c52a3ffc Update calls to DyeColor getData and getByData. Addresses BUKKIT-2786
These two methods are now deprecated and replaced by the strictly
equivalent calls using wool data.

By: Wesley Wolfe <weswolf@aol.com>
2013-01-05 16:45:34 -06:00
CraftBukkit/Spigot
1e7d13dfee Fix "setSitting" on tameable animals. Fixes BUKKIT-1534
This makes it so animals (tame or not) will sit properly and not move
around.

Wild animals that are sitting may override the sitting position if
they are attacking.

By: feildmaster <admin@feildmaster.com>
2012-12-31 14:00:55 -06:00
CraftBukkit/Spigot
6e6615acfa Updated version to 1.4.6-R0.4-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-12-31 01:14:07 -05:00
CraftBukkit/Spigot
74d0a068bc Updated version to 1.4.6-R0.3 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-12-31 01:00:18 -05:00
CraftBukkit/Spigot
f6a5e7a473 Updated version to 1.4.6-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-12-29 22:27:49 -05:00
CraftBukkit/Spigot
a87401e1b6 Updated version to 1.4.6-R0.2 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-12-29 22:19:49 -05:00
CraftBukkit/Spigot
0f73c817f9 Return the level, not ID. Fixes BUKKIT-3326
CraftItemStack was erroneously using the enchantment ID instead of level
for the return value of remove enchantment.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-29 20:53:27 -06:00
CraftBukkit/Spigot
ef64b8dd33 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.

By: feildmaster <admin@feildmaster.com>
2012-12-27 19:22:28 -06:00
CraftBukkit/Spigot
e895c1e420 [Bleeding] Implement periodic chunk garbage collector
This adds two settings to bukkit.yml, allowing activation and control of
two chunk garbage collection triggering conditions:
chunk-gc/period-in-ticks controls a periodic GC, run once every N ticks
(default is 600); chunk-gc/load-threshold causes the GC to run once
after every N calls to loadChunk() on a given world (this call is an API
call used by plugins, and is distinct from the path taken for routine
player movement-based loading).  In both cases, setting to zero will
disable the given GC scheduling strategy.

In either case, the act of doing the GC is simply one of scanning the
loaded chunks, seeing which are NOT being used by one or more players
(due to view-distance) and which are not already queued for unload, and
queueing them for a normal unload.  Ultimately, the unload is then
processed the same as if the chunk were unloaded due to leaving the
view-distance range of all players, so the impact on plugins should be
no different (and strategies such as handling the ChunkUnloadEvent in
order to prevent unload will still work).

The initial interval for the periodic GC is randomized on a per-world
basis, in order to avoid all world being GCed at the same time -
minimizing potential lag spikes.

By: Mike Primm <mike@primmhome.com>
2012-12-10 09:38:26 -06:00
CraftBukkit/Spigot
be291480fc Fix persistence on tamed pets. Fixes BUKKIT-3300
With the persistence api introduced, pets did not have their
persistence flag updated to reflect their persistence. This caused
tame ocelots to not persist under specific conditions.

By: feildmaster <admin@feildmaster.com>
2012-12-28 20:27:41 -06:00
CraftBukkit/Spigot
2d0ea62fb2 Fix removing enchantments causing the enchantment tag to remain.
By: feildmaster <admin@feildmaster.com>
2012-12-27 20:48:56 -06:00
CraftBukkit/Spigot
4bd54dfd92 Fix discrepancies in NBT and ItemMeta. Fixes BUKKIT-3279
An ItemStack gains the tag name "tag" when the stack is serialized
to NBT, however items don't have a tag *until* they are serialized at
least once. So to solve this, we remove the tag name when loading the
NBT data.

Another problem with NBT are TagLists, when transferring tag lists
between the server and the client the names are lost, and so we
simply don't add a name to the tag.

By: feildmaster <admin@feildmaster.com>
2012-12-27 20:45:21 -06:00
CraftBukkit/Spigot
53d28c0e26 Fix Skull BlockState setting illegal values on owner.
By: feildmaster <admin@feildmaster.com>
2012-12-24 14:32:08 -06:00
CraftBukkit/Spigot
28034e5c5c Fix fireworks being short lived. Fixes BUKKIT-3291
By: feildmaster <admin@feildmaster.com>
2012-12-23 17:06:26 -06:00
CraftBukkit/Spigot
3e4f7af5c8 Properly update fireworks. Fixes BUKKIT-3289
By: feildmaster <admin@feildmaster.com>
2012-12-23 08:59:15 -06:00
CraftBukkit/Spigot
8dcc915237 Implement entity max health methods. Adds BUKKIT-266
By: feildmaster <admin@feildmaster.com>
2012-12-23 05:49:03 -06:00
CraftBukkit/Spigot
f1cc082ee0 Report valid health when getting Entity health. Fixes BUKKIT-3210
By: feildmaster <admin@feildmaster.com>
2012-12-23 07:16:59 -06:00
CraftBukkit/Spigot
eeded7f6fd Remove runner leak on async tasks. Fixes BUKKIT-3288
In some situations, an async task could be cancelled with no tasks
pending. This means the finally {} block from run() never gets executed
properly on the last async task to have run, as it expected to be
executed again.

This fix takes the only spot that the task period is set to cancelled
and will check to see if the task should be purged from the runners
list.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-23 05:13:33 -06:00
CraftBukkit/Spigot
ce8e581ffc Update firework power when modifying meta. Fixes BUKKIT-3272
By: Travis Watkins <amaranth@ubuntu.com>
2012-12-22 13:05:55 -06:00
CraftBukkit/Spigot
2c5dd716bb Allow fireworks to be created. Adds BUKKIT-3262
By: feildmaster <admin@feildmaster.com>
2012-12-22 02:57:28 -06:00
CraftBukkit/Spigot
46b51ce858 Updated version to 1.4.6-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-12-22 01:24:14 -05:00
CraftBukkit/Spigot
41a65d9a91 Updated version to 1.4.6-R0.1 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-12-22 01:12:16 -05:00
CraftBukkit/Spigot
d21d3199b9 Implement API to get and set FireworkMeta on Firework entities
By: feildmaster <admin@feildmaster.com>
2012-12-21 23:56:54 -06:00
CraftBukkit/Spigot
01e087c5d5 Implement Skull BlockState. Adds BUKKIT-3259
By: meiskam <meiskam@gmail.com>
2012-12-21 18:44:56 -05:00
CraftBukkit/Spigot
e8a36e2744 Zero is not less than zero. Fixes BUKKIT-3259
By: Wesley Wolfe <weswolf@aol.com>
2012-12-21 21:48:09 -06:00
CraftBukkit/Spigot
f23414917d Update enchantment handling to 1.4.6. Fixes BUKKIT-3256
By: feildmaster <admin@feildmaster.com>
2012-12-21 18:52:39 -06:00
CraftBukkit/Spigot
a04364f6a7 Use max inventory size for new stack. Fixes BUKKIT-3240
By: Wesley Wolfe <weswolf@aol.com>
2012-12-21 11:10:23 -06:00
CraftBukkit/Spigot
5d61bfd5fa Implement 1.4.6 ItemMeta. Adds BUKKIT-3236, BUKKIT-3237
Some meta functionality is refactored into common methods.

CraftItemStack uses the ItemMetaKey identifiers for enchantments.

Refactored unit test to include extra functionality; initially only
checking the presence of the DelegateDeserialization annotation.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-21 07:37:53 -06:00
CraftBukkit/Spigot
b5940b64f6 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.

By: Wojciech Stryjewski <thvortex@gmail.com>
2012-10-09 15:57:39 -05:00
CraftBukkit/Spigot
20287b2658 Fetch correct info for skulls in block.getDrops(). Fixes BUKKIT-3205
By: Travis Watkins <amaranth@ubuntu.com>
2012-12-20 15:06:01 -06:00
CraftBukkit/Spigot
7654f3c458 [Bleeding] Fix exception in getChunkSnapshot() - sky light can be null
By: Mike Primm <mike@primmhome.com>
2012-12-20 14:05:07 -06:00
CraftBukkit/Spigot
fde7669132 Update CraftBukkit to Minecraft 1.4.6
By: feildmaster <admin@feildmaster.com>
2012-12-19 22:03:52 -06:00
CraftBukkit/Spigot
d626642cc6 Updated version to 1.4.5-R1.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-12-19 06:15:47 -05:00
CraftBukkit/Spigot
43f73e5e11 Updated version to 1.4.5-R1.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-12-19 06:08:22 -05:00
CraftBukkit/Spigot
bae1b8659c Fix PotionMeta not applying the correct Id. Fixes BUKKIT-3193
By: feildmaster <admin@feildmaster.com>
2012-12-18 18:39:21 -06:00
CraftBukkit/Spigot
adb1c46137 Add missing name in PotionEffect for Wither
By: feildmaster <admin@feildmaster.com>
2012-12-18 18:20:11 -06:00
CraftBukkit/Spigot
0fcaa1ab6b Refactor get/setChestPlate to Chestplate. Addresses BUKKIT-3189
By: feildmaster <admin@feildmaster.com>
2012-12-18 03:40:39 -06:00
CraftBukkit/Spigot
a885a5f0ee Change enchantment comparisons to isSimilar. Fixes BUKKIT-3183
The purpose of the isSimilar method was designed to consider all NBT
data, not solely enchantments, without the need to have exact stack
size matches. The respective methods in CraftInventory were still
comparing enchantments instead of the ItemMeta.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-17 15:53:25 -06:00
CraftBukkit/Spigot
9aa9b8775a Clarify functionality in CraftInventory. Fixes BUKKIT-3097
Changes some NPEs to IllegalArgumentExceptions for exception consistency.

Contains(ItemStack, int) correctly calculates number of ItemStacks.

Adds a containsAtLeast(ItemStack, int) for finding a combined amount of a
single similar ItemStack.

Makes some utility methods private to prevent ambiguity in use.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-17 16:32:52 -06:00
CraftBukkit/Spigot
1d39ac678a Implement ItemFactory and ItemMeta values. Adds BUKKIT-15
By: Wesley Wolfe <weswolf@aol.com>
2012-12-17 01:31:41 -06:00
CraftBukkit/Spigot
9d7ccb79f2 ItemStack.asBukkitStack(null) should return Air. Fixes BUKKIT-3170
By: feildmaster <admin@feildmaster.com>
2012-12-15 01:33:14 -06:00
CraftBukkit/Spigot
30e0f5be63 Add isRecord and new material method tests.
Cleaned up all of the CraftBukkit tests, including moving some tests
from MaterialTest to PerMaterialTest.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-14 02:02:02 -06:00
CraftBukkit/Spigot
5e25b8cbe8 Fix EntityEquipment positions being reversed. Fixes BUKKIT-3157
By: deathmarine <josh@mcjoshmod.com>
2012-12-12 10:45:31 -05:00
CraftBukkit/Spigot
7f06ccfa0e Load chunks asynchronously for players.
When a player triggers a chunk load via walking around or teleporting there
is no need to stop everything and get this chunk on the main thread. The
client is used to having to wait some time for this chunk and the server
doesn't immediately do anything with it except send it to the player. At
the same time chunk loading is the last major source of file IO that still
runs on the main thread.

These two facts make it possible to offload chunks loaded for this reason
to another thread. However, not all parts of chunk loading can happen off
the main thread. For this we use the new AsynchronousExecutor system to
split chunk loading in to three pieces. The first is loading data from
disk, decompressing it, and parsing it in to an NBT structure.  The second
piece is creating entities and tile entities in the chunk and adding them
to the world, this is still done on the main thread. The third piece is
informing everyone who requested a chunk load that the load is finished.
For this we register callbacks and then run them on the main thread once
the previous two stages are finished.

There are still cases where a chunk is needed immediately and these will
still trigger chunk loading entirely on the main thread. The most obvious
case is plugins using the API to request a chunk load. We also must load
the chunk immediately when something in the world tries to access it. In
these cases we ignore any possibly pending or in progress chunk loading
that is happening asynchronously as we will have the chunk loaded by the
time they are finished.

The hope is that overall this system will result in less CPU time and
pauses due to blocking file IO on the main thread thus giving more
consistent performance. Testing so far has shown that this also speeds up
chunk loading client side although some of this is likely to be because
we are sending less chunks at once for the client to process.

Thanks for @ammaraskar for help with the implementation of this feature.

By: Travis Watkins <amaranth@ubuntu.com>
2012-11-30 02:49:19 -06:00
CraftBukkit/Spigot
c459e6fc06 Add utility class AsynchronousExecutor
This class is a general purpose task execution system, that uses stages
to separate processing blocks for asynchronous and synchronous
executions.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-12 03:54:11 -06:00
CraftBukkit/Spigot
38aca80dfa Missed a rename
By: feildmaster <admin@feildmaster.com>
2012-12-10 19:17:47 -06:00
CraftBukkit/Spigot
0ef3001c83 Add EntityEquipment API. Adds BUKKIT-3103
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

By: feildmaster <admin@feildmaster.com>
2012-12-09 00:09:48 -06:00
CraftBukkit/Spigot
1b990d9590 [Bleeding] Correct getEyeHeight value. Fixes BUKKIT-3130
By: h31ix <low_gravity@outlook.com>
2012-12-09 21:40:10 -05:00
CraftBukkit/Spigot
f1ce3ae037 Only display help aliases when there are aliases. Fixes BUKKIT-1621
By: feildmaster <admin@feildmaster.com>
2012-12-10 01:10:39 -06:00
CraftBukkit/Spigot
3785714b45 Pass null help values values as empty strings to HelpTopics
Fixes BUKKIT-2618 and BUKKIT-2561

By: feildmaster <admin@feildmaster.com>
2012-12-10 01:03:59 -06:00
CraftBukkit/Spigot
3f11c5df16 [Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500
By: EdGruberman <ed@rjump.com>
2012-12-09 17:37:37 -06:00
CraftBukkit/Spigot
7aea414399 Add isSolid() tests for each material
By: Wesley Wolfe <weswolf@aol.com>
2012-12-09 15:13:38 -06:00
CraftBukkit/Spigot
19171265b9 [Bleeding] Fix NPE in getBedSpawnLocation. Fixes BUKKIT-1949
By: EdGruberman <ed@rjump.com>
2012-07-24 21:23:33 -07:00
CraftBukkit/Spigot
7555571424 Correctly shoot arrows with the spawnArrow Method. Fixes BUKKIT-3116
By: Dark Arc <theexcel@rocketmail.com>
2012-12-06 20:38:23 -05:00
CraftBukkit/Spigot
90014b4094 Provide a faster way to get a location. Adds BUKKIT-3120
Currently when a plugin wants to get the location of something it calls
getLocation() which returns a new Location object. In some scenarios this
can cause enough object creation/destruction churn to be a significant
overhead. For this cases we add a method that updates a provided Location
object so there is no object creation done. This allows well written code
to work on several locations with only a single Location object getting
created.

Providing a more efficient way to set a location was also looked at but
the current solution is the fastest we can provide. You are not required
to create a new Location object every time you want to set something's
location so, with proper design, you can set locations with only a single
Location object being created.

By: Travis Watkins <amaranth@ubuntu.com>
2012-12-07 19:49:01 -06:00
CraftBukkit/Spigot
137f84d3b6 Use shooter constructor for Fireballs. Fixes BUKKIT-3121
Fixes fireballs exploding in the shooter's face and not having a shooter for the projectile. (Two birds with one stone!)

By: feildmaster <admin@feildmaster.com>
2012-12-06 18:36:40 -06:00
CraftBukkit/Spigot
0f71f7e6df Add the ability to launch WitherSkulls. Fixes BUKKIT-3106
By: feildmaster <admin@feildmaster.com>
2012-12-06 18:18:28 -06:00
CraftBukkit/Spigot
8497ec2d7c Implement API for wolves collar color. Adds BUKKIT-3109
By: feildmaster <admin@feildmaster.com>
2012-12-05 18:08:31 -06:00
CraftBukkit/Spigot
9be2656543 Not enough testing went into this, you can't have packages start with numbers.
By: feildmaster <admin@feildmaster.com>
2012-12-05 16:24:00 -06:00
CraftBukkit/Spigot
d73ea1b1e7 Refactor all OBC, libs, and NMS into versioned packages.
org.bukkit.craftbukkit and net.minecraft.server will now include the
minecraft version in the package name. As the internal implementations
are known to change dramatically, this refactor reduces the strain on
support requests due to version mismatching.

org.bukkit.craftbukkit.libs will also have version numbers for each
imported set of packages. These are not dictated by the minecraft
version number. This is done to prevent future incompatibilities.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-05 14:43:45 -06:00
CraftBukkit/Spigot
d54778d339 Add a custom shutdown message set in bukkit.yml. Addresses BUKKIT-3031
By: feildmaster <admin@feildmaster.com>
2012-12-03 19:32:44 -06:00
CraftBukkit/Spigot
8c0f05c6ef Allow placing blocks in spawn if ops.txt is empty. Fixes BUKKIT-3004
By: Travis Watkins <amaranth@ubuntu.com>
2012-12-05 04:59:42 -06:00
CraftBukkit/Spigot
41433805ad Fire EntityFormBlockEvent for FallingBlocks. Adds BUKKIT-3078
By: Wesley Wolfe <weswolf@aol.com>
2012-12-04 18:30:10 -06:00
CraftBukkit/Spigot
e506472f08 Implement API for mob despawn when away from players. Adds BUKKIT-2986
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-12-04 18:33:44 -06:00
CraftBukkit/Spigot
921c568632 [BREAKING] Update BlockFace directions. Fixes BUKKIT-1567, BUKKIT-3069
The answer is 42

By: feildmaster <admin@feildmaster.com>
2012-12-01 00:22:01 -06:00
CraftBukkit/Spigot
8b51d75b0f Add data values to EntityChangeBlockEvent. Adds BUKKIT-3077, BUKKIT-3076
This change affects Endermen and Silverfish, adding a data value for the block change event.

By: Wesley Wolfe <weswolf@aol.com>
2012-11-30 11:53:31 -06:00
CraftBukkit/Spigot
e15b0bb814 Updated version to 1.4.5-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-11-20 20:34:41 -05:00
CraftBukkit/Spigot
2c6fe63c20 Updated version to 1.4.5-R0.2 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-11-20 20:06:14 -05:00
CraftBukkit/Spigot
096ca091e1 Fix teleporting entities with vehicles/passengers teleporting you illegally. Fixes BUKKIT-2821
Also some formatting...

By: feildmaster <admin@feildmaster.com>
2012-11-20 18:15:00 -06:00
CraftBukkit/Spigot
35a4233999 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.

By: Wesley Wolfe <weswolf@aol.com>
2012-11-19 21:38:31 -06:00
CraftBukkit/Spigot
65f1456adc Updated version to 1.4.5-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-11-18 22:50:41 -05:00
CraftBukkit/Spigot
648e4f1b68 Updated version to 1.4.5-R0.1 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-11-18 22:40:13 -05:00
CraftBukkit/Spigot
4ef13fbc4c Don't do case lookups when we have the right case already.
This is a missed part of the original "[Bleeding] Use case from player data
for OfflinePlayer. Fixes BUKKIT-519" commit. It avoids doing (somewhat
expensive) lookups of player data to find the correct capitalization inside
getOfflinePlayers() as we're already loading their name from the player data
and thus have the correct capitalization.

By: Travis Watkins <amaranth@ubuntu.com>
2012-11-18 10:51:52 -06:00
CraftBukkit/Spigot
ee562e8e61 Implement sound changes for Minecraft 1.4.2 changes. Fixes BUKKIT-2849
By: Karl Fritsche <github@attrib.org>
2012-11-05 22:09:33 +01:00
CraftBukkit/Spigot
ccf4da1fac [Bleeding] Use case from player data for OfflinePlayer. Fixes BUKKIT-519
If a plugin looks up a player that is offline they may not know the correct
capitalization for the name. In this case they're likely to get it wrong
and since we cache the result even after the player joins the server all
future request for an OfflinePlayer will return one with incorrect case.

When looking up a player who has played on the server before we can
get the correct case from the player data file saved by the server. If
the player has never played before this point we cannot do anything and
will still have the same issue but this is not a solvable problem.

By: EdGruberman <ed@rjump.com>
2012-08-09 09:27:40 -07:00
CraftBukkit/Spigot
b67f6a3633 Don't show a player on map if they're vanished. Fixes BUKKIT-1882
By: Travis Watkins <amaranth@ubuntu.com>
2012-11-17 10:31:13 -06:00
CraftBukkit/Spigot
4e8ec15953 Implement API for Skeleton and Zombie types. Fixes BUKKIT-2818
By: James Clarke <jamesrtclarke@me.com>
2012-11-05 18:09:40 +00:00
CraftBukkit/Spigot
9f7e1a3759 Fire BlockSpreadEvent for vine growth. Fixes BUKKIT-1097
By: Travis Watkins <amaranth@ubuntu.com>
2012-11-17 10:03:16 -06:00
CraftBukkit/Spigot
a152d0cdcb Update CraftBukkit to Minecraft 1.4.5.
By: Travis Watkins <amaranth@ubuntu.com>
2012-11-16 10:13:34 -06:00
CraftBukkit/Spigot
6af16dde2e Rework skull dropping. Fixes BUKKIT-2930 and BUKKIT-2820
Skulls need their tile entity in order to create an item correctly when
broken unlike every other block. Instead of sprinkling special cases all
over the code just override dropNaturally for skulls to read from their
tile entity and make sure everything that wants to drop them calls this
method before removing the block. There is only one case where this wasn't
already true so we end up with much less special casing.

By: Travis Watkins <amaranth@ubuntu.com>
2012-11-14 19:52:40 -06:00
CraftBukkit/Spigot
77e811ab06 Fixed some async tasks running synchronously. Fixes BUKKIT-2934
Additionally refactored cancel method to be more object-oriented.

By: Wesley Wolfe <weswolf@aol.com>
2012-11-14 16:47:21 -06:00
CraftBukkit/Spigot
3f728bab1a Update CraftBukkit to Minecraft 1.4.4.
By: Travis Watkins <amaranth@ubuntu.com>
2012-11-06 06:05:28 -06:00
CraftBukkit/Spigot
f6c50c0851 Updated version to 1.4.2-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-11-03 01:08:15 -04:00
CraftBukkit/Spigot
bc548f4fc3 Updated version to 1.4.2-R0.2 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-11-03 00:51:40 -04:00
CraftBukkit/Spigot
e9a41e71d6 [Bleeding] Fix mistranslation affecting time of the server vs time of day.
Fixes BUKKIT-2797

By: md_5 <md_5@bigpond.com>
2012-11-02 18:55:42 +11:00
CraftBukkit/Spigot
ac64db58aa Improved the potion test to detect missing PotionType values.
By: Wesley Wolfe <weswolf@aol.com>
2012-11-01 03:38:25 -05:00
CraftBukkit/Spigot
927fe6d97c Fix compile issue with chunk generation.
By: Travis Watkins <amaranth@ubuntu.com>
2012-11-02 00:12:49 -05:00
CraftBukkit/Spigot
50236b9a97 Delegate recreateStructures to nms provider. Fixes BUKKIT-2760
This was a miss when updating to 1.4.2

By: feildmaster <admin@feildmaster.com>
2012-11-01 21:11:32 -05:00
CraftBukkit/Spigot
6577736185 Add CraftArt mappings for Wither. Fixes BUKKIT-2667.
The static assertions are not normally evaluated in the JVM, and failed
to fail when the enums went from size 25 to size 26. This meant missing
values would not be detected at runtime and instead return null,
compounding problems later. The switches should never evaluate to null
so will instead throw runtime assertion errors.

Additional unit tests were added to detect new paintings and assure they
have proper, unique mappings. The test checks both that a mapping
exists, is not null, and does not duplicate another mapping.

By: Wesley Wolfe <weswolf@aol.com>
2012-11-01 03:06:47 -05:00
CraftBukkit/Spigot
1816b5b800 Change ItemFrame to actually provide a defensive copy. Fixes BUKKIT-2784
If a defensive copy is not used in the API, changes to the item are
reflected in memory, but never updated to the client. It also goes
against the general contract provided in Bukkit, where setItem should be
the only way to change the underlying item frame.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-31 18:07:27 -05:00
CraftBukkit/Spigot
725d2e84dc Updated version to 1.4.2-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-10-31 20:51:53 -04:00
CraftBukkit/Spigot
cb5dfdd896 Updated version to 1.4.2-R0.1 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-10-31 15:59:34 -04:00
CraftBukkit/Spigot
7399bc6c11 Add inventory and slot types for new containers. Fixes BUKKIT-2741
By: Travis Watkins <amaranth@ubuntu.com>
2012-10-31 12:14:39 -05:00
CraftBukkit/Spigot
64a7434f5a Implement API for ambient mob spawn limit. Add spawn-limit.ambient to
bukkit.yml. Adds BUKKIT-2765

By: Travis Watkins <amaranth@ubuntu.com>
2012-10-31 11:18:41 -05:00
CraftBukkit/Spigot
31bd23bbfe Use BlockCommandSender for dispatching Command block commands
Also allow commands that don't start with a / to match vanilla behavior

By: Travis Watkins <amaranth@ubuntu.com>
2012-10-31 06:36:55 -05:00
CraftBukkit/Spigot
ef3acaeea9 Expose API for managing and using GameRules. Adds BUKKIT-2757
By: feildmaster <admin@feildmaster.com>
2012-10-30 21:24:48 -05:00
CraftBukkit/Spigot
6ea108ec2e Implement the API for ItemFrames. Adds BUKKIT-2668
By: h31ix <effectsdude@gmail.com>
2012-10-31 00:59:06 -04:00
CraftBukkit/Spigot
abdcae8885 Expose API for clearing a player's inventory with a successful count
return. Adds BUKKIT-2745

By: EvilSeph <evilseph@gmail.com>
2012-10-30 02:52:53 -04:00
CraftBukkit/Spigot
026494018e Expose API for giving and taking experience levels for use with ExpCommand's new behaviour with Minecraft 1.4. Adds BUKKIT-2739
By: EvilSeph <evilseph@gmail.com>
2012-10-29 12:37:45 -04:00
CraftBukkit/Spigot
c464cba5b2 Revert changing EntityType.FIREBALL to LARGE_FIREBALL
By: feildmaster <admin@feildmaster.com>
2012-10-29 20:17:52 -05:00
CraftBukkit/Spigot
28e9f1ac43 Get skull data before destroying block. Fixes BUKKIT-2723
Skull blocks store their type in a tile entity and use their block data
as rotation. When breaking a block the block data is used for determining
what item to drop. Simply changing this to use the skull method for getting
their drop data is not enough because their tile entity is already gone.
Therefore we have to special case skulls to get the correct data _and_ get
that data before breaking the block.

By: Travis Watkins <amaranth@ubuntu.com>
2012-10-29 12:38:34 -05:00
CraftBukkit/Spigot
9ddec3654f Add isHardcore API to check if the server is in hardcore mode or not. Adds BUKKIT-2707
By: EvilSeph <evilseph@gmail.com>
2012-10-29 01:35:31 -04:00
CraftBukkit/Spigot
cadb8c3aa7 Add new entities to World.spawn method. Fixes BUKKIT-2658
By: Travis Watkins <amaranth@ubuntu.com>
2012-10-28 02:20:41 -05:00
CraftBukkit/Spigot
1f7d5bc41b Remove spawn-radius setting in bukkit.yml in favour of spawn-protection in
server.properties. Fixes BUKKIT-2657

By: EvilSeph <evilseph@gmail.com>
2012-10-28 01:30:09 -04:00
CraftBukkit/Spigot
1177b02708 Update CraftBukkit to Minecraft 1.4(.2).
By: Travis Watkins <amaranth@ubuntu.com>
2012-10-24 22:53:23 -05:00
CraftBukkit/Spigot
b2439099d0 Updated version to 1.3.2-R3.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-10-27 21:10:46 -04:00
CraftBukkit/Spigot
d451e774c8 Updated version to 1.3.2-R2.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-10-17 07:36:44 -04:00
CraftBukkit/Spigot
60dfb3206a Updated version to 1.3.2-R2.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-10-17 07:30:23 -04:00
CraftBukkit/Spigot
246fa5b12f Implement chat tab completion API. Fixes BUKKIT-2608. Adds BUKKIT-2607.
The chat tab completion implementation also includes a sanity check to
assure type-safety in the list.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-17 04:31:36 -05:00
CraftBukkit/Spigot
bb2c1736c3 Delegate tab-completion. Fixes BUKKIT-2181. Adds BUKKIT-2602
CommandMap now contains the functionality for tab completion. This
commit replaces the vanilla implementation and simply delegates it to
the Bukkit API.

By: Score_Under <seejay.11@gmail.com>
2012-10-09 19:44:04 +01:00
CraftBukkit/Spigot
730e3ceb1b Queue tasks from secondary threads. Fixes BUKKIT-2546 and BUKKIT-2600
This change affects the old chat compatibility layer from an
implementation only standpoint. It does not queue the 'event' to fire,
but rather queues a runnable that allows the calling thread to wait for
execution to finish.

The other effect of this change is that rcon connects now have their
commands queued to be run on next server tick using the same
implementation.

The internal implementation is in org.bukkit.craftbukkit.util.Waitable.
It is very similar to a Future<T> task, but only contains minimal
implementation with object.wait() and object.notify() calls
under the hood of waitable.get() and waitable.run().

PlayerPreLoginEvent now properly implements thread-safe event execution
by queuing the events similar to chat and rcon. This is still a poor way
albeit proper way to implement thread-safety; PlayerPreLoginEvent will
stay deprecated.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-07 15:08:21 -05:00
CraftBukkit/Spigot
dd1816bda4 Implement new scheduler API. Adds BUKKIT-836
The implementation for the new methods mimics the old methods. The final
call for the old methods now maps to the new methods with an additional
call to get id.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-06 16:23:56 -05:00
CraftBukkit/Spigot
e29c5d9725 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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-10-13 15:27:45 -05:00
CraftBukkit/Spigot
515032c89a Updated version to 1.3.2-R1.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-09-28 16:34:17 -04:00
CraftBukkit/Spigot
15b7c17284 Updated version to 1.3.2-R1.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-09-28 16:31:23 -04:00
CraftBukkit/Spigot
980784204e 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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-09-28 14:53:28 -05:00
CraftBukkit/Spigot
0d3ff61b07 Fix typo causing a task to be repeated in debug. Addresses BUKKIT-2549
An internal method for making the debug output for CraftScheduler's
async tasks was erroneously using the 'this' reference when the loop
should be referencing the current task.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-28 02:39:22 -05:00
CraftBukkit/Spigot
64da1ccd5c Updated version to 1.3.2-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-09-26 19:20:20 -04:00
CraftBukkit/Spigot
59300b50a1 Updated version to 1.3.2-R0.2 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-09-26 19:16:20 -04:00
CraftBukkit/Spigot
f57bc0f77f 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.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-26 16:34:06 -05:00
CraftBukkit/Spigot
4277872612 Replace LongObjectHashMap with a more efficient implementation
After further testing it appears that while the original LongHashtable
has issues with object creation churn and is severly slower than even
java.util.HashMap in general case benchmarks it is in fact very efficient
for our use case.

With this in mind I wrote a replacement LongObjectHashMap modeled after
LongHashtable. Unlike the original implementation this one does not use
Entry objects for storage so does not have the same object creation churn.
It also uses a 2D array instead of a 3D one and does not use a cache as
benchmarking shows this is more efficient. The "bucket size" was chosen
based on benchmarking performance of the HashMap with contents that would
be plausible for a 200+ player server. This means it uses a little extra
memory for smaller servers but almost always uses less than the normal
java.util.HashMap.

To make up for the original LongHashtable being a poor choice for generic
datasets I added a mixer to the new implementation based on code from
MurmurHash. While this has no noticable effect positive or negative with
our normal use of chunk coordinates it makes the HashMap perform just as
well with nearly any kind of dataset.

After these changes ChunkProviderServer.isChunkLoaded() goes from using
20% CPU time while sampling to not even showing up after 45 minutes of
sampling due to the CPU usage being too low to be noticed.

By: Travis Watkins <amaranth@ubuntu.com>
2012-09-11 05:51:09 -05:00
CraftBukkit/Spigot
42dfd206a6 [Bleeding] Add autosave interval setting in bukkit.yml. Adds BUKKIT-2507
The new setting is located at "ticks-per.autosave". By changing this
value, it affects how often a full save is automatically executed,
measured in ticks.

This value is defaulting to 0 (off) because we believe that the vast
majority of servers already have a third-party solution to automatically
saving the server at set intervals. Having the built in auto-save disabled
by default ensures that we are not saving things twice; doing so leads to
absolutely no benefits, but results in detrimental and noticeable
unnecessary performance decrease.

For servers that do not use an automated external script to perform saves,
this setting can be turned on by setting the value higher than 0, with 900
being the value used in vanilla.

By: Mike Primm <mike@primmhome.com>
2012-08-18 17:36:39 -05:00
CraftBukkit/Spigot
2a57bac117 Bulk pending cleanup.
By: Wesley Wolfe <weswolf@aol.com>
2012-09-09 23:19:28 -05:00
CraftBukkit/Spigot
bc59fff79a Change local jline checks to not use String literals. Fixes BUKKIT-2455.
Refactoring dependencies 'changes' the string literal in the code. This
commit changes the literal to instead use a char[] to initialize a new
String. On a bytecode level, there will not exist a String literal for these
two values; the shade plugin will no longer refactor them.

Refactoring jline also changes the other String literals we use for
notifying jline of the current state. To insure that our local code reflects
the inner logic in jline, the key value was changed to the static final
variable located in TerminalFactory. Likewise, UnsupportedTerminal uses the
explicit class name (as reflection is used later with the value that has
been set).

By: Luke Granger-Brown <git@lukegb.com>
2012-09-02 00:56:13 +01:00
CraftBukkit/Spigot
c650c443b3 Add information about async tasks to CrashReports. Addresses BUKKIT-2491
Async tasks are notorious for causing CMEs and corrupted data when
accessing the API. This change makes a linked list to track recent tasks
that may no longer be running. It is accessed via the toString method on
the scheduler. This behavior is not guaranteed, but it is accessible as
such currently.

Although toString is located in the scheduler, its contract does not
guarantee an accurate or up to date call when accessed from a second
thread.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-09 00:34:41 -05:00