392 Commits

Author SHA1 Message Date
md_5
174a2ee539
SPIGOT-5829: RGB hex colours not supported in several places 2020-06-26 09:40:21 +10:00
md_5
3f0c333870
SPIGOT-5809: block.getState() wall signs too 2020-06-25 20:08:32 +10:00
md_5
b5db08bea5
SPIGOT-5809: block.getState() instanceof Sign for crimson_sign missed 2020-06-25 19:42:38 +10:00
md_5
9a3bd97f60
SPIGOT-5809: block.getState() instanceof Sign for warped_sign missed 2020-06-25 19:30:42 +10:00
md_5
76d2add0bb
SPIGOT-5802: Add SmithingRecipe API 2020-06-25 12:41:55 +10:00
md_5
7ea3c040bc
Update to Minecraft 1.16.1 2020-06-25 10:00:00 +10:00
blablubbabc
c9d7c16b5f SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot. 2020-06-13 20:56:32 +10:00
Aikar
1b2830a3b3 SPIGOT-4441: Fix serializing Components to and from Legacy
While cfeef75cd97 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 cfeef75cd97 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
md_5
cfeef75cd9 SPIGOT-5749: ItemMeta serializing to YAML not saving black colour code 2020-05-26 19:39:03 +10:00
Parker Hawke
933e9094bf #664: Add methods to get/set ItemStacks in EquipmentSlots 2020-05-05 19:10:03 +10:00
md_5
ce66f6937b Misc checkstyle fixes 2020-04-14 12:34:43 +10:00
md_5
498540e082 Add Merchant slot delegate 2020-04-05 16:29:43 +10:00
Tim
b2de47d581 SPIGOT-5621: Add missing container types for opening InventoryView 2020-04-05 16:28:43 +10:00
Bjarne Koll
6b00b14539 #639: Deep clone itemmetas persistent container on clone
After this commit, spigot now creates a deep copy of the
itemmeta's persistent data container when the itemmeta
instance is cloned.

This change fixes the bug that, after cloning itemmeta, the container
instance the cloned meta would point to was equal to the original one.
This resulted in two itemmeta instances sharing a single persistent
container.
2020-03-02 13:10:21 +11:00
Brokkonaut
918061b75c SPIGOT-5468: Beehive TileEntity was not loaded for BlockStateMeta 2020-02-17 18:08:10 +01:00
md_5
6881a10803 Update to Minecraft 1.15.2 2020-01-22 08:00:00 +11:00
md_5
82322fe06c SPIGOT-5426: isSimilar for player heads fails 2019-12-25 10:05:11 +11:00
md_5
85106731bf SPIGOT-5471: Allow empty title/author for books 2019-12-22 18:40:55 +11:00
md_5
61d4b09023 SPIGOT-5428: Better handling of some ItemMeta 2019-12-14 10:54:12 +11:00
ShaneBeee
b97d581af2 SPIGOT-5443: BEE_NEST BlockState
- Add missing BEE_NEST block state
- Add a missing break in CraftMetaBlockState
2019-12-13 09:12:38 +11:00
md_5
de42aa13f3 Update to Minecraft 1.15 2019-12-11 09:00:00 +11:00
md_5
e9bb2f15aa SPIGOT-5403: isSimilar returns true for different skulls 2019-12-05 10:37:02 +11:00
md_5
5c9e723692 SPIGOT-5409: Remove unnecessary defaulting in CraftMetaBookSigned 2019-12-05 10:28:16 +11:00
md_5
1e7a197f7a Fix incorrect inequality in 683bae0670c
Thanks Brokkoli & Phoenix616 for pointing out
2019-10-17 20:35:42 +11:00
ShaneBeee
db98d54df9 SPIGOT-5362: Suspicious stews fail isSimilar check 2019-10-14 21:04:58 +11:00
md_5
683bae0670 SPIGOT-5342: Lore lost when deserializing items with no version stored 2019-10-06 18:34:51 +11:00
md_5
5d335e9684 SPIGOT-5315: Cannot serialize armor stand ItemMeta 2019-09-11 18:14:46 +10:00
ShaneBeee
03b145b300 SPIGOT-5158: Add SuspiciousStewMeta 2019-09-09 19:22:40 +10:00
md_5
7ef2b20d0b SPIGOT-3308: RecipeIterator cannot longer remove recipes 2019-09-07 17:07:36 +10:00
md_5
96bc85f0b4 SPIGOT-5298: Remove unexplained 0.1 drop chance offset 2019-08-31 16:54:49 +10:00
md_5
2012f1e048 SPIGOT-5269: Item attribute modifiers don't persist their order 2019-08-16 20:57:49 +10:00
md_5
e5e8eec2cf SPIGOT-5241: setAttributeModifiers does not work on untouched stack 2019-08-03 12:55:20 +10:00
BlackHole
b0ef3996ed SPIGOT-4679 Fix black lines after book paragraphs
Also increase max page count to 100 to match 1.14
2019-07-23 09:28:12 +10:00
md_5
e73aabd666 Update to Minecraft 1.14.4 2019-07-20 09:00:00 +10:00
md_5
7ad3a1f468 SPIGOT-5146: BlockDataMeta does not work 2019-07-09 10:47:07 +10:00
md_5
31d4a777c7 SPIGOT-5142: Ignore invalid firework effects 2019-07-06 10:08:52 +10:00
md_5
bf0ea33de6 SPIGOT-5105: The EntityTag nbt tag disappears from preset armor_stand items. 2019-06-29 16:55:36 +10:00
blablubbabc
6dde4b9fda SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants 2019-06-22 18:31:21 +10:00
md_5
fe3930ce00 Update to Minecraft 1.14.3-pre4 2019-06-21 20:00:00 +10:00
md_5
4090d01f6d SPIGOT-5047: Correct slot types for 1.14 inventories 2019-06-13 22:01:16 +10:00
md_5
d445af3b14 SPIGOT-5067: Add item meta for 1.14 spawn eggs 2019-06-13 20:51:39 +10:00
md_5
cb3d14c5a7 Update to Minecraft 1.14.2 2019-05-28 06:30:00 +10:00
md_5
c5e09ceaaa SPIGOT-4961: Cannot open various inventories 2019-05-20 19:46:20 +10:00
md_5
f690957311 SPIGOT-4935: Lore deserializes incorrectly from previous versions 2019-05-15 17:07:47 +10:00
md_5
dd99c5bb44 SPIGOT-4929: Beacon inventory getType() returns CHEST 2019-05-14 21:31:49 +10:00
md_5
89c52b7b0e Update to Minecraft 1.14.1 2019-05-14 10:00:00 +10:00
md_5
21dbe8ab2a SPIGOT-4911: Cannot add firework rocket as charged projectile in crossbow 2019-05-12 11:22:21 +10:00
Brokkonaut
70ebefca6b SPIGOT-4891: LecternInventory.getType() should return InventoryType.LECTERN 2019-05-08 16:58:57 +10:00
md_5
84400e66b8 SPIGOT-4871: Manually opened double chest doesn't have close animation 2019-05-05 18:39:58 +10:00
md_5
3be0bc1c51 SPIGOT-4840: CartographyInventory not returned for InventoryClickEvent.getClickedInventory on result slot 2019-05-05 09:46:41 +10:00