Commit graph

132 commits

Author SHA1 Message Date
Aikar
1b2830a3b3 SPIGOT-4441: Fix serializing Components to and from Legacy
While cfeef75cd9 might of semi helped being able to save black text
lore, it actually took a fundamental problem with the legacy serialization
code and expanded it to break even more aspects of the server when dealing
with Component to Legacy conversion.

This is causing data loss in Spigot with cases such as setting an item name
to white gets stripped resulting in it being italic.

Additionally, things such as book pages have been returning black formatting
codes for the end of the line even when the user doesn't have colors in the book.

The root issue is that the "Default Color" system is fundamentally wrong.

Components do not and should not care about what element of the game they
are being used by, and that's what the default color system did.

It results in components that if obtained from 1 source such as a Book
where the default / rendered color is black, is then copied to another
source such as an Entity name, the black is carried forward and shown
in the Entity name, when in reality it should have been white.

This commit reverts cfeef75cd9 and fixes the underlying serialization
issues when it comes to Legacy to and From conversions.

There was quite a number of issues with this code overall, in how
it handles inserting color codes, new line parsing and such.

Books was using mojangs own "getLegacyString" which doesn't match behavior.
We also do not want to use Mojangs method as there is no guarantee they don't
remove that in future.
Plus, everything about books uses the CB implementation anyways, and it should
be consistent (this was mandatory to avoid serialization format changes on old vs new)

These changes as is results in Item Stacks already serialized will not
change contents when they go to component and back, so this won't impact
any existing data.

Newly created books though for example will change behavior in that they
will no longer insert black color codes in the serialized data and will
only represent intentional color changes by the creator of the book.
This will result in cleaner data on them, and books are the only thing
I'm aware of that has a behavioral shift due to the likelyhood of the
default color system kicking in on other parts of the string.

A unit test has been added to verify integrity of serialization to
ensure that any legacy string that is converted into Components will
always re-encode back in the same way when going back to Legacy.
2020-06-01 19:19:42 +10:00
konsolas
c98538940d MC-135989, SPIGOT-5564: Don't kick players for flight while riptiding 2020-02-07 20:19:24 +11:00
md_5
de42aa13f3 Update to Minecraft 1.15 2019-12-11 09:00:00 +11:00
md_5
e73aabd666 Update to Minecraft 1.14.4 2019-07-20 09:00:00 +10:00
md_5
f554183c3a SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving 2019-07-16 10:15:59 +10:00
md_5
fe3930ce00 Update to Minecraft 1.14.3-pre4 2019-06-21 20:00:00 +10:00
md_5
cb3d14c5a7 Update to Minecraft 1.14.2 2019-05-28 06:30:00 +10:00
Coleman Yantis
ba2e5e7c74 Add TradeSelectEvent 2019-04-28 12:35:37 +10:00
md_5
ed20842bcf Update to Minecraft 1.14 2019-04-25 12:00:00 +10:00
md_5
a2d787f6eb Update to Minecraft 1.14-pre5 2019-04-23 12:00:00 +10:00
md_5
f74c7b9578 SPIGOT-4706: Can't interact with active item 2019-04-20 13:00:10 +10:00
md_5
51d62deced SPIGOT-4702: Exception when middle clicking certain slots 2019-04-16 20:49:28 +10:00
md_5
5259d80c48 SPIGOT-4669: Fix PlayerTeleportEvent coordinates for relative teleports 2019-03-16 15:10:34 +11:00
md_5
2ced02339a Don't handle sync packets for kicked players 2019-02-03 14:23:04 +11:00
md_5
2aba349f1a Need to update item in hand if fish bucket pickup cancelled 2019-01-27 15:32:30 +11:00
riking
73a2c749be Process conversation input on the main thread.
Fixes BUKKIT-5611.
2019-01-05 16:21:07 +11:00
drXor
f2746a5eb2 Descriptive kick reasons instead of Nope! 2019-01-05 16:21:07 +11:00
md_5
2b2d084ac9 Add InventoryView#getSlotType 2018-12-26 10:44:39 +11:00
md_5
d05c8b1481 Mappings Update 2018-12-26 08:00:00 +11:00
md_5
c64fe5080c Mappings Update 2018-12-13 11:00:00 +11:00
md_5
aa36c8417b Mappings Update 2018-12-06 10:00:00 +11:00
md_5
3a9118280c SPIGOT-4477: Arrows only firing direction of boat 2018-11-10 20:36:35 +11:00
md_5
b4230a9a7e Update to Minecraft 1.13.2 2018-10-23 06:00:00 +11:00
Aikar
40aed54d11 SPIGOT-4396: Improve vehicle movement 2018-09-26 17:19:16 +10:00
md_5
c88ae6b195 SPIGOT-4342: Fix PlayerMoveEvent from pitch/yaw incorrect 2018-09-04 20:57:55 +10:00
md_5
6cf60193b0 SPIGOT-4340: Improve client bug workaround 2018-09-03 08:00:50 +10:00
md_5
6304ccd95f SPIGOT-4116: Tweak tab complete spam since the client appears to be duplicating packets 2018-08-29 22:30:16 +10:00
md_5
997d378dab Fix client stall in specific teleportation scenarios 2018-08-26 19:44:10 +10:00
md_5
ce1af0c348 Update to Minecraft 1.13.1 2018-08-26 12:00:00 +10:00
md_5
38adf52b28 SPIGOT-4119: Incorrect slot type in InventoryClickEvent 2018-07-24 08:41:15 +10:00
md_5
587014503b SPIGOT-4116: Increase command tab spam threshold 2018-07-23 18:33:29 +10:00
md_5
1a6b4f5392 Update to Minecraft 1.13 2018-07-22 12:00:00 +10:00
md_5
40f15832b4 SPIGOT-4048: Fish disappear when they cannot be picked up 2018-07-19 10:37:25 +10:00
md_5
de019a35f0 Tweak display of command completions when we have none 2018-07-18 12:23:00 +10:00
md_5
e120b5d10e Fix missing PlayerResourcePackStatusEvent 2018-07-18 10:00:43 +10:00
md_5
3e814e7b7d SPIGOT-4034: Fix missed diff affecting canceled InventoryClickEvent 2018-07-18 09:59:10 +10:00
md_5
421c1728c8 Update to Minecraft 1.13-pre7 2018-07-15 10:00:00 +10:00
md_5
ab13683d8e SPIGOT-3987: Preserve attributes when writing in books 2018-07-08 10:25:17 +10:00
md_5
3e3bbd4272 SPIGOT-3638: Don't process async chat on shutting down server 2017-11-08 10:36:11 +11:00
md_5
6733aa5635 SPIGOT-3603: Fix client timing out in scenarios where it sends no packets. 2017-10-09 18:23:58 +11:00
md_5
e8b6e4f29b Temporarily shift L7 timeout value to L4 value of 30s. 2017-10-06 20:49:22 +11:00
md_5
362ed329f0 Supress harmless teleport error 2017-10-01 17:29:03 +11:00
md_5
94b0980852 SPIGOT-3571: Packet handling must be synchronous 2017-09-19 08:00:56 +10:00
md_5
9a1f5ee80a Update to Minecraft 1.12.2 2017-09-18 20:00:00 +10:00
md_5
2a927e8638 Update to Minecraft 1.12.1 2017-08-03 23:00:00 +10:00
md_5
4670a84bd9 SPIGOT-3432: Add playNote support for new sounds 2017-07-24 17:44:44 +10:00
md_5
bb4ae3b3b8 Update to Minecraft 1.12 2017-06-08 18:00:00 +10:00
md_5
9a032b246b SPIGOT-3290: /teleport command overrides player rotation 2017-06-04 08:34:52 +10:00
md_5
e13d119686 Update to Minecraft 1.12-pre6 2017-05-30 21:55:13 +10:00
Pokechu22
44dd60ac27 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).
2017-05-28 10:32:31 +10:00