Commit graph

1065 commits

Author SHA1 Message Date
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