Commit graph

265 commits

Author SHA1 Message Date
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
CraftBukkit/Spigot
c9a23d73a0 Replace ItemTag API with new API that also expands to Tiles and Entities
By: Bjarne Koll <LynxPlay101@gmail.com>
2019-04-25 14:36:46 +10:00
CraftBukkit/Spigot
2f808394c5 SPIGOT-4736: Serialized ItemStack Lore Doesn't Deserialize
By: md_5 <git@md-5.net>
2019-04-25 10:06:40 +10:00
CraftBukkit/Spigot
4e5e39eda9 SPIGOT-4727: Fix CraftEvil for legacy plugins
By: md_5 <git@md-5.net>
2019-04-24 09:40:42 +10:00
CraftBukkit/Spigot
b15c3451a2 Fix weird test import in EnderDragonPhaseTest
By: md_5 <git@md-5.net>
2019-04-23 21:28:41 +10:00
CraftBukkit/Spigot
09673c1a03 Apply import ordering rules to CraftBukkit classes
By: md_5 <git@md-5.net>
2019-04-23 14:54:36 +10:00
CraftBukkit/Spigot
7afe4d02f8 Begin implementation of CheckStyle style checking
By: md_5 <git@md-5.net>
2019-04-23 14:00:30 +10:00
CraftBukkit/Spigot
a0f2b74c8d Update to Minecraft 1.14-pre5
By: md_5 <git@md-5.net>
2019-04-23 12:00:00 +10:00
CraftBukkit/Spigot
3d88c2acc0 Remove the Damage tag from items when it is 0.
CraftBukkit (and Minecraft as well in some cases, such as when getting
an item from the creative inventory menu) will omit the Damage tag when
it is zero. However, minecraft will add the tag in some situations
nevertheless, such as when loading the ItemStack, or when explictly
setting the item undamaged.

These items (with and without the Damage tag for undamaged items) will
be considered as different by minecraft and CraftBukkit in various
situations, even though they should not. In CraftBukkit these items will
actually only be considered unsimilar if the items' metadata is not
'empty' (if it contains other additional metadata, such as enchantments,
etc.).

If the item's tag is empty after removing the Damage tag, it gets
completely removed. The setRepairCost function was adapted to behave in
the same way (removal of the tag if it becomes empty).

By: blablubbabc <lukas@wirsindwir.de>
2019-04-18 11:56:42 +02:00
CraftBukkit/Spigot
dcc541a4a0 Mappings Update
By: md_5 <git@md-5.net>
2019-03-17 11:48:53 +11:00
CraftBukkit/Spigot
6846b3d2d9 SPIGOT-4646: Test + fix InventoryWrapper.getContents
By: md_5 <git@md-5.net>
2019-03-05 16:59:40 +11:00
CraftBukkit/Spigot
a6ec0de609 Fix EntityPickupItemEvent getRemaining / PlayerInventory#canHold
Without this change the calculation of fitting items was incorrect, so event.getRemaining() did return 0 when it should not be 0.

By: Brokkonaut <hannos17@gmx.de>
2019-02-12 04:49:24 +01:00
CraftBukkit/Spigot
1f4d52d582 SPIGOT-4577: Fix loss of int/double custom tags when serialized to yaml
By: Bjarne Koll <LynxPlay101@gmail.com>
2019-01-13 16:25:17 +01:00
CraftBukkit/Spigot
42831b84cd Add BlockData#getAsString(boolean) to hide unspecified states
By: Parker Hawke <hawkeboyz2@hotmail.com>
2018-12-16 18:21:29 -05:00
CraftBukkit/Spigot
83baf22bde Mappings Update
By: md_5 <git@md-5.net>
2018-12-13 11:00:00 +11:00
CraftBukkit/Spigot
b69f1de549 SPIGOT-4347: Add API to allow storing arbitrary values on ItemStacks
By: Bjarne Koll <LynxPlay101@gmail.com>
2018-12-01 20:26:23 +11:00
CraftBukkit/Spigot
699739c7f0 SPIGOT-4489: NOTE_BLOCK incorrectly has BlockStateMeta
By: md_5 <git@md-5.net>
2018-11-16 15:18:28 +11:00
CraftBukkit/Spigot
43b017f431 SPIGOT-4455: ChunkData.getType returns legacy material
By: md_5 <git@md-5.net>
2018-10-29 07:17:59 +11:00
CraftBukkit/Spigot
a194267323 Update to Minecraft 1.13.2
By: md_5 <git@md-5.net>
2018-10-23 06:00:00 +11:00
CraftBukkit/Spigot
0de14a04dd SPIGOT-4399: Add attribute modifier equality test
By: Nathan Wolf <nathan@elmakers.com>
2018-09-26 17:21:53 -07:00
CraftBukkit/Spigot
ded48a6734 Add API to locate structures.
By: Senmori <thesenmori@gmail.com>
2018-09-21 08:49:54 -04:00
CraftBukkit/Spigot
2eeecfdb92 Fix some tests randomly failing
By: md_5 <git@md-5.net>
2018-08-26 20:44:50 +10:00
CraftBukkit/Spigot
9fb6b929e8 Add additional tests for CraftBlockData
By: Senmori <thesenmori@gmail.com>
2018-08-25 01:35:40 -04:00
CraftBukkit/Spigot
f578d94680 Update to Minecraft 1.13.1
By: md_5 <git@md-5.net>
2018-08-26 12:00:00 +10:00
CraftBukkit/Spigot
39c4334d76 SPIGOT-1936: LootTable API
By: Senmori <thesenmori@gmail.com>
2018-08-12 18:39:51 +10:00
CraftBukkit/Spigot
422f1f548e Expand GameRule API
By: Senmori <thesenmori@gmail.com>
2018-08-11 11:24:33 +10:00
CraftBukkit/Spigot
a41e9fe8a5 Add Unit Tests for geHardness and getBlastResistance
By: Christos Miniotis <chrismin1302@gmail.com>
2018-08-08 04:06:36 +03:00
CraftBukkit/Spigot
a24a2c26ae Add merging and matching of parsed BlockData
By: md_5 <git@md-5.net>
2018-08-06 14:40:06 +10:00
CraftBukkit/Spigot
b4349f5a60 SPIGOT-3936: Add isInteractable to Material
By: Christos Miniotis <chrismin1302@gmail.com>
2018-08-02 15:26:02 +03:00
CraftBukkit/Spigot
e9fc2452ed SPIGOT-4214: Catch attempts to create BlockData for items
By: md_5 <git@md-5.net>
2018-08-02 20:24:56 +10:00
CraftBukkit/Spigot
1e014acb80 Update to Minecraft 1.13
By: md_5 <git@md-5.net>
2018-07-22 12:00:00 +10:00
CraftBukkit/Spigot
6826aaee8f SPIGOT-4074: Fix createBlockData succeeding on garbage
By: md_5 <git@md-5.net>
2018-07-20 10:20:15 +10:00
CraftBukkit/Spigot
39de92187e Revert "SPIGOT-4035: Enforce case-sensitivity for chat format code matching."
Minecraft allows uppercase colour codes.

This reverts commit 844204b345.

By: md_5 <git@md-5.net>
2018-07-19 10:07:04 +10:00
CraftBukkit/Spigot
199b4654cd Amend previous unit test to use JSON rather than toString for validation
By: md_5 <git@md-5.net>
2018-07-18 09:40:51 +10:00
CraftBukkit/Spigot
844204b345 SPIGOT-4035: Enforce case-sensitivity for chat format code matching.
This maintains case-insensitivity for URL matching, and adds a unit test to verify correct conversion via CraftChatMessage.

By: Hex <hex@hex.lc>
2018-07-17 16:42:30 -06:00
CraftBukkit/Spigot
be907fd21b SPIGOT-4030: Improve CraftItemStack.hasItemMeta
By: md_5 <git@md-5.net>
2018-07-17 17:13:55 +10:00
CraftBukkit/Spigot
7e0a66fdd5 Update to Minecraft 1.13-pre7
By: md_5 <git@md-5.net>
2018-07-15 10:00:00 +10:00
CraftBukkit/Spigot
c3bf431172 Fix incorrect unit test name
By: md_5 <git@md-5.net>
2018-02-16 10:33:36 +11:00
CraftBukkit/Spigot
4cb801b840 Unit tests for Material.isItem
By: md_5 <git@md-5.net>
2018-01-16 09:57:47 +11:00
CraftBukkit/Spigot
dfa7c9eedb SPIGOT-2892: Fix some clone implementations and add unit test
By: md_5 <git@md-5.net>
2017-12-16 10:18:34 +11:00
CraftBukkit/Spigot
9a2cfd9957 Add ChunkDataTest from PR #157
By: Antony Riley <antony@cyberiantiger.org>
2017-12-08 19:37:15 +11: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
40c8954e17 Update to Minecraft 1.12-pre2
By: md_5 <git@md-5.net>
2017-05-14 12:00:00 +10:00
CraftBukkit/Spigot
1c486f86db Add Material.isFuel to check if a material is a furnace fuel.
By: Phoenix616 <mail@moep.tv>
2017-03-23 23:18:32 +01:00
CraftBukkit/Spigot
dd89db67a5 SPIGOT-1592: Implement ItemMeta for Spawn Eggs
The Minecraft implementation of spawn eggs is able to construct an entity using all data that is present in the save format, however since the Bukkit API has no such way to construct an entity unattached to a world, and it appears creating such a way is a very challenging task, the decision was instead made to add this API now that 1.11 has entities which may not be represented by data values.
In the future it may be possible to implement a more expanded API cognate with this one.

By: Matthew <stteg@hotmail.com>
2016-12-06 21:15:10 +11:00
CraftBukkit/Spigot
a00951dd57 SPIGOT-2871: Improve BlockStates + BlockStateMeta
By: md_5 <git@md-5.net>
2016-12-02 09:29:33 +11:00
CraftBukkit/Spigot
38fb5c2469 Add stopSound for specific sound category & unit test for SoundCategory
By: md_5 <git@md-5.net>
2016-11-19 14:27:18 +11:00
CraftBukkit/Spigot
7e4dfe78e5 SPIGOT-2787: Keep performing getter null conversion at call sites
By: md_5 <git@md-5.net>
2016-11-18 11:07:02 +11:00
CraftBukkit/Spigot
a75c80e93d Remove unit test based on now incorrect assumptions
By: md_5 <git@md-5.net>
2016-11-18 09:11:17 +11:00
CraftBukkit/Spigot
4e412ab4e3 Update to Minecraft 1.11
By: md_5 <git@md-5.net>
2016-11-17 12:41:03 +11:00
CraftBukkit/Spigot
b46eb8a572 SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE
By: md_5 <git@md-5.net>
2016-07-08 12:51:32 +10:00
CraftBukkit/Spigot
f155cbbaf2 BUILDTOOLS-251: Make much of Bukkit locale independent
By: md_5 <git@md-5.net>
2016-06-26 19:32:05 +10:00
CraftBukkit/Spigot
a39b7e5f3a Update to Minecraft 1.10
By: md_5 <git@md-5.net>
2016-06-09 11:43:49 +10:00
CraftBukkit/Spigot
15f22a7986 SPIGOT-1934: Expand EnderDragon API - implement dragon phases
By: Matthew <stteg@hotmail.com>
2016-03-15 23:32:37 -04:00
CraftBukkit/Spigot
104519f08f SPIGOT-1638 / SPIGOT-1673: Rework Potions API
By: t00thpick1 <t00thpick1dirko@gmail.com>
2016-03-02 20:43:58 -05:00
CraftBukkit/Spigot
84d08ed896 Ignore FROSTED_ICE in meta unit tests.
By: md_5 <git@md-5.net>
2016-03-01 13:30:26 +11:00
CraftBukkit/Spigot
47dc73969e Run Biome test with AbstractTestingBase
By: md_5 <git@md-5.net>
2016-03-01 09:49:29 +11:00
CraftBukkit/Spigot
21d4bf5d1f Update to Minecraft 1.9
By: md_5 <git@md-5.net>
2016-03-01 08:32:46 +11:00
CraftBukkit/Spigot
38b1bb1aef Update to 1.8.4
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-05-05 21:43:47 +01:00
CraftBukkit/Spigot
02c89ee898 Update the rename markers
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-03-19 21:29:12 +00:00
CraftBukkit/Spigot
d5926b189e SPIGOT-370: Remove LOCKED_CHEST
It doesn't exist anymore and has been deprecated for a year

By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-03-11 17:49:10 +00:00
CraftBukkit/Spigot
e6c5eefd78 Add a unit test for map colors
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-03-07 12:57:59 +00:00
CraftBukkit/Spigot
85be409b13 Update to Minecraft 1.8.3
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-02-26 22:41:06 +00:00
CraftBukkit/Spigot
e37df9a195 Fix PerMaterialTest skipping useful tests for certain blocks
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2015-01-25 11:59:37 +00:00
CraftBukkit/Spigot
4335c4162c Remove DEBUG_ALL_BLOCK_STATES due to it being broken
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-12-28 16:56:54 +00:00
CraftBukkit/Spigot
7d1aaec723 Rewrite book handling, Fixes SPIGOT-182 and part of SPIGOT-164
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-12-11 19:38:09 +00:00
CraftBukkit/Spigot
6ee362dcff Add CraftMetaTileEntity, fixes the previously broken tests
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-12-07 13:22:56 +00:00
CraftBukkit/Spigot
1c82ce69db Disable some tests whilst issues with them are looked into
By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-12-07 11:50:45 +00:00
CraftBukkit/Spigot
a419776f3c Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/

By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-11-26 08:32:16 +11:00
CraftBukkit/Spigot
79e5718f39 Update CraftBukkit to Minecraft 1.7.10
By: Travis Watkins <amaranth@ubuntu.com>
2014-06-26 13:05:08 -05:00
CraftBukkit/Spigot
42f39726c3 Handle profiles in SkullMeta, they don't store a string anymore.
By: Travis Watkins <amaranth@ubuntu.com>
2014-04-17 14:04:12 -05:00
CraftBukkit/Spigot
e6de9aaa17 Update CraftBukkit to Minecraft 1.7.5
By: Nate Mortensen <nate.richard.mortensen@gmail.com>
2014-03-20 22:26:30 -06:00
CraftBukkit/Spigot
f87c5cd9dd [Bleeding] Fix Achievements and Statistics API. Fixes BUKKIT-5305
By: t00thpick1 <t00thpick1dirko@gmail.com>
2014-01-14 23:42:40 -05:00
CraftBukkit/Spigot
75d5bdc98c Add failing unit test for ItemMeta-repairability
By: Wesley Wolfe <weswolf@aol.com>
2014-01-14 17:56:49 -06:00
CraftBukkit/Spigot
5783df9d13 Update CraftBukkit to Minecraft 1.7.2
By: mbax <matt@phozop.net>
2013-11-04 07:07:38 -06:00
CraftBukkit/Spigot
2436b7abb8 Make ItemFactoryTest.java platform agnostic. Fixes BUKKIT-4695
Maven paths that include spaces (and possible other characters) get
improperly translated when using a file handle from a URL. This changes
the unit test to open a stream directly from the URL, providing proper
file resolution on multiple platforms.

By: Wesley Wolfe <weswolf@aol.com>
2013-08-14 02:31:18 -05:00
CraftBukkit/Spigot
a5280f8caa Fix javac workaround in ItemStackTest
By: Wesley Wolfe <weswolf@aol.com>
2013-08-06 20:09:42 -05:00
CraftBukkit/Spigot
cb196c424a Add BukkitObjectIOStream tests on top of ItemMeta tests
By: Wesley Wolfe <weswolf@aol.com>
2013-05-19 01:17:32 -05:00
CraftBukkit/Spigot
59bb6e9030 Store item attributes. Addresses BUKKIT-4523
By: Wesley Wolfe <weswolf@aol.com>
2013-07-23 23:25:04 -05:00
CraftBukkit/Spigot
a578800a63 Update CraftBukkit to 1.6.1
By: Nate Mortensen <nate.richard.mortensen@gmail.com>
2013-07-01 06:03:00 -05:00
CraftBukkit/Spigot
afa8771324 Add methods to check conflicting enchantments. Adds BUKKIT-3830
By: GJ <gjmcferrin@gmail.com>
2013-03-20 01:35:22 -04:00
CraftBukkit/Spigot
a553ddbb0b Implement unit test for hasGravity(). Adds BUKKIT-3832
By: nitnelave <nitnelave1@gmail.com>
2013-02-15 02:38:34 +01:00
CraftBukkit/Spigot
18164ee949 Update CraftBukkit to Minecraft 1.5
By: Travis Watkins <amaranth@ubuntu.com>
2013-03-13 17:33:27 -05:00
CraftBukkit/Spigot
5948863935 Improve the item meta deserialization code-style
Fixed the ItemMetaFireworkTest

Add set power unit tests for FireworkMeta

By: Wesley Wolfe <weswolf@aol.com>
2013-01-18 02:21:38 -06:00
CraftBukkit/Spigot
58a6642ca7 Add ItemStackMapTest
This test was missing from c056293b38cb9a1296937d91746b175252be044a

By: Wesley Wolfe <weswolf@aol.com>
2013-01-15 01:22:53 -06:00
CraftBukkit/Spigot
58090423c0 Update unit test to reflect firework color fix. Fixes BUKKIT-3382
The ItemDye color-int array uses dye data values, not wool.

By: Wesley Wolfe <weswolf@aol.com>
2013-01-05 17:00:25 -06:00
CraftBukkit/Spigot
e9c52a3ffc Update calls to DyeColor getData and getByData. Addresses BUKKIT-2786
These two methods are now deprecated and replaced by the strictly
equivalent calls using wool data.

By: Wesley Wolfe <weswolf@aol.com>
2013-01-05 16:45:34 -06:00
CraftBukkit/Spigot
5d61bfd5fa Implement 1.4.6 ItemMeta. Adds BUKKIT-3236, BUKKIT-3237
Some meta functionality is refactored into common methods.

CraftItemStack uses the ItemMetaKey identifiers for enchantments.

Refactored unit test to include extra functionality; initially only
checking the presence of the DelegateDeserialization annotation.

By: Wesley Wolfe <weswolf@aol.com>
2012-12-21 07:37:53 -06:00
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