Commit Graph

173 Commits

Author SHA1 Message Date
7c3b78b0a0 ItemFactory: fix missing registration for dead coral fans
closes #5032

this is evidently not an ideal solution, and something more dynamic would be preferred so that we don't have to manually register an item for every permutation.
2022-05-13 13:53:28 +01:00
69418084bc Boat: fixed max stack size to match vanilla (#5018) 2022-05-10 13:16:04 +01:00
5a98b08ee8 Fixed several crashes on bad data due to inadequate TAG_List type checks 2022-04-19 16:48:18 +01:00
55dfacea8d Item: Improve performance of nbtSerialize() (#4831)
Replace hasNamedTag() with $nbt->count() > 0
This avoids a duplicate indirect call to Item::serializeCompoundTag() method call when serializing items with namedtags.
2022-02-16 00:32:12 +00:00
7ddd547190 Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-06 23:55:52 +00:00
859f062267 StringToItemParser: fixed *_concrete_powder giving concrete instead of concrete powder 2022-02-01 23:29:47 +00:00
22fb02c4e6 Replace disallowed operators in src/item/ 2022-01-20 19:16:50 +00:00
1366c49f1f Implemented Lectern (#4708)
Co-authored-by: Covered123 <58715544+JavierLeon9966@users.noreply.github.com>
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2022-01-15 21:21:29 +00:00
75fc7a2d1f Merge branch 'stable' into next-minor 2022-01-07 20:16:35 +00:00
6d249026cc Merge branch 'legacy/pm3' into stable 2022-01-07 20:15:15 +00:00
fb29653ed7 Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-06 22:43:57 +00:00
3ed57ce49a Merge pull request from GHSA-p62j-hrxm-xcxf
This checks the following things:
- Validity of UTF-8 encoding of title, author, and page content
- Maximum soft and hard lengths of title, author, and page content (soft
  limits may be bypassed by uncancelling PlayerEditBookEvent; hard
  limits may not be bypassed)
- Maximum number of pages. Books with more than 50 pages may still be
  edited, but may not have new pages added.
2022-01-04 20:39:02 +00:00
a94b88424e Merge branch 'stable' into next-minor 2021-12-10 19:15:57 +00:00
3b77462935 WritableBookBase: fixed crash when finding pages containing corrupted UTF-8 characters
maybe we should treat this as corrupted? but for now, it's consistent with how we deal with signs.
2021-12-10 16:39:13 +00:00
889d048ca3 Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
1d14c8cb6b Merge branch 'stable' into next-minor 2021-12-07 00:41:48 +00:00
ed4978c31b Added VanillaItems::AIR()
we don't usually add VanillaItems entries for blocks since they already exist in VanillaBlocks, but air has a special use case specifically as an itemstack, so we make an exception for this case.
2021-12-07 00:41:07 +00:00
5a351d3b17 StringToItemParser: fixed not recognizing slime or slime_block 2021-12-06 23:51:30 +00:00
0530cb72df StringToItemParser: fixed some bogus aliases inherited from Item::fromString() 2021-12-06 23:44:41 +00:00
cd850b111d SplashPotion: added getType() (#4613) 2021-12-06 20:29:01 +00:00
5556861000 ItemFactory: move SweetBerries registration to the correct place 2021-11-26 00:46:35 +00:00
5c7125f190 Improved error handling for loading broken entity / tile data 2021-11-23 17:41:26 +00:00
3dd03075cb StringToItemParser: added some quality-of-life aliases 2021-11-14 15:52:50 +00:00
639867a640 Added missing aliases for wooden items 2021-11-14 15:51:41 +00:00
19a3efe893 ....... 2021-11-08 18:57:14 +00:00
a1ecdc27e5 Removed Vanilla*::fromString()
these were misbegotten and should never have existed.
If someone really needs these for some reason, they can use getAll()[name].
2021-11-08 18:52:14 +00:00
1fb60b5b3a CS fix again 2021-11-08 18:45:05 +00:00
08420c2556 Added new dynamic StringToEnchantmentParser
this should be used instead of VanillaEnchantments::fromString(), because it allows registering custom aliases.
2021-11-08 18:44:15 +00:00
18f5fb66bb Abstract the base functionality of StringToItemParser 2021-11-08 18:37:05 +00:00
ede4157814 Check to see if the player can start using the Releasable item. (#4532) 2021-11-02 14:36:16 +00:00
8523f0fb0b CS fix 2021-10-13 20:31:24 +01:00
b570324288 LegacyStringToItemParser: rely exclusively on item_from_string_bc_map.json, do not interpret integers given as strings
fixes #4507
2021-10-13 20:29:18 +01:00
6284cd14c7 LegacyStringToItemParser: added getMappings() 2021-10-13 20:19:44 +01:00
49c1e4c06e Implement fletching table (#4501) 2021-10-12 21:21:05 +01:00
dbeaf27cb7 Document that Item::setNamedTag() may cause NbtException to be thrown
if the NBT is bogus for some reason
in PM3, these kinds of bugs wouldn't show up until/unless the item NBT was actually used, but on PM4, we decode it ahead of time, so the errors always show up immediately.
2021-10-05 19:09:22 +01:00
05e2bef5ce ItemFactory: fix crash when checking if blockitem IDs are registered 2021-09-16 14:53:19 +01:00
c062282954 Drop enchantment runtime IDs 2021-09-03 21:20:43 +01:00
aa5a9f6d12 Enchantment: use Translatable instead of hardcoded translation keys 2021-09-03 20:52:05 +01:00
fbbaef4401 Enchantment: use promoted properties 2021-09-03 20:41:43 +01:00
8847aa2d7f LegacyStringToItemParser: mark as deprecated, and point people towards StringToItemParser, which is much nicer 2021-08-29 16:13:19 +01:00
2d025bf02f Populate StringToItemParser with some names from VanillaBlocks
this makes just about everything easily accessible via commands.
There are some stuff that shouldn't be here due to not being actual items (e.g. door blocks, bed blocks, wall coral fans) but since there were legacy aliases for all those things already, I figured what the heck - it's more effort to exclude them, so whatever.
2021-08-23 14:49:30 +01:00
78b0275a6c StringToItemParser: added a bunch of nice new aliases
this should especially make potions less cancerous to /give.
2021-08-23 14:25:00 +01:00
7fd712c1ff Refactor Block & Tile: getPos() to getPosition() (#4395)
this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
2021-08-23 14:01:32 +01:00
22316976fa Introduce next-generation StringToItemParser
this isn't specced up with some of the finer features of LegacyStringToItemParser such as metadata parsing, but those are still a work in progress (and probably limited to specific items like durable stuff).
The goal is to unbind these aliases from legacy internal IDs, while also providing a nice flexible way for plugins to add their own items and aliases to the existing system.

This system allows mapping a string to any item at all, irrespective of state, internal IDs, or any of that nonsense. This means it's finally possible to have stuff like lapis_lazuli and bone_meal aliases in commands.
2021-08-23 00:39:20 +01:00
270ee5c085 Simplify registry method generation 2021-08-22 23:02:36 +01:00
cf77b33c3b Bows can now use offhand arrows (#4356) 2021-08-10 19:36:57 +01:00
309bed414f Implemented sweet berries (#4164)
this doesn't implement the server-side logic for the "stickiness" (slowdown) because we don't have the system needed for it yet.
It also doesn't have parity with vanilla on the damage.
2021-07-19 20:01:33 +01:00
654fc9a2a6 LegacyStringToItemParser: Throw more specific exceptions 2021-07-10 21:03:12 +01:00
7a35fdb1bb Allow Blocks to specify their max stack size 2021-06-30 19:28:16 +01:00
c05f6db8d9 Bed and Skull items now return a correct block, with appropriate type information
I wanted to do the same for banners, but unfortunately banners are a tad more complicated.
2021-06-30 17:27:14 +01:00