This PR contains all of Tuinity's patches. Very notable ones are:
- Highly optimised collisions
- Optimised entity lookups by bounding box (Mojang made regressions in 1.17, this brings it back to 1.16)
- Starlight https://github.com/PaperMC/Starlight
- Rewritten dataconverter system https://github.com/PaperMC/DataConverter
- Random block ticking optimisation (wrongly dropped from Paper 1.17)
- Chunk ticking optimisations
- Anything else I've forgotten in the 60 or so patches
If you are a previous Tuinity user, your config will not migrate. You must do it yourself. The config options have simply been moved into paper.yml, so it will be an easy migration. However, please note that the chunk loading options in tuinity.yml are NOT compatible with the options in paper.yml.
* Port tuinity, initial patchset
* Update gradle to 7.2
jmp said it fixes rebuildpatches not working for me. it fucking better
* Completely clean apply
* Remove tuinity config, add per player api patch
* Remove paper reobf mappings patch
* Properly update gradlew
* Force clean rebuild
* Mark fixups
Comments and ATs still need to be done
* grep -r "Tuinity"
* Fixup
* Ensure gameprofile lastaccess is written only under the state lock
* update URL for dataconverter
* Only clean rebuild tuinity patches
might fix merge conflicts
* Use UTF-8 for gradlew
* Clean rb patches again
* Convert block ids used as item ids
Neither the converters of pre 1.13 nor DFU handled these cases,
as by the time they were written the game at the time didn't
consider these ids valid - they would be air. Because of this,
some worlds have logspam since only DataConverter (not DFU or
legacy converters) will warn when an invalid id has been
seen.
While quite a few do need to now be considered as air, quite a lot
do not. So it makes sense to add conversion for these items, instead
of simply suppressing or ignoring the logs. I've now added id -> string conversion
for all block ids that could be used as items that existed in the game
before 1.7.10 (I have no interest in tracking down the
exact version block ids stopped working) that were on
https://minecraft-ids.grahamedgecombe.com/
Items that did not directly convert to new items will
be instead converted to air: stems, wheat crops, piston head,
tripwire wire block
* Fix LightPopulated parsing in V1466
The DFU code was checking if the number existed, not if it
didn't exist. I misread the original code.
* Always parse protochunk light sources unless it is marked as non-lit
Chunks not marked as lit will always go through the light engine,
so they should always have their block sources parsed.
* Update custom names to JSON for players
Missed this fix from CB, as it was inside
the DataFixers class.
I decided to double check all of the CB changes again:
DataFixers.java was the only area I missed, as I had inspected all
datafixer diffs and implemented them all into DataConverter. I also
checked Bootstrap.java again, and re-evaluated their changes. I had
previously done this, but determined that they were all bad.
The changes to make standing_sign block map to oak_sign block in
V1450 is bad, because that's not the item id V1450 accepts. Only
in 1.14 did oak_sign even exist, and as expected there is a converter
to rename all existing sign items/blocks.
The fix to register the portal block under id 1440 is useless, as
the flattenning logic will default to the lowest registered id - which
is the exact blockstate that CB registers into 1440. So it just
doesn't do anything.
The extra item ids in the id -> string converter are already added,
but I found this from EMC originally.
The change for the spawn egg id 23 -> Arrow is just wrong,
that id DOES correspond to TippedArrow, NOT Arrow. As
expected, the spawn egg already has a dedicated mapping for
Arrow, which is id 10 - which was Arrow's entity id.
I also ported a fix for the cooked_fished id update. This doesn't
really matter since there is already a dataconverter to fix this,
but the game didn't accept cooked_fished at the time. So I see
no harm.
* Review all converters and walkers
- Refactor V99 to have helper methods for defining entity/tile
entity types
- Automatically namespace all ids that should be namespaced.
While vanilla never saved non-namespaced data for things that
are namespaced, plugins/users might have.
- Synchronised the identity ensure map in HelperBlockFlatteningV1450
- Code style consistency
- Add missing log warning in V102 for ITEM_NAME type conversion
- Use getBoolean instead of getByte
- Use ConverterAbstractEntityRename for V143 TippedArrow -> Arrow
rename, as it will affect ENTITY_NAME type
- Always set isVillager to false in V502 for Zombie
- Register V808's converter under subversion 1 like DFU
- Register a breakpoint for V1.17.1. In the future, all final
versions of major releases will have a breakpoint so that
the work required to determine if a converter needs a breakpoint
is minimal
- Validate that a dataconverter is only registered for a version
that is registered
- ConverterFlattenTileEntity is actually ConverterFlattenEntity
It even registered the converters under TILE_ENTITY, instead of
ENTITY.
- Fix id comparison in V1492 STRUCTURE_FEATURE renamer
- Use ConverterAbstractStatsRename for V1510 stats renamer
At the time I had written that class, the abstract renamer didn't
exist.
- Ensure OwnerUUID is at least set to empty string in
V1904 if the ocelot is converted to a cat (this is
likely so that it retains a collar)
- Use generic read/write for Records in V1946
Records is actually a list, not a map. So reading map was
invalid.
* Always set light to zero when propagating decrease
This fixes an almost infinite loop where light values
would be spam queued on a very small subset on blocks.
This also likely fixes the memory issues people were
seeing.
* re-organize patches
* Apply and fix conflicts
* Revert some patches
getChunkAt retains chunks so that plugins don't spam loads
revert mc-4 fix will remain unless issues pop up
* Shuffle iterated chunks if per player is not enabled
Can help with some mob spawning stacking up at locations
* Make per player default, migrate all configs
* Adjust comments in fixups
* Rework config for player chunk loader
Old config is not compatible. Move all configs to be
under `settings` in paper.yml
The player chunk loader has been modified to
less aggressively load chunks, but to send
chunks at higher rates compared to tuinity. There are
new config entries to tune this behavior.
* Add back old constructor to CompressionEncoder/Decoder (fixes
Tuinity #358)
* Raise chunk loading default limits
* Reduce worldgen thread workers for lower core count cpus
* Raise limits for chunk loading config
Also place it under `chunk-loading`
* Disable max chunk send rate by default
* Fix conflicts and rebuild patches
* Drop default send rate again
Appears to be still causing problems for no known reason
* Raise chunk send limits to 100 per player
While a low limit fixes ping issues for some people, most people
do not suffer from this issue and thus should not suffer from
an extremely slow load-in rate.
* Rebase part 1
Autosquash the fixups
* Move not implemented up
* Fixup mc-dev fixes
Missed this one
* Rebase per player viewdistance api into the original api patch
* Remove old light engine patch part 1
The prioritisation must be kept from it, so that part
has been rebased into the priority patch.
Part 2 will deal with rebasing all of the patches _after_
* Rebase remaining patches for old light patch removal
* Remove other mid tick patch
* Remove Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
Replaced by `Do not copy visible chunks`
* Revert AT for Vec3i setX/Y/Z
The class is immutable. set should not be exposed
* Remove old IntegerUtil class
* Replace old CraftChunk#getEntities patch
* Remove import for SWMRNibbleArray in ChunkAccess
* Finished merge checklist
* Remove ensureTickThread impl in urgency patch
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
ea7b3a0d #654: Clarify conditions where a bed can explode
CraftBukkit Changes:
e167f280 SPIGOT-6726: NPE when calling getBossBar() on plugin spawned EnderDragon
CraftBukkit breaks legacy world conversion in three ways:
- Writes userdata to the path of the userdata folder rather than to
the correct file inside the aforementioned folder. This causes the
userdata folder to fail to be created as a file already exists at
its path.
- Makes changes to how multiworld works, without modifying
McRegionUpgrader to be aware of these changes.
- Calls methods on Bukkit before the server is initialized.
This patch fixes all of these issues, and also threads the
McRegionUpgrader to improve performance.
* Ensure priority updates are determined by current level, not deferred level
Deferral could cause an infinite loop to occur.
Also, re-add the light engine priority logic.
* Rebase
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
5be41fb8 SPIGOT-6720: Fix bed explosion checks
09b99daf SPIGOT-6722: Close entity manager when unloading world
3a9561bf SPIGOT-6686: Changes in MaximumRepairCost for Anvil Rename cause inconsistency
The chunk system can swallow the exception given it's all
built with completablefuture, so ensure it is at least printed.
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
c9a46ebf #653: Add World#spawn with randomizeData parameter
e49c2e3a Damageable should extend ItemMeta
01ff04f4 SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
ca5b4b1a SPIGOT-6697: Deprecate generateTree with BlockChangeDelegate as it does not handle tiles
CraftBukkit Changes:
7c8bbcbe SPIGOT-6716: Preserve the order of stored enchantments of enchanted books.
18027d02 #914: Add World#spawn with randomizeData parameter
3cad0316 SPIGOT-6714: Don't fire PlayerBucketEvent when empty
8c6d60cf Fix server crash with BlockPopulator when entities are at a negative chunk border
4f6bcc84 SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
78d5b35b SPIGOT-6697: Restore generateTree with BlockChangeDelegate behaviour
15792f0d Rebuild patch
c949675e SPIGOT-6713: Cancelling EntityTransformEvent Causes Deceased Slimes To Not Despawn
a955f15c Fix issues with new ChunkGenerator API
a0a37f41 SPIGOT-6630: Replacing an enchantment on an item creates a conflict error
Spigot Changes:
b166a49b Rebuild patches
3c1fc60a SPIGOT-6693: Composters only take in one item at custom hopper speeds
This object is created so often that it likely creates problems with the
ThreadLocalMap because the weak references can't be cleaned up fast
enough. This has manifest as lag seemingly caused by WorldEdit:
https://github.com/EngineHub/WorldEdit/issues/1668
Mojang made some changes to priorities in 1.17 and it seems that these changes
conflict with the changes made in this patch, which in some cases appears to
cause excessive rescheduling of tasks.
This, however, is not confirmed as such but seems to be the behavior that we're
seeing to cause this issue, if mojang has adopted the changes we suggested,
then a good chunk of this patch may be unneeded, but, this needs a much better
look than I'm currently able to do
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
e0598aa2 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
CraftBukkit Changes:
2cdc6b1e4 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
When a ServerEntity instance is first constructed, it uses a pre-Java 9 empty collection,
but passengers use Guava ImmutableList. When comparing the two collections via Object#equals
we miss out on an opportunity to reduce the check to little more than a reference equality
check (which is very fast).
The previously existing toBuilder method defined on the CraftMetaBook
would, no matter if called on a writable or written book, return a
builder targetting a writable book, in which complex components, such as
hover or click text are not allowed.
The builer hence serializes the page components using LEGACY_UXRC to
ensure only colour may be passed. While this works as intented for
writable books, the builder fails to fully support the complex
components that may be used in a written book.
This commit implemements a child class of the CraftMetaBookBuilder, the
CraftMetaBookSignedBuilder, which builds to a CraftMetaBookSigned
instance and hence serializes the pages to json.
This builder instance is automatically supplied when calling toBuilder
on a CraftMetaBookSigned instance.
Resolves: #6296
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
75a0ee4f SPIGOT-6691: Material.LAVA_CAULDRON is not Levelled
CraftBukkit Changes:
e1c96e50 SPIGOT-6682: Blocking with shield not reset after die
97f629b6 SPIGOT-6220: Structures in the world with custom generator not work
85379258 Increase outdated build delay
f7f8dce4 SPIGOT-6552: Some inventory types reset cursor on switch
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
6788550f SPIGOT-6678: ChunkSnapshot#isSectionEmpty() not working as intended.
3ad0fb1c #901: Fix PlayerStatisticIncrementEvent spam
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
e7b0f8d6 #642: Add Crafting methods to API
9e58831e SPIGOT-6641: Use varargs in sendMessage
e409fe49 SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled
6997c726 SPIGOT-6661: Fix missing radius from GenericGameEvent
02d03f35 SPIGOT-6369: Add ItemStack to HangingPlaceEvent
CraftBukkit Changes:
0abf420c SPIGOT-6665: Shearing a Snowman does not drop a carved pumpkin
e8e3cbcc #893: Add Crafting methods to API
879acfee Fix missing varargs from previous commit
6572b9c3 SPIGOT-6641: Use varargs in sendMessage
9e06bb2a SPIGOT-6663: Chicken Jockeys chickens don't despawn
699f2d36 SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled
8ffa54ba SPIGOT-6369: Add ItemStack to HangingPlaceEvent
c851639c SPIGOT-6645: Call EntityChangeBlockEvent before PlayerHarvestBlockEvent
8d244b0b SPIGOT-3725, SPIGOT-6638, MC-136917: Properly clear tile entities before replacing
Spigot Changes:
18c71bf4 Rebuild patches
ASM was not meant to exposed to API consumers in the first place, and for the duration of time it has been exposed, it has also been relocated.
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
eec4aab0 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent
205213c6 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron
CraftBukkit Changes:
b8c522d5 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent
f04a77dc SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron
d1dbcebc SPIGOT-6653: Canceling snow bucket placement removes snow from bucket
4f34a67b #891: Fix scheduler task ID overflow and duplication issues
Spigot Changes:
d03d7f12 BUILDTOOLS-604: Rebuild patches
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
17c35d6e SPIGOT-6637: Revert "#636: Add FurnaceStartSmeltEvent"
4b27230b SPIGOT-6623: Missing API reasons for entity freezing
e1528c85 #636: Add FurnaceStartSmeltEvent
CraftBukkit Changes:
a6292cc3 SPIGOT-6637: Revert "#874: Add FurnaceStartSmeltEvent"
f4066854 SPIGOT-6579: DragonFireBall movement with setDirection jumps around a lot
9add952b SPIGOT-6623: Missing API reasons for entity freezing
2ea359f1 #874: Add FurnaceStartSmeltEvent
be8d625e SPIGOT-5560, SPIGOT-6574, SPIGOT-6632: Remove no longer needed tile entity fix
Spigot Changes:
eac3cd96 Rebuild patches
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
b5d7883a SPIGOT-6634: Override needed method
99561c21 SPIGOT-6624: Explosions do not destroy blocks out of vanilla heights in custom dimensions
This patch changes sign command logic so that `run_command` click events are routed through the standard chat/command
logic used for inbound chat messages.
This fixes numerous issues related to sign click commands:
- Signs with a `run_command` value of "/<plugin command>" would fail and show the "Unknown command" warning. This
prevents usage of commands like `//wand` from WorldEdit in sign click events entirely and requires users to drop
the leading slash from other plugins' commands. This patch now executes the plugin commands as would be expected,
adding a leading slash if necessary.
- Signs with a `run_command` value that doesn't match an existing command could fail silently. This patch causes
these to *always* show "Unknown command" instead.
- Plugins listening to `PlayerCommandPreprocessEvent` would not be able to intercept any command executions from
sign click events. This patch allows plugins to intercept player commands when fired by a click event, in the same
manner as commands executed by the player typing or clicking on a chat message.
- Commands executed from signs would not be logged to the console. This patch fixes this.
This patch also prepends a leading slash if the `run_command` value lacks one, which matches vanilla behaviour (old
code would strip this slash away) while also ensuring `PlayerCommandPreprocessEvent#getMessage` remains consistent
with other command executions from chat (which always include the leading slash).
This looks like mojang introduced an NPE however it was previously being
supressed by the future used by the server, we'll just stick to the legacy
behavior of retainining the existing profile of earlier versions
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
214b9f14 SPIGOT-6605: Add method to access value of enforce-whitelist
CraftBukkit Changes:
b121d3b9 SPIGOT-6605: Add method to access value of enforce-whitelist
The new task fixJarForReobf was added after shadowJar, but since
reobfJar's input is changed in this patch, that new task needs to be
referenced instead of shadowJar.
having spoken to mojang about this the general issue is data which shouldn't
have been saved in the first place, so if we lose this data it's not really
an issue, bar being annoying spammy. if the spam gets on your nerves, shamefully,
all you can really do is forceUpgrade to get the conversions of the way.
Dropping as this breaks other aspects of the server and bar being spammy
seems to have no other real negative outcomes
Upstream forgot to update the check here which prevents explosions
occuring under 0 height, however, vanilla already checks that we
are in bounds of the world above this, so this call is entirely
redundant.
* Make gradle take build number from env vars
* Add git information to manifest and version command/log
* trim
* Fix tests by adding NotNull annotations
* rebase
* Apply suggestions from kashike
Co-authored-by: Riley Park <riley.park@meino.net>
* Not always show branch
* Why can't everything be NotNull by default?
* Rebase
Co-authored-by: Riley Park <riley.park@meino.net>
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
70d24eb8 SPIGOT-6587: Update documentation/error of drop chance API
CraftBukkit Changes:
470050ad SPIGOT-6587: Update documentation/error of drop chance API
1c39efa3 Fix Inventory#getViewers on the player inventory not returning the player first time their inventory is opened
d161627d Fix PrepareItemCraftEvent#isRepair
aa1fae73 SPIGOT-6586: EntityChangeBlockEvent for falling block does not cancel properly
8a04072e SPIGOT-6583: Throwing eggs doesn't make sounds
Spigot Changes:
f773da84 Remove redundant patch
cd367234 Rebuild patches
Mojang did NOT add dataconverters for world gen configurations
that they CHANGED. So, the codec fails to parse old data.
This fixes two instances:
- IntProvider is new and Mojang did not account for old data.
Thankfully, only ColumnPlace needed to be special cased.
- TreeConfiguration had changes. Thankfully, they were
only renames for one value and thankfully defaults could
be provided for two new values (WITHOUT changing behavior).
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
68d40318 SPIGOT-6580: Cancelling SlimeSplitEvent Causes Infinite Loop
78d93f77 SPIGOT-6576: BlockExpEvent does not show XP when breaking a furnace
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
2dbec584 SPIGOT-6570: Missing InventoryType: COMPOSTER
e9ce88b9 SPIGOT-6562: Add more specific sculk sensor event
CraftBukkit Changes:
9122f5a6 #869: Fix BossBar setColor and setStyle updates
96a15d7a Incrase outdated build delay
ded19075 SPIGOT-6570: Missing InventoryType: COMPOSTER
d7ef1e91 SPIGOT-6558: Attempt to improve SkullMeta
e7a63287 SPIGOT-6562: Add more specific sculk sensor event
Spigot Changes:
101ebb63 SPIGOT-6573: Berry Bushes deal damage when not moving
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
e9ce88b9 SPIGOT-6562: Add more specific sculk sensor event
CraftBukkit Changes:
d7ef1e91 SPIGOT-6558: Attempt to improve SkullMeta
e7a63287 SPIGOT-6562: Add more specific sculk sensor event
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
f992ce60 Fix duplicate datapack reload on /reload
Spigot Changes:
9472b09d Rebuild patches
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
ebb0e28d #631: Add Villager#shakeHead
751469c6 #629: Add LivingEntity#isClimbing
CraftBukkit Changes:
622cf611 SPIGOT-6555: Cannot access shield BlockStateMeta
8b2e78ec SPIGOT-6542: Fix counting players with fauxSleeping = true
f66c437a SPIGOT-6561: Add events for dripleaf tilting
6ed40004 SPIGOT-6560: Crash when falling stalactite hits player
72a2901b SPIGOT-6557: PlayerEditBookEvent#setNewBookMeta does not update meta
a07e783a #865: Implement Villager#shakeHead
3252ff18 #863: Add LivingEntity#isClimbing
77058c79 SPIGOT-6554: Worlds created with the bukkit ChunkGenerator cannot save