Commit graph

253 commits

Author SHA1 Message Date
CraftBukkit/Spigot
347f0eff78 #1380: Change wolf variant from enum to interface
By: DerFrZocker <derrieple@gmail.com>
2024-04-24 04:22:03 +10:00
CraftBukkit/Spigot
760899464e SPIGOT-5336: Field name parity with Minecraft keys
By: DerFrZocker <derrieple@gmail.com>
2024-04-24 01:15:00 +10:00
CraftBukkit/Spigot
1b0447274f #1357: Remove legacy Particle values
By: DerFrZocker <derrieple@gmail.com>
2024-04-24 01:15:00 +10:00
CraftBukkit/Spigot
65bc2541a3 Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00
CraftBukkit/Spigot
0ae1e62bfc SPIGOT-7608: Allow empty lists to morph to any PDT list
The minecraft serialisation logic for ListTag updates the type byte of
the list tag during writing to match either the first element in the
list or 0, if said list tag is empty.
As such, list content type information cannot be carried through a
write/read process, e.g. chunk load/unload or a creative client updating
the item.

The recently introduced persistent data type collections for lists hence
can also not enforce a specific list content type if the found list is
empty, which it currently attempts to do.
As such, a call to PersistentDataContainer#has would also yield false
for any empty list as the lists type byte would be 0.

The faulty behaviour has been fixed by considering an empty list in the
persistent data container to match any list type.
This change, while technically breaking the #has check, is needed and
reasonable as the #has check for this is currently broken in the first
place as described above.

By: Bjarne Koll <lynxplay101@gmail.com>
2024-03-30 10:46:03 +11:00
CraftBukkit/Spigot
64cd2b148a SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, #1008: Add EntityRemoveEvent
By: DerFrZocker <derrieple@gmail.com>
2024-02-21 20:55:34 +11:00
CraftBukkit/Spigot
49b5ee78bb SPIGOT-7300, #1180: Add new DamageSource API providing enhanced information about entity damage
By: Doc <nachito94@msn.com>
2024-02-11 09:54:25 +11:00
CraftBukkit/Spigot
d7095f8578 #1340: Centralize the conversion from and to Minecraft / Bukkit registry items even more and add a test case for them
By: DerFrZocker <derrieple@gmail.com>
2024-01-22 20:36:36 +11:00
CraftBukkit/Spigot
8cd8851498 #1295: Define native persistent data types for lists
By: Bjarne Koll <lynxplay101@gmail.com>
2024-01-06 16:03:58 +11:00
CraftBukkit/Spigot
d15575db91 #1325: Use CraftBlockType and CraftItemType instead of CraftMagicNumbers to convert between minecraft and bukkit block / item representation
By: DerFrZocker <derrieple@gmail.com>
2023-12-29 08:36:38 +11:00
CraftBukkit/Spigot
c90e518928 #1306: Centralize Bukkit and Minecraft entity conversion
By: DerFrZocker <derrieple@gmail.com>
2023-12-10 10:46:06 +11:00
CraftBukkit/Spigot
336afd230d #1299: Add new PersistentDataContainer methods and clean up docs
By: Jishuna <joshl5324@gmail.com>
2023-12-08 19:29:38 +11:00
CraftBukkit/Spigot
a5594be1c7 #1303: Create registry for banner pattern and cat type
By: Jishuna <joshl5324@gmail.com>
2023-12-08 19:26:30 +11:00
CraftBukkit/Spigot
5690a0ab1f #1309: Add tests for Bukkit Pose
By: Doc <nachito94@msn.com>
2023-12-07 08:21:33 +11:00
CraftBukkit/Spigot
dd8ca5c2dc SPIGOT-6026: Pull PotionEffectType and Enchantment from registry
By: DerFrZocker <derrieple@gmail.com>
2023-12-06 03:40:00 +11:00
CraftBukkit/Spigot
8398e12b34 Update to Minecraft 1.20.3
By: md_5 <git@md-5.net>
2023-12-06 03:40:00 +11:00
CraftBukkit/Spigot
e84271b31b #1279: Back Particle by a minecraft registry
By: DerFrZocker <derrieple@gmail.com>
2023-10-21 13:42:09 +11:00
CraftBukkit/Spigot
691d43eb42 SPIGOT-5753: Back PotionType by a minecraft registry
By: DerFrZocker <derrieple@gmail.com>
2023-10-09 20:22:53 +11:00
CraftBukkit/Spigot
0c90514858 SPIGOT-6400: Use Mockito instead of InvocationHandler
By: DerFrZocker <derrieple@gmail.com>
2023-10-07 15:42:18 +11:00
CraftBukkit/Spigot
b3ac8604eb #1264: Load Bukkit class before creating Registry item
This fixes a registry load order issue, which could cause that two different instances of the same registry item could exist, when the Bukkit class was not loaded before an item was queried.

By: DerFrZocker <derrieple@gmail.com>
2023-10-03 07:15:37 +11:00
CraftBukkit/Spigot
6e2503b658 #1265: Ensure UTF-8 used in new test resource
By: Doc <nachito94@msn.com>
2023-10-01 15:27:41 +11:00
CraftBukkit/Spigot
5692b3f59a #1230: Move unstructured PDC NBT serialisation to SNBT
The initial implementation of the CraftNBTTagConfigSerialiser attempted
to represent the entire NBT tree in yaml. While the tree structure
itself is nicely represented, the values and their respective types
become increasingly difficult to properly store in the context of
snakeyml/yml in general.

This is mainly due to the fact that nbt offers a lot of different types
compared to yaml, specifically the primitive arrays and different
floating point values are troublesome as they require parsing via mojang
parsers due to their custom format.

To build a future proof system for unstructured nbt in spigot yml,
this commit moves the entire serialisation fully into SNBT,
producing a single string as output rather than a full yml tree.
SNBT remains easily readable and editable for server owners, which was
one of the main criteria during the initial implementation of the
serialiser (preventing the use of bas64ed gzipped nbt bytes), while also
completely using mojangs parsing, eliminating any need for custom
parsing logic in spigot.

Additionally, a string allows for very straight forward handling of
legacy data by simply parsing strings as SNBT and maps/yml trees as
legacy content, depending on what type snakeyml produces after parsing
the yml content, removing the need for a versioning schema.

By: Bjarne Koll <lynxplay101@gmail.com>
2023-09-24 10:12:19 +10:00
CraftBukkit/Spigot
07002cbfcd #1256: Update tests to JUnit 5
By: DerFrZocker <derrieple@gmail.com>
2023-09-23 18:10:23 +10:00
CraftBukkit/Spigot
3ff2a7bc12 SPIGOT-7486: Alternate approach to null profile names
By: md_5 <git@md-5.net>
2023-09-22 07:36:30 +10:00
CraftBukkit/Spigot
4248b8a4d8 #1250: Standardize and centralize Bukkit / Minecraft registry conversion
By: DerFrZocker <derrieple@gmail.com>
2023-09-22 03:02:16 +10:00
CraftBukkit/Spigot
8a3c8cfcd4 Update to Minecraft 1.20.2
By: md_5 <git@md-5.net>
2023-09-22 02:40:00 +10:00
CraftBukkit/Spigot
c8a9b8d25c #1248: Load GameEvent and MusicInstrument from registry
By: DerFrZocker <derrieple@gmail.com>
2023-09-02 12:55:23 +10:00
CraftBukkit/Spigot
6fdc83ddd9 #1246: Add missing AbstractTestingBase to tests which need them
By: DerFrZocker <derrieple@gmail.com>
2023-08-25 19:33:11 +10:00
CraftBukkit/Spigot
5ff68bfbcb #1203: Test TrimMaterial and TrimPattern constants
By: Parker Hawke <hawkeboyz2@hotmail.com>
2023-06-12 10:06:51 +10:00
CraftBukkit/Spigot
9d740b84b0 Update to Minecraft 1.20
By: md_5 <git@md-5.net>
2023-06-08 01:30:00 +10:00
CraftBukkit/Spigot
355e9daf30 #1196: Test Registry instances more thoroughly
By: Parker Hawke <hawkeboyz2@hotmail.com>
2023-06-04 11:28:33 +10:00
CraftBukkit/Spigot
d58f895450 Add test for Chunk.LoadLevel mirroring
By: md_5 <git@md-5.net>
2023-04-29 17:44:42 +10:00
CraftBukkit/Spigot
6c852e65e7 #1147: Add experimental armor trim API
By: Parker Hawke <hawkeboyz2@hotmail.com>
2023-04-07 16:51:00 +10:00
CraftBukkit/Spigot
85db37be1b Fix availability of experimental datapack features in unit tests
By: md_5 <git@md-5.net>
2023-03-15 20:41:42 +11:00
CraftBukkit/Spigot
40076782ed Update to Minecraft 1.19.4
By: md_5 <git@md-5.net>
2023-03-15 03:30:00 +11:00
CraftBukkit/Spigot
412e157d39 SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test
By: Doc <nachito94@msn.com>
2023-02-20 19:35:39 +11:00
CraftBukkit/Spigot
d310f63995 SPIGOT-7034: Add methods for set/get instrument in Goat Horn
By: byquanton <32410361+byquanton@users.noreply.github.com>
2023-01-08 20:36:10 +11:00
CraftBukkit/Spigot
37d4b08ff4 #1121: Add unit test for spawn egg meta
By: Doc <nachito94@msn.com>
2022-12-13 19:04:30 +11:00
CraftBukkit/Spigot
8b26bb8f3e Update to Minecraft 1.19.3
By: md_5 <git@md-5.net>
2022-12-08 03:00:00 +11:00
CraftBukkit/Spigot
2f0d31aa17 SPIGOT-7083: Add Boat.WoodenType, Boat.Status; deprecate TreeSpecies
By: Doc <nachito94@msn.com>
2022-07-05 20:40:35 +10:00
CraftBukkit/Spigot
230282ea44 SPIGOT-7011, SPIGOT-7065: Overhaul of structures
By: DerFrZocker <derrieple@gmail.com>
2022-07-01 20:41:04 +10:00
CraftBukkit/Spigot
100bb8f120 #1052: Add option to use cached map color palette
This reduces the conversion time drastically with the cost of slightly more memory usage.

By: DerFrZocker <derrieple@gmail.com>
2022-06-18 21:13:42 +10:00
CraftBukkit/Spigot
25f3b50f6b Update to Minecraft 1.19
By: md_5 <git@md-5.net>
2022-06-08 02:00:00 +10:00
CraftBukkit/Spigot
43ec2cdacc #1055: Use correct tile entity for trapped chest in CraftBlockStates
By: DerFrZocker <derrieple@gmail.com>
2022-06-06 08:30:54 +10:00
CraftBukkit/Spigot
5fce26aed5 Add tests for material creative categories
By: md_5 <git@md-5.net>
2022-03-19 09:59:55 +11:00
CraftBukkit/Spigot
9ee989ea81 Update to Minecraft 1.18.2
By: md_5 <git@md-5.net>
2022-03-01 02:00:00 +11:00
CraftBukkit/Spigot
314b83ffae SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls
By: Doc <nachito94@msn.com>
2022-02-07 18:47:27 +11:00
CraftBukkit/Spigot
08891a2e2f #1002: Add Player Profile API
Slight changes may occur as this API is stabilized.

This PR is based on work previously done by DerFrZocker in #938.

By: blablubbabc <lukas@wirsindwir.de>
2022-02-03 09:25:39 +11:00
CraftBukkit/Spigot
e55f7f5dc4 #962: Make PotionEffectType implement Keyed
By: coll1234567 <joshl5324@gmail.com>
2021-11-28 11:49:42 +11:00
CraftBukkit/Spigot
6992843028 Fix serializing unhandled NBT + add unit test with unhandled NBT
By: md_5 <git@md-5.net>
2021-11-23 12:35:42 +11:00
CraftBukkit/Spigot
e3c01e2bf0 #955: Add test for BlockData class of Material
By: BlackHole <black-hole@live.com>
2021-11-23 08:07:10 +11:00
CraftBukkit/Spigot
43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00
CraftBukkit/Spigot
f27c8f74f8 #877: Improve and simplify CraftBlockState
By: blablubbabc <lukas@wirsindwir.de>
2021-09-29 18:56:16 +10:00
CraftBukkit/Spigot
c2e4e91b1b SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
## **Current API**
The current world generation API is very old and limited when you want to make more complex world generation. Resulting in some hard to fix bugs such as that you cannot modify blocks outside the chunk in the BlockPopulator (which should and was per the docs possible), or strange behavior such as SPIGOT-5880.

## **New API**
With the new API, the generation is more separate in multiple methods and is more in line with Vanilla chunk generation. The new API is designed to as future proof as possible. If for example a new generation step is added it can easily also be added as a step in API by simply creating the method for it. On the other side if a generation step gets removed, the method can easily be called after another, which is the case with surface and bedrock. The new API and changes are also fully backwards compatible with old chunk generators.

### **Changes in the new api**
**Extra generation steps:**
Noise, surface, bedrock and caves are added as steps. With those generation steps three extra methods for Vanilla generation are also added. Those new methods provide the ChunkData instead of returning one. The reason for this is, that the ChunkData is now backed by a ChunkAccess. With this, each step has the information of the step before and the Vanilla information (if chosen by setting a 'should' method to true). The old method is deprecated.

**New class BiomeProvider**
The BiomeProvider acts as Biome source and wrapper for the NMS class WorldChunkManager. With this the underlying Vanilla ChunkGeneration knows which Biome to use for the structure and decoration generation. (Fixes: SPIGOT-5880). Although the List of Biomes which is required in BiomeProvider, is currently not much in use in Vanilla, I decided to add it to future proof the API when it may be required in later versions of Minecraft.
The BiomeProvider is also separated from the ChunkGenerator for plugins which only want to change the biome map, such as single Biome worlds or if some biomes should be more present than others.

**Deprecated isParallelCapable**
Mojang has and is pushing to a more multi threaded chunk generation. This should also be the case for custom chunk generators. This is why the new API only supports multi threaded generation. This does not affect the old API, which is still checking this.

**Base height method added**
This method was added to also bring the Minecraft generator and Bukkit generator more in line. With this it is possible to return the max height of a location (before decorations). This is useful to let most structures know were to place them. This fixes SPIGOT-5567. (This fixes not all structures placement, desert pyramids for example are still way up at y-level 64, This however is more a vanilla bug and should be fixed at Mojangs end).

**WorldInfo Class**
The World object was swapped for a WorldInfo object. This is because many methods of the World object won't work during world generation and would mostly likely result in a deadlock. It contains any information a plugin should need to identify the world.

**BlockPopulator Changes**
Instead of directly manipulating a chunk, changes are now made to a new class LimitedRegion, this class provides methods to populated the chunk and its surrounding area. The wrapping is done so that the population can be moved into the place where Minecraft generates decorations. Where there is no chunk to access yet. By moving it into this place the generation is now async and the surrounding area of the chunk can also be used.

For common methods between the World and LimitedRegion a RegionAccessor was added.

By: DerFrZocker <derrieple@gmail.com>
2021-08-15 08:08:16 +10:00
CraftBukkit/Spigot
0c2fdaf521 SPIGOT-6527: Add AxolotlBucketMeta
By: Doc <nachito94@msn.com>
2021-07-04 09:32:25 +10:00
CraftBukkit/Spigot
02ebbcfc81 #855: Add HumanEntity#getItemInUse and Material#getSlipperiness
By: konsolas <vincentyntang@gmail.com>
2021-06-12 21:07:45 +01:00
CraftBukkit/Spigot
f359c7a3ec Fix new map colors rendering as transparent
By: DerFrZocker <derrieple@gmail.com>
2021-06-12 19:56:13 +10:00
CraftBukkit/Spigot
b3a8254758 Update to Minecraft 1.17
By: md_5 <git@md-5.net>
2021-06-11 15:00:00 +10:00
CraftBukkit/Spigot
8ce553209c #819: Implemented test for Material#getEquipmentSlot() method
By: Jakub Zacek <dawon.cz@gmail.com>
2021-04-13 19:16:32 +10:00
CraftBukkit/Spigot
103e1bf3b5 SPIGOT-5877: Add scaffolding for custom dimensions and biomes
By: Martoph <sager1018@gmail.com>
2021-04-11 17:54:48 +10:00
CraftBukkit/Spigot
9da047989c Repackage NMS
By: md_5 <git@md-5.net>
2021-03-16 09:00:00 +11:00
CraftBukkit/Spigot
b2efd58164 Organise imports
By: md_5 <git@md-5.net>
2021-03-09 08:47:33 +11:00
CraftBukkit/Spigot
cf47c45e20 #707, SPIGOT-5063, SPIGOT-5304, SPIGOT-5656, SPIGOT-3206, SPIGOT-5350, SPIGOT-5980, SPIGOT-4672: Persist the exact internal text representation where possible.
Issues resolved by this:
* SPIGOT-5063: Internal text representation of ItemStacks changes during ItemStack serialization. This issue was initially primarily concerned with the conversion between color text attributes to legacy color codes.
* SPIGOT-5304: Internal text representation of ItemStacks changes when opening the inventory (in creative mode). In particularly, this issue is also concerned with the conversion between plain text representations to non-plain ones.
* SPIGOT-5656: Internal text representation of ItemStacks changes during ItemStack serialization. This issue is particularly concerned with reordering of text attributes in the text's Json representation.
* SPIGOT-3206: Internal text representation of book pages changes during ItemStack serialization.
* SPIGOT-5350: Any non-plain text features are stripped from books during ItemStack serialization.
* SPIGOT-5980: Written books are marked as 'resolved' during ItemStack serialization and on various inventory interactions, even though they aren't, and thereby breaking any non-resolved page contents.
* SPIGOT-4672: Since item display names are serialized in their internal Json representation, any translatable components get properly persisted as well now.

---------

Minecraft uses text components to represent text. Internally Minecraft stores these components as Json formatted Strings and dynamically parses the text components from this Json representation whenever required.

In some cases Minecraft will create the text components and then convert them to Json itself for the internal storage. In other cases the Json representation is specified by users (eg. in Minecraft give commands, loot tables, mob equipment specified via Minecraft's summon commands, etc.).
There are many different ways in which the same text components can be represented in Json. When Minecraft compares objects which store this textual information, it takes the exact Json representation into account to determine whether the objects are considered equal. For example, ItemStacks will not match (and therefore not stack) if there is a difference in this internal Json representation for at least one if the item's text attributes (such as display name, lore, book pages, etc.). And when specifying nbt data in command selectors (eg. to only match entities/players which hold an item with specific name), the selector compares the raw Json representation as well.

As long as the Json representation is valid and can be parsed, Minecraft will not modify or normalize it.
However, under various circumstances Spigot converts this text information from the internal Json representation to text components (and in some cases even to plain text with legacy color codes) and then later tries to convert the text from these representations back to text components in the Json representation. Because this backwards conversion is in many cases not able to reproduce the original Json representation, the internal data of some affected Minecraft objects (ItemStacks, TileEntities, Entities, etc.) will in some cases get modified.

One especially notable situation in which this issue can come up is Bukkit's configuration serialization of ItemStacks: When a plugin serializes and later deserializes ItemStacks with display name, localized name, lore, or book pages of signed books, Spigot would convert these textual ItemStack attributes to plain text with legacy color codes and later try to convert those back to chat components in the Json representation. If the reconstructed Json representation does not match the original representation, the deserialized ItemStacks would no longer match nor stack with any original ItemStacks.

This case is particularly common if the original ItemStacks are created by users via some vanilla Minecraft mechanism (eg. Minecraft's give command, loot tables, mob equipment specified via Minecraft's summon command, etc.) and the used internal text representation for the created ItemStacks does not match the text representation produced by Spigot. This is also quite likely to be case, because the internal text representation produced by Spigot can sometimes be slightly verbose and, until recently, contained legacy color codes which cannot be used in Minecraft commands in-game.
However, this issue is not limited to items created by users, but affects items created by Minecraft itself as well.

Other cases in which Spigot itself (without any plugins involved) will convert between these text representations include dragging items around inside the inventory or opening the inventory while in creative mode. In these cases Spigot creates Bukkit representations of the affected items for use in Bukkit events and then, after the events have been handled, converts these Bukkit representations back to Minecraft items. See for example SPIGOT-5656 and SPIGOT-5304.

The idea of these changes is to avoid this back and forth conversion between the internal Json representation and the text component or plain text representations in various situations in which it is not actually required:
* CraftMetaItem stores the raw original Json representation for the display name, localized name, lore and pages of signed books now. As long as no plugin modifies these text attributes via the API, they can be reapplied in their original form to an ItemStack.
* The configuration serialization will serialize the original Json representation for these text attributes now so that it can also be restored during deserialization.
* However, in order to still be able to deserialize previously serialized items, and in order to allow users to specify text in the more simple plain representation in configuration files, we also still accept plain text during deserialization. Our approach is to check if the serialized text contains legacy color codes, in which case we convert it to chat components using our own converter and then to Json. Otherwise we try to parse it via Minecraft's Json parser. If the parsing fails due to the text not being valid Json, we interpret the text as plain text and convert it via our own converter as well.
* Various duplicated code has been removed from CraftMetaBookSigned and instead the base CraftMetaBook class allows sub classes to override the relevant aspects of how pages are parsed, serialized and deserialized.
* The BlockStates for command blocks and signs preemptively retrieved the custom name and sign line components, converted them to plain text and later converted them back to text components when applying the BlockState. We now only perform this conversion if a plugin has explicitly modified these texts.

Other changes:
* Minor: We also retrieve, convert and update a few other BlockState attributes directly from the underlying snapshot and only when requested by plugins now.
* SPIGOT-5980: Written books did not properly persist their 'resolved' attribute, resulting in unresolved book pages not getting resolved.
* There are methods to get and set the resolved value for books. However, these are not yet exposed in Bukkit.
* Minor fix: CraftMetaBook#isBookEmpty did not check some of the book attributes. This is probably a minor issue, but for consistency reasons there are checks for the missing attribute(s) now.

----
Covered cases
---
* By remembering the raw original String data, we can persist the exact text representation (eg. the ordering of elements within the Json text object (SPIGOT-5656), used style of escaping quotes (single quotes, escaped double quotes, etc.), use of plain texts (SPIGOT-5304), used boolean style, modern text component features such as translatable texts (SPIGOT-4672), etc.). All of these differences would otherwise cause the ItemStack to no longer be considered equal to its original.
* An empty String in the serialized config data results in no display name rather than an empty display name, like before. An item with explicitly empty display name (`{display: {Name: '""'}}`) is saved as `'""'` and can also be loaded from that representation again.
* Any plain texts, with or without color codes, which don't parse as Json (eg. `display-name: 'Bla'`) are still getting run through Spigot's text to components converter, like before.
* We can now also persist empty but explicitly present lore (`{display:{Lore:[]}}`). Previously this would get removed when the ItemMeta gets reapplied to the item. And ItemMeta#equals would return true for items with and without this empty lore data, even though Minecraft considers them to be different. For plugins using the API there should be no change: #hasLore still checks whether the lore is both present and not empty, and #getLore returns an empty list instead of null in this case (however, it previously already returned an empty list in this case). And setting the lore to an empty list via #setLore will still result in an item with no lore.
* Similarly, we can also persist explicitly specified but empty lists of book pages now.

----
Cases that are not covered (i.e. which may lead to changes in items), but were already not covered previously:
----
* NBT data for text that is not actually of type String.
* Empty or unexpected entries within the display compound.
* Variations in the NBT data representation in item features other than the above mentioned ones.
* Texts containing color codes. During deserialization these texts get interpreted as plain text and converted to a text component representation. This will break the serialization of any ItemStacks which actually use a text component representation with embedded color codes for some reason. Usually the likelihood for encountering such items in practice would probably be small. However, in the past (pre MC 1.16) Spigot would actually produce such items during ItemStack deserialization or when plugins created ItemStack via the Bukkit API. However, Spigot has changed the text representation it produces in MC 1.16, so any previously created and still existing items with this text representation are already problematic anyways now. See SPIGOT-5964. A fix for this linked issue (eg. the automatic conversion of these items) would probably resolve this deficit here as well.
* Spigot's String to text components converter produces quite verbose components since 1.16. See SPIGOT-5964 as well. However, this applies regardless of the changes of this PR.
* Book ItemStacks with more pages than 100 pages or oversized pages are truncated (like before) and may therefore change.
hange.

By: blablubbabc <lukas@wirsindwir.de>
2021-01-01 08:53:14 +11:00
CraftBukkit/Spigot
d9f5dbb3e6 #752: Add the ability to retrieve hit, step, fall, and other sounds from blocks.
By: Martoph <sager1018@gmail.com>
2020-11-26 09:36:57 +11:00
CraftBukkit/Spigot
7dd38ec039 SPIGOT-6242: Fix some file line endings
By: md_5 <git@md-5.net>
2020-11-18 08:13:04 +11:00
CraftBukkit/Spigot
6c307816d0 SPIGOT-6064: world.getBiome() null Error
By: md_5 <git@md-5.net>
2020-08-12 10:50:20 +10:00
CraftBukkit/Spigot
6a9e00d4b6 Update to Minecraft 1.16.2
By: md_5 <git@md-5.net>
2020-08-12 07:00:00 +10:00
CraftBukkit/Spigot
c7807b4048 SPIGOT-6033: Bukkit.getUnsafe().getMaterial() won't match renamed block materials
By: md_5 <git@md-5.net>
2020-07-28 18:22:34 +10:00
CraftBukkit/Spigot
a13bf3a57f SPIGOT-5900: Add test for the order of Material enum entries
By: Ben Woodworth <ben@benwoodworth.net>
2020-07-02 09:34:13 +10:00
CraftBukkit/Spigot
c6249c09b0 SPIGOT-5908: CompassMeta for new lodestone compass data
By: md_5 <git@md-5.net>
2020-07-01 10:48:37 +10:00
CraftBukkit/Spigot
178090a153 SPIGOT-5907: Item Frame NBT data disappears
By: md_5 <git@md-5.net>
2020-07-01 10:00:24 +10:00
CraftBukkit/Spigot
24a247fce5 SPIGOT-5845: ChatColor.RESET does not work in ItemMeta to reset italics
By: md_5 <git@md-5.net>
2020-06-27 10:37:33 +10:00
CraftBukkit/Spigot
fff84f2f22 CraftChatMessageTest does not need AbstractTestingBase
By: md_5 <git@md-5.net>
2020-06-27 09:28:17 +10:00
CraftBukkit/Spigot
e388fab4fe SPIGOT-5805: NPE when getting an Attribute from a Player
By: md_5 <git@md-5.net>
2020-06-25 13:19:24 +10:00
CraftBukkit/Spigot
50503fd516 Update to Minecraft 1.16.1
By: md_5 <git@md-5.net>
2020-06-25 10:00:00 +10:00
CraftBukkit/Spigot
a1cc6a4683 SPIGOT-4441: Fix serializing Components to and from Legacy
While 9862a0135d 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 9862a0135d 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.

By: Aikar <aikar@aikar.co>
2020-06-01 19:19:42 +10:00
CraftBukkit/Spigot
515509a1a9 #665: Add test for Material#getCraftingRemainingItem()
By: ben <ben@benwoodworth.net>
2020-05-28 19:31:27 +10:00
CraftBukkit/Spigot
18886036f4 Misc checkstyle fixes
By: md_5 <git@md-5.net>
2020-04-14 12:34:43 +10:00
CraftBukkit/Spigot
e18fd0cff5 #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.

By: Bjarne Koll <LynxPlay101@gmail.com>
2020-03-01 17:23:54 +01:00
CraftBukkit/Spigot
153bdf9192 Improve legacy conversion of some materials that changed post flattening
By: md_5 <git@md-5.net>
2020-02-21 12:13:05 +11:00
CraftBukkit/Spigot
13b8a2aea1 #624: Add an API for passing the heightmap to getHighestBlockAt* method
By: ysl3000 <yannicklamprecht@live.de>
2020-02-09 10:31:07 +11:00
CraftBukkit/Spigot
77bc265e5b SPIGOT-5536: Material.values() causes legacy data init
By: md_5 <git@md-5.net>
2020-01-23 08:53:36 +11:00
CraftBukkit/Spigot
b978d253d9 Only load legacy support data if something uses it
By: md_5 <git@md-5.net>
2020-01-22 11:15:58 +11:00
CraftBukkit/Spigot
2b704c8cf9 SPIGOT-5516: Correct EnchantmentTarget values
By: md_5 <git@md-5.net>
2020-01-15 14:20:14 +11:00
CraftBukkit/Spigot
0e142c7f03 Update to Minecraft 1.15
By: md_5 <git@md-5.net>
2019-12-11 09:00:00 +11:00
CraftBukkit/Spigot
cf59b7f501 SPIGOT-5362: Suspicious stews fail isSimilar check
By: ShaneBeee <shanebolenback@me.com>
2019-10-14 21:03:30 +11:00
CraftBukkit/Spigot
20283452c6 SPIGOT-5341: Add Material.isAir
By: md_5 <git@md-5.net>
2019-10-06 18:41:56 +11:00
CraftBukkit/Spigot
7f5d81e0b0 SPIGOT-5158: Add SuspiciousStewMeta
By: ShaneBeee <shanebolenback@me.com>
2019-09-08 02:49:12 -07:00
CraftBukkit/Spigot
a4b8e8ce68 Update to Minecraft 1.14.4
By: md_5 <git@md-5.net>
2019-07-20 09:00:00 +10:00
CraftBukkit/Spigot
020a6a58b2 SPIGOT-5105: The EntityTag nbt tag disappears from preset armor_stand items.
By: md_5 <git@md-5.net>
2019-06-29 16:55:36 +10:00
CraftBukkit/Spigot
a8155d2399 Update to Minecraft 1.14.3-pre4
By: md_5 <git@md-5.net>
2019-06-21 20:00:00 +10:00
CraftBukkit/Spigot
672c7bfa97 SPIGOT-2000: Picking up items to shield slot working inconsistently when inventory is full
By: PurkkaKoodari <purkka@purkka.codes>
2019-06-06 01:32:32 +03:00
CraftBukkit/Spigot
569660215f Update to Minecraft 1.14.2
By: md_5 <git@md-5.net>
2019-05-28 06:30:00 +10:00
CraftBukkit/Spigot
acd04ff0d0 SPIGOT-4833: Allow access to LivingEntity memories
By: Yannick Lamprecht <yannicklamprecht@live.de>
2019-05-19 19:58:41 +10:00
CraftBukkit/Spigot
4f21c71d98 SPIGOT-4880: Potion effects with unknown names.
By: md_5 <git@md-5.net>
2019-05-07 09:22:45 +10:00
CraftBukkit/Spigot
1915b49ec3 SPIGOT-4872: LootTables missing a few loot tables
By: md_5 <git@md-5.net>
2019-05-06 08:40:15 +10:00
CraftBukkit/Spigot
e413f6ef8f SPIGOT-4871: Manually opened double chest doesn't have close animation
By: md_5 <git@md-5.net>
2019-05-05 18:39:58 +10:00
CraftBukkit/Spigot
12ecbc64a0 SPIGOT-4802: Add CrossbowMeta
By: md_5 <git@md-5.net>
2019-05-01 20:18:01 +10:00
CraftBukkit/Spigot
a3c770141e SPIGOT-4818: Unit test banner patterns
By: md_5 <git@md-5.net>
2019-04-30 15:20:11 +10:00
CraftBukkit/Spigot
bfea9a3269 Add Override annotations where appropriate
By: md_5 <git@md-5.net>
2019-04-28 11:38:01 +10:00