Commit graph

2436 commits

Author SHA1 Message Date
CraftBukkit/Spigot
8844b9ade9 Improvements to BlockStates
* Actually capture all the data of TileEntities. This is done by creating a copy of the TileEntity. The methods of BlockState which currently directly access the TileEntity reference will modify the data of that TileEntity-snapshot instead.
* With the call to BlockState.update, the captured TileEntity data gets applied to the current TileEntity in the world.
* Methods which trigger block specific actions will use the current TileEntity from the world.
* CraftBlockState does not hand out the wrapped or the snapshot TileEntity directly. Instead, it provides an applyTo method to copy the data to a given TileEntity and a method to directly get a copy of the TileEntity NBT data represented by the BlockState. CraftMetaBlockState was updated to make use of that.
* Added #getSnapshotInventory() to bukkit which allows modifiying the captured inventory snapshots of containers.
* Tried to clarify which methods only work if the BlockState is placed, which methods require the block in the world to still be of the same type (methods which trigger actions), and that .getInventory() directly modifies the inventory of the block in the world if the BlockState is placed and becomes invalid if the block type is changed.

Backwards compatibility

* If the BlockState acts as InventoryHolder, getInventory() will still return the inventory directly backed by the TileEntity in the world (like before), and not the snapshot inventory. This compromise should reduce the potential of these changes to break existing plugins, or craftbukkit's own use of BlockState.
* The snapshot's inventory can be accessed by a new method getSnapshotInventory()
* In case the BlockState is not placed (if it was retrieved from the MetaBlockState of an item), the getInventory() method will however return the snapshot inventory. So that when the BlockState gets applied back to the item, the inventory changes are properly included.
* With the changes to CraftMetaBlockState it is no longer required to call the update method before passing a modified BlockState to the CraftMetaBlockState. For backwards compatibility the update method will simply return true for a non-placed BlockState, without actually doing anything.

Impact on plugins
* Restoring blocks now actually works as expected, properly restoring the TileEntity data, reglardless if the block changed its type in the meantime.
* Plugins are now consistently required to call the update method in order to apply changes to blocks. Though, regarding the Javadoc they should have been required to do so anyways.
* New feature: Plugins can take and modify inventory snapshots.
* Breaking change: If a plugin gets the BlockState of a block in the world, modifies the inventory returned by .getInventory(), and then tries to use the same BlockState to apply the TileEntity data to an ItemStack block meta, the ItemStack will use the snapshot inventory, disregarding the changes made to the inventory returned by .getInventory(). This is the compromise of .getInventory() returning the inventory directly backed by the TileEntity in the world.

Other fixes related to BlockState:
* TileEntityContainer#getLocation() will run into a NPE if the TileEntity is non-placed (ex. when getting the BlockState from a CraftMetaBlockState).
* Beacon.getEntitiesInRange() would previously throw a NPE if called for a non-placed BlockState. It was changed to now require to be placed and use the current TileEntity in the world. If the TileEntity in the world is no longer a beacon, it will return an empty list.
* EndGateway now supports setting and getting the exit location even for non-placed EndGateways (inside BlockStateMeta) by using / returning a location with world being null.

By: Lukas Hennig <lukas@wirsindwir.de>
2017-08-05 14:37:19 +10:00
CraftBukkit/Spigot
0f46337664 SPIGOT-3492: Ensure player functionality uses their specific scoreboard
By: md_5 <git@md-5.net>
2017-08-05 09:15:52 +10:00
CraftBukkit/Spigot
ad7106f650 Add build delay back
By: md_5 <git@md-5.net>
2017-08-04 16:09:17 +10:00
CraftBukkit/Spigot
0cda4f9617 Update to Minecraft 1.12.1
By: md_5 <git@md-5.net>
2017-08-03 23:00:00 +10:00
CraftBukkit/Spigot
4ba3003a60 Remove outdated build delay.
By: md_5 <git@md-5.net>
2017-08-03 21:10:43 +10:00
CraftBukkit/Spigot
19850b49b5 SPIGOT-3486: Missing check in redstone placement
By: md_5 <git@md-5.net>
2017-08-03 08:31:29 +10:00
CraftBukkit/Spigot
cdeade672d SPIGOT-3485: Launch shulker bullets as projectiles
By: md_5 <git@md-5.net>
2017-08-03 08:23:27 +10:00
CraftBukkit/Spigot
6f93c6c962 SPIGOT-3487: Llama doesn't drop chest
By: md_5 <git@md-5.net>
2017-08-03 08:21:05 +10:00
CraftBukkit/Spigot
ead7545014 SPIGOT-3482: ProjectileHitEvent for shulker bullet and llama spit
By: md_5 <git@md-5.net>
2017-08-02 18:05:28 +10:00
CraftBukkit/Spigot
f313e2f969 SPIGOT-3456: Expand calling of ServerCommandEvent
Existing usage preserved by checking sender.

By: md_5 <git@md-5.net>
2017-07-28 18:10:38 +10:00
CraftBukkit/Spigot
75cdf75d3d SPIGOT-3403: Add an EntityPickupItemEvent
By: md_5 <git@md-5.net>
2017-07-28 17:47:59 +10:00
CraftBukkit/Spigot
4ed8997ca1 SPIGOT-3463: Spurious item drops from event
By: md_5 <git@md-5.net>
2017-07-28 17:23:39 +10:00
CraftBukkit/Spigot
01bccda243 Implement BroadcastMessageEvent
By: BillyGalbreath <Blake.Galbreath@GMail.com>
2017-07-16 18:45:08 -05:00
CraftBukkit/Spigot
aba05b661c SPIGOT-3461: Standardise plugin load timing
By: md_5 <git@md-5.net>
2017-07-26 13:20:29 +10:00
CraftBukkit/Spigot
6d76725098 Correct scheduler behaviour with intervals of >= Integer.MAX_VALUE (circa 3 years).
By: md_5 <git@md-5.net>
2017-07-25 15:36:44 +10:00
CraftBukkit/Spigot
f4e233550c SPIGOT-3432: Add playNote support for new sounds
By: md_5 <git@md-5.net>
2017-07-24 17:41:08 +10:00
CraftBukkit/Spigot
cdcb11b8ae SPIGOT-3440: Non player entities should not make new portals
By: md_5 <git@md-5.net>
2017-07-22 16:40:10 +10:00
CraftBukkit/Spigot
8bafc76ff2 SPIGOT-3433: Improve AreaEffectCloud#getSource
By: md_5 <git@md-5.net>
2017-07-22 09:51:22 +10:00
CraftBukkit/Spigot
b4a099c163 SPIGOT-3428: Recover from invalid firework data
By: md_5 <git@md-5.net>
2017-07-19 09:56:35 +10:00
CraftBukkit/Spigot
29ee48fe27 Update Eclipse compiler.
By: md_5 <git@md-5.net>
2017-07-17 09:56:07 +10:00
CraftBukkit/Spigot
e2d75dccb4 Fix memory leak in PlayerList
By: md_5 <git@md-5.net>
2017-07-17 09:55:47 +10:00
CraftBukkit/Spigot
0d8abf61e3 SPIGOT-3418: Packaging error causing wrong netty version to be used
By: md_5 <git@md-5.net>
2017-07-16 11:45:27 +10:00
CraftBukkit/Spigot
16a95139f7 SPIGOT-3425: Correct slot type calculation
By: md_5 <git@md-5.net>
2017-07-16 11:03:19 +10:00
CraftBukkit/Spigot
8f5c16fce3 SPIGOT-3423: Don't treat technical piston block as BlockStateMeta
By: md_5 <git@md-5.net>
2017-07-16 10:48:21 +10:00
CraftBukkit/Spigot
7145fd4941 SPIGOT-3417: Event for shearing snowman
By: md_5 <git@md-5.net>
2017-07-15 09:53:22 +10:00
CraftBukkit/Spigot
e6c3102b03 SPIGOT-3416: Cap team prefix / suffix at correct value of 16
By: md_5 <git@md-5.net>
2017-07-13 12:42:45 +10:00
CraftBukkit/Spigot
bb0a0c3231 SPIGOT-3409: Improve performance of registering stupid amounts of permissions in plugin.yml
By: md_5 <git@md-5.net>
2017-07-10 21:05:47 +10:00
CraftBukkit/Spigot
e626522be7 SPIGOT-3407: Set damager for evoker fangs
By: md_5 <git@md-5.net>
2017-07-08 22:40:54 +10:00
CraftBukkit/Spigot
0353512d03 Update to Netty 4.1.13.Final.
By: md_5 <git@md-5.net>
2017-07-07 15:11:57 +10:00
CraftBukkit/Spigot
b7f6ba2171 Increase expiration time to two weeks.
By: md_5 <git@md-5.net>
2017-07-04 20:52:11 +10:00
CraftBukkit/Spigot
faa9a96c90 SPIGOT-3387: Prevent null enchantments in ItemMeta
By: BlackHole <black-hole@live.com>
2017-06-28 18:37:22 +02:00
CraftBukkit/Spigot
a7130c67fd SPIGOT-3382: Ensure players can pickup stuff
By: md_5 <git@md-5.net>
2017-06-26 11:21:38 +10:00
CraftBukkit/Spigot
13bcc894ec SPIGOT-3377: Fix subspace bubble advancement
By: md_5 <git@md-5.net>
2017-06-26 10:16:54 +10:00
CraftBukkit/Spigot
1396c4c1ec SPIGOT-3381: Save older serialized enchants
By: md_5 <git@md-5.net>
2017-06-26 09:49:28 +10:00
CraftBukkit/Spigot
71404da149 SPIGOT-3379: Generalise canPickupItems to other entities.
By: md_5 <git@md-5.net>
2017-06-26 08:34:52 +10:00
CraftBukkit/Spigot
d62c91e3a6 SPIGOT-3376: Fix nested functions
By: md_5 <git@md-5.net>
2017-06-26 08:27:25 +10:00
CraftBukkit/Spigot
4d6887228e SPIGOT-3373: Fix /execute in gameloop functions
By: md_5 <git@md-5.net>
2017-06-25 09:46:19 +10:00
CraftBukkit/Spigot
622d0477c5 SPIGOT-3324: Improve tameable damage handling
By: md_5 <git@md-5.net>
2017-06-24 10:01:46 +10:00
CraftBukkit/Spigot
d71a1a4036 SPIGOT-3368: Allow anvil level cost to be overwritten by properties
By: md_5 <git@md-5.net>
2017-06-23 20:35:17 +10:00
CraftBukkit/Spigot
c2453f20d4 SPIGOT-3336: HideFlags will now serialize as a List rather than a Set.
HideFlags will be serialized as a list and deserialized as an Iterable.
This will allow maximum flexibility on both the formats it can be
serialized into and formats it can be deserialized from.

By: Jeremy Wood <farachan@gmail.com>
2017-06-14 09:17:14 -04:00
CraftBukkit/Spigot
d3b6e87d27 SPIGOT-3364: Correct EntityResurrectEvent
By: md_5 <git@md-5.net>
2017-06-23 12:47:29 +10:00
CraftBukkit/Spigot
e97c71d131 Treat Vanilla commands as Bukkit Commands
By: md_5 <git@md-5.net>
2017-06-21 19:14:51 +10:00
CraftBukkit/Spigot
ff815b0065 Fix nether world border center not adjusting
By: md_5 <git@md-5.net>
2017-06-18 19:23:33 +10:00
CraftBukkit/Spigot
7b0417e439 SPIGOT-3351: Replace bundled netty with 4.1.12.Final
By: md_5 <git@md-5.net>
2017-06-18 18:01:31 +10:00
CraftBukkit/Spigot
50ba730c54 Increase expire time to 7 days
By: md_5 <git@md-5.net>
2017-06-17 17:45:09 +10:00
CraftBukkit/Spigot
11f9d4e49b SPIGOT-3329: Allow per world loot tables
By: md_5 <git@md-5.net>
2017-06-15 20:34:19 +10:00
CraftBukkit/Spigot
0fab9a4f3a SPIGOT-3342: Fix invalid usage of null in InventoryWrapper
By: md_5 <git@md-5.net>
2017-06-15 20:25:06 +10:00
CraftBukkit/Spigot
eb7eb4ba47 SPIGOT-3337: Use special data value to indicate multiple recipe choices
By: md_5 <git@md-5.net>
2017-06-15 07:23:08 +10:00
CraftBukkit/Spigot
3770ac47cf Fix detection of missing or invalid tile entities for End portals and gateways
By: Jacob Martin <jjm_223@hotmail.com>
2017-06-12 12:41:18 -05:00
CraftBukkit/Spigot
ba73b2a397 Add PistonMoveReaction getters for Entity
By: md_5 <git@md-5.net>
2017-06-12 19:23:24 +10:00
CraftBukkit/Spigot
df475be109 SPIGOT-3331: New map colours don't display
By: md_5 <git@md-5.net>
2017-06-12 19:16:30 +10:00
CraftBukkit/Spigot
1121a78705 SPIGOT-3328: EntityTameEvent for Parrots
By: md_5 <git@md-5.net>
2017-06-12 07:27:34 +10:00
CraftBukkit/Spigot
e422dbe810 SPIGOT-3324: Best effort fix for shoulder Parrots + cancelled damage event
By: md_5 <git@md-5.net>
2017-06-11 12:20:18 +10:00
CraftBukkit/Spigot
731f084c5b SPIGOT-3320: Apply tile entity fixer to more types
By: md_5 <git@md-5.net>
2017-06-11 08:32:29 +10:00
CraftBukkit/Spigot
c354c54394 SPIGOT-3304: Respect duration from Vanilla /weather
By: md_5 <git@md-5.net>
2017-06-09 16:17:08 +10:00
CraftBukkit/Spigot
47947b0f3b SPIGOT-3303: Warn when attempting to grant non existent recipe
By: md_5 <git@md-5.net>
2017-06-09 16:13:35 +10:00
CraftBukkit/Spigot
f1d918e0ec SPIGOT-3302: Armor stands not dropping armor
By: md_5 <git@md-5.net>
2017-06-09 15:51:56 +10:00
CraftBukkit/Spigot
ea595a5dcf Update to Minecraft 1.12
By: md_5 <git@md-5.net>
2017-06-08 18:00:00 +10:00
CraftBukkit/Spigot
7b45ff54ad Prevent NPE when setting tempt target to null
By: chickeneer <emcchickeneer@gmail.com>
2017-06-03 00:44:10 -05:00
CraftBukkit/Spigot
f25ad2b556 Add proper TeleportCause for /teleport
By: md_5 <git@md-5.net>
2017-06-04 08:39:36 +10:00
CraftBukkit/Spigot
d67c53a34d SPIGOT-3290: /teleport command overrides player rotation
By: md_5 <git@md-5.net>
2017-06-04 08:34:52 +10:00
CraftBukkit/Spigot
1bcf144211 SPIGOT-3286: Call BlockFormEvent for Concrete Powder -> Concrete
By: md_5 <git@md-5.net>
2017-06-03 17:39:03 +10:00
CraftBukkit/Spigot
da806eea9c SPIGOT-3283: Don't allow plugin induced infinite velocity / position
By: md_5 <git@md-5.net>
2017-06-02 18:44:37 +10:00
CraftBukkit/Spigot
23a6a85a95 SPIGOT-3284: Allow TNTPrimed#getSource to return invalid entities
Eg dead players.

By: md_5 <git@md-5.net>
2017-06-02 18:28:30 +10:00
CraftBukkit/Spigot
ea6ca4328a Update to Minecraft 1.12-pre6
By: md_5 <git@md-5.net>
2017-05-30 21:25:59 +10:00
CraftBukkit/Spigot
f69eb04edc SPIGOT-3277: Fix Entity.eject()
By: BlackHole <black-hole@live.com>
2017-05-28 22:27:57 +02:00
CraftBukkit/Spigot
d6fc1359a2 Add support for preventing block drops in BreakEvent
By: Scetra <contact@scetra.me>
2017-05-27 21:16:13 -04:00
CraftBukkit/Spigot
57f7c8fb18 Add color API for Teams
By: md_5 <git@md-5.net>
2017-05-28 11:00:02 +10:00
CraftBukkit/Spigot
a6491eb83e SPIGOT-3272: Fix duplicate creative inventory
This change properly identifies the creative inventory as one with 5 crafting slots (as that's the default set in ContainerPlayer, and handled properly in other containers), instead of having the same inventory twice (which breaks slot identification).

By: Pokechu22 <Pokechu022@gmail.com>
2017-05-26 20:20:59 -07:00
CraftBukkit/Spigot
07fc30bf6d SPIGOT-439: Add player locale related APIs.
By: MiniDigger <admin@minidigger.me>
2017-05-26 23:37:06 +02:00
CraftBukkit/Spigot
691c25561d Ensure gameLoop function gets selectors applied.
By: md_5 <git@md-5.net>
2017-05-26 16:43:56 +10:00
CraftBukkit/Spigot
0fc0496730 SPIGOT-3257: Issue with AdvancementRewards function
By: md_5 <git@md-5.net>
2017-05-21 10:28:07 +10:00
CraftBukkit/Spigot
31553d7ef7 SPIGOT-3258: VehicleBlockCollisionEvent only fires in certain directions
By: md_5 <git@md-5.net>
2017-05-21 10:24:47 +10:00
CraftBukkit/Spigot
a0b8ce2dc9 SPIGOT-3254: Check chunks are loaded before ticking entities as per previous versions.
By: md_5 <git@md-5.net>
2017-05-20 11:27:48 +10:00
CraftBukkit/Spigot
724dc2b59b SPIGOT-3253: Fix entity yaw changes
By: md_5 <git@md-5.net>
2017-05-20 11:16:28 +10:00
CraftBukkit/Spigot
530fe41851 Update to Minecraft 1.12-pre5
By: md_5 <git@md-5.net>
2017-05-19 21:00:13 +10:00
CraftBukkit/Spigot
5284eb89a3 SPIGOT-3248: Don't set shoulder compounds of EntityHuman to null
By: BlackHole <black-hole@live.com>
2017-05-17 20:26:51 +02:00
CraftBukkit/Spigot
5317a74e0a Misc advancement / recipe reload fixes including SPIGOT-3240
By: md_5 <git@md-5.net>
2017-05-16 21:22:07 +10:00
CraftBukkit/Spigot
4c88ea37ee SPIGOT-3240: Temporarily stub out rarely used resetRecipes method to fix some issues.
By: md_5 <git@md-5.net>
2017-05-16 06:58:37 +10:00
CraftBukkit/Spigot
94200cb8b3 SPIGOT-3244: Downgrade MySQL driver to 5.1.42 - the current GA release
By: md_5 <git@md-5.net>
2017-05-15 21:38:06 +10:00
CraftBukkit/Spigot
654b7c21fa SPIGOT-3243: Remove recipe reset on world change / death
By: md_5 <git@md-5.net>
2017-05-15 18:11:48 +10:00
CraftBukkit/Spigot
036d5985ab SPIGOT-3242: Fix rain not showing client side
By: md_5 <git@md-5.net>
2017-05-15 15:01:05 +10:00
CraftBukkit/Spigot
ea922d07c1 SPIGOT-3238: Add Server.advancementIterator
By: md_5 <git@md-5.net>
2017-05-15 08:25:53 +10:00
CraftBukkit/Spigot
40c8954e17 Update to Minecraft 1.12-pre2
By: md_5 <git@md-5.net>
2017-05-14 12:00:00 +10:00
CraftBukkit/Spigot
b8446f770b Change book limit to allow for automatically generated colour codes
By: md_5 <git@md-5.net>
2017-05-14 11:19:38 +10:00
CraftBukkit/Spigot
d082966e85 Remove outdated build delay.
By: md_5 <git@md-5.net>
2017-05-14 10:35:01 +10:00
CraftBukkit/Spigot
88f459dc51 SPIGOT-3235: Disconnect for payload errors
By: md_5 <git@md-5.net>
2017-05-14 09:25:25 +10:00
CraftBukkit/Spigot
fe7337fc10 Set health before entity death.
By: Lukas Hennig <lukas@wirsindwir.de>
2017-04-24 18:20:14 +02:00
CraftBukkit/Spigot
8803cfc46a SPIGOT-3215: Call BlockPhysicsEvent for tall plants
By: BlackHole <black-hole@live.com>
2017-05-01 01:21:20 +02:00
CraftBukkit/Spigot
de05a02353 SPIGOT-3214: Allow book titles up to 32 even though they can't be created by a Vanilla client.
By: md_5 <git@md-5.net>
2017-04-30 13:20:43 +10:00
CraftBukkit/Spigot
f965ee5c7f Implement getColor / setColor for Shulker entity
By: Matthew <stteg@hotmail.com>
2017-04-29 17:11:43 -04:00
CraftBukkit/Spigot
c5b0a788e9 SPIGOT-3207: Fix hiding players in a BukkitRunnable after joining
This happened because "joining" wasn't cleared until the player was ticked.  Runnables (presumably) ran _after_ the player list packet was sent, but before the player was ticked; thus, the player list packet was sent, but not cleared.  The fix is to replace joining with hasSentListPacket, which is set immediately before sending any player list packets (thus, if hidePlayer is called after, it sees that the list packet has been sent and sends a new one to reset it).  With this fix, the player is added to the list and then removed shortly afterwards.

The reason why running /hideall in the example wouldn't fix the invisibility is because the server already thinks the player's been removed from the list (as they're hidden), and thus doesn't want to send another hide packet.  This is correct behavior assuming that they get hidden correctly the first time, which they now do.

By: Pokechu22 <Pokechu022@gmail.com>
2017-04-27 21:53:31 -07:00
CraftBukkit/Spigot
0f12ccbdba Drop RegionFile.chunkExists() in favour of Mojang's own version
By: Geoff Crossland <gcrossland+bukkit@gmail.com>
2017-01-31 23:52:21 +00:00
CraftBukkit/Spigot
7baa3d8ac1 Implement getColor / setColor for TippedArrow
By: Matthew <stteg@hotmail.com>
2017-04-26 20:28:27 -04:00
CraftBukkit/Spigot
596875c55b Reset player arrow count on death
By: md_5 <git@md-5.net>
2017-04-26 15:56:06 +10:00
CraftBukkit/Spigot
b47c79c77a Skip invalid enchants in CraftMetaItem
By: md_5 <git@md-5.net>
2017-04-26 15:45:52 +10:00
CraftBukkit/Spigot
82c0a41a0d Create NBT TypeId helper class
By: Senmori <thesenmori@gmail.com>
2017-04-21 23:10:22 -04:00
CraftBukkit/Spigot
14c31d360f Remove players from vehicle when changing world via NMS methods.
By: md_5 <git@md-5.net>
2017-04-21 14:56:41 +10:00
CraftBukkit/Spigot
66b6964877 SPIGOT-3192: Return default value for invalid map icons
By: md_5 <git@md-5.net>
2017-04-21 08:20:49 +10:00
CraftBukkit/Spigot
fab1910b0a Add small throttle to book edits.
By: md_5 <git@md-5.net>
2017-04-20 22:10:31 +10:00