Commit Graph

1348 Commits

Author SHA1 Message Date
Jason 0249750b8f
Fix EntityArgument suggestion permissions to align with EntitySelector#checkPermissions (#8511) 2022-10-26 18:31:55 -07:00
Jake Potrebic 32d95e9bab
Track projectile source for fireworks from dispensers (#8044) 2022-10-26 17:44:28 -07:00
Jake Potrebic 954e6f00f3
Fix a bunch more forceDrops for dropping items (#8095) 2022-10-26 17:32:03 -07:00
Noah van der Aa 2432233d24
Add allow server listing & text filtering client options (#7595) 2022-10-26 18:09:03 -05:00
Lulu13022002 36869ccd90
Fix new block data in EntityChangeBlockEvent for silverfish when mobGriefing isn't enabled (#8099) 2022-10-26 17:05:15 -05:00
Spottedleaf 25cd3eee99 Add dirty flag to chunk tick lists
For whatever reason, vanilla does not mark the chunk as
dirty when changing its tick lists.

We also have it return dirty if the time since the last
save has changed, since it would affect the tick offsets
in the ticklist.
2022-10-24 20:51:48 -07:00
Spottedleaf fc5ae5be82 Fix incorrect handling of mustNotSave
CB used the dirty flag to construct the chunk unload event,
but then sets mustNotSave to the inverted value of the event
after calling the event without considering that the chunk may
actually be brought up to loaded status again later. Then, CB
overrides the isUnsaved method of LevelChunk to additionally
use mustNotSave.

Thus, if the chunk is not marked dirty when unloading, the
mustNotSave value will be set to true. Then, once the chunk
is reloaded and edited the dirty flag will be set. However,
when unloading the chunk finally, the isUnsaved method
will return false due to mustNotSave being true. Thus, the
chunk will never be saved.

To fix these issues, no longer make mustNotSave override
isUnsaved and always set the save flag for the chunk unload
event.

This issue started popping up recently due to the recent
change to mark chunks as not dirty after saving them, which
increased the chance of the save issue occurring in the first
place.
2022-10-24 19:34:03 -07:00
Jason 519cb4b214
Move classes added to net.minecraft.server to paper packages (#8500) 2022-10-24 12:43:46 -07:00
evan 1c1aeb20e2
Only limit global sounds to same world if limiting radius (#8499) 2022-10-23 20:52:40 +02:00
Jake Potrebic 44ce9b3e9c
Updated Upstream (Bukkit/Spigot) (#8445) 2022-10-23 10:41:34 -07:00
Spottedleaf b8131a09b2 Mark chunks as saved after saving them
Prevents re-saving them again later.
2022-10-23 09:09:18 -07:00
Owen 05bd9d67b7
Ignore impossible spawn tick (#8493)
Co-authored-by: dannyball710 <dannyball710@gmail.com>
2022-10-22 23:45:07 -05:00
Owen 0b8f40cf6a
Don't fire EntityToggleSitEvent on deserialization & reorder some api patches (#8495) 2022-10-22 21:55:28 -05:00
Owen 6665076342
Add Moving Piston API (#7019) 2022-10-22 19:37:37 -05:00
uku 4e67c73b03
Add config setting for grindstone overstacking (#8156) 2022-10-22 18:25:17 -05:00
vytskalt 58483c1e18
Add fire-tick-delay option (#8037) 2022-10-22 17:57:09 -05:00
IEatBeans 6ea5aa37bd
Added EntityToggleSitEvent (#7579)
* Added EntityToggleSitEvent Patches

* Updated event phrasing, fixed Boolean not being primitive, pandas now fire event, and event is defined and called in 1 line

* Updated event phrasing, fixed Boolean not being primitive, pandas now fire event, and event is defined and called in 1 line

* Added EntityToggleSitEvent Patches

* Added EntityToggleSitEvent Patches

* Added EntityToggleSitEvent Patches
2022-10-22 17:20:52 -05:00
Lukas Alt 5cdb5f9585
Optimized dirt and snow spreading (#5124)
* Optimized dirt and snow spreading

* Add optimization to bukkit event call

* Clarify var names

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2022-10-22 13:13:59 -05:00
Lukas Alt 60da35e359
fixed entity vehicle collision event not called (#5053) 2022-10-22 12:09:45 -05:00
Noah van der Aa 7187cab3b6
Detect headless JREs (#8491)
Crashes caused by the missing AWT dependency come up in the support channels fairly often.
This patch detects the missing dependency and stops the server with a clear error message,
containing a link to instructions on how to install a non-headless JRE.
2022-10-22 11:57:21 -05:00
Noah van der Aa a163a96a8d
Load Allay duplication cooldown as a long (#8410)
It is saved as a long, and the API exposes a long, so loading it as an int may cause issues like overflows.
2022-10-22 16:16:24 +02:00
Jason 3dcfec4499
Add stacktrace deobfuscation in more places (#8484) 2022-10-18 19:21:07 -07:00
Spottedleaf f7da209586 Fix inconsistent isChunkLoaded calls
When we update the chunk state to border, it should be
the case that isChunkLoaded returns true and that
getChunkIfLoadedImmediately returns a non-null value.
Now add the chunk to the loaded map before making any
callbacks after updating to border state.
2022-10-18 08:11:23 -07:00
Nassim Jahnke e1d4b26a62
Fix another case of missing chat headers 2022-10-18 10:20:35 +02:00
Melncat ed2c88ba89
Add LivingEntity knockback API (#8479) 2022-10-18 09:33:58 +02:00
Jakub Žáček ec00f991a4
Fix package for PlayerInventorySlotChangeEvent (#8475)
Co-authored-by: Jakub Zacek <dawon@dawon.eu>
2022-10-16 08:49:47 +01:00
19MisterX98 603df98897
FIx bedrock patterns (#8474) 2022-10-16 00:34:10 +02:00
SoSeDiK eb68bd49a2
Allow changing bed's 'occupied' property (#8458) 2022-10-14 10:37:01 +02:00
Lulu13022002 2094011485
Update settings directory path in exceptions (#7968) 2022-10-13 13:38:06 +02:00
SoSeDiK 514a60647d
Elder Guardian appearance API (#8455) 2022-10-13 12:26:51 +02:00
Shane Freeder 7fe34e9508
Make CraftMinecartTNT public
adding the getHandle method causes some issues with things like ProtocolLib
due to the expectation that all classes which provide a getHandle method
are public.
2022-10-12 16:10:52 +01:00
Jake Potrebic b9cf1ac580
Fix a classloading issue in tests (#8459) 2022-10-11 20:05:28 -07:00
Jason Penilla f7c8d79667 Fix stacktrace in server tests 2022-10-11 16:52:49 -07:00
Jakub Žáček de2d2d4d94
Add PlayerInventorySlotChangeEvent (#7321) 2022-10-11 22:49:10 +01:00
Owen 6b26cfcd31
Add missing Entity + Projectile API (#7632) 2022-10-11 22:04:26 +01:00
SoSeDiK b097a241c0
Expose isUnderWater to Entity (#8454) 2022-10-11 14:43:10 +02:00
Jake Potrebic 57555b8c6a
Add missing structure set seed configs (#8030) 2022-10-09 22:19:35 +02:00
Jake Potrebic c389b1c408
Fix configs that relied on outdated min/max y levels (#6986) 2022-10-09 08:52:09 +02:00
Warrior 60c973e461
Exempt players in creative/spectator from nether ceiling damage (#8427) 2022-10-07 20:43:26 +02:00
Jake Potrebic bcb4220b5f
Correctly handle interactions with items on cooldown (#8008) 2022-10-07 17:22:45 +02:00
Jake Potrebic ff67f1fa18
EntityPickupItemEvent fixes (#8096) 2022-10-04 21:38:39 -07:00
Jake Potrebic 9d63b070a1
Fix custom piglin interest items (#8097) 2022-10-04 20:28:46 -07:00
Nassim Jahnke ad3d35751a
Remove unnecessary onTrackingStart during nav warning
Closes #8396
2022-10-03 20:50:53 +02:00
Gero 15e1748fd5
Avoid resizing of ArrayList in ChunkMap#getPlayers (#8416) 2022-10-03 19:22:01 +02:00
Nassim Jahnke 011caa4d8e
[ci skip] Minor patch cleanup 2022-10-03 19:07:03 +02:00
Friwi 616db7118d
Fix nothing mlg (#8432) 2022-10-03 18:44:19 +02:00
Nassim Jahnke 928bcc8d3a
Updated Upstream (Bukkit/CraftBukkit) (#8430)
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:
09943450 Update SnakeYAML version
5515734f SPIGOT-7162: Incorrect description for Entity#getVehicle javadoc
6f82b381 PR-788: Add getHand() to all relevant events

CraftBukkit Changes:
aaf484f6f SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe
5329dd6fd PR-1107: Add getHand() to all relevant events
93061706e SPIGOT-7045: Ocelots never spawn with babies with spawn reason OCELOT_BABY
2022-10-02 09:56:36 +02:00
TetraTheta ec3cfa9b7f
Only create paper.yml-README.txt on config conversion (#8334) 2022-10-02 09:29:09 +02:00
Jake Potrebic ec76e36a4e
Fix a handful of vanilla bugs (#8187) 2022-10-01 19:39:42 +02:00
Melncat 6d1409316e
Add getDrops to BlockState and isPreferredTool to BlockData (#8284) 2022-10-01 12:30:00 +02:00
Remynfv 2534e5cbbf
Fix other jigsaw related disconnect bug (#8414) 2022-10-01 10:08:07 +02:00
Nassim Jahnke f5fa69173c
Don't print full packages in new chunk system classes
Closes #8391, #8412
2022-09-30 23:19:51 +02:00
Pasqual Koschmieder 14c32bc43d
Fix wrong yaw and pitch of CommandSourceStack#getBukkitLocation (#8411) 2022-09-30 21:03:42 +02:00
Remynfv c6d737528d
use BlockFormEvent for mud converting into clay (#8398)
Co-authored-by: Legitimoose <legitimoose@gmail.com>
2022-09-30 20:33:31 +10:00
Ilari Suhonen 8d69cfc6ce Reduce allocation rate for checkBlock
Use ObjectOpenHashSet instead of HashSet
Remove unnecessary chunkToSave modification
2022-09-29 09:04:52 -07:00
Spottedleaf 7d3a882670 Do not log throwable for duplicate entity adds 2022-09-29 08:55:47 -07:00
Bjarne Koll 8a7dd61348
Mark parsed PoiChunks with data as not loaded (#8405)
Previously, PoiChunk#empty would create a new empty poi chunk with
loaded already set to true, as no data was contained in the chunk.
This allowed the poi chunk to skip expensive trips to the main thread.

However, PoiChunk#parse used #empty to create the initial PoiChunk
instance that is then filled with data.
This leads to PoiChunks returned from #parse to already be marked as
loaded, preventing the then needed trip to the tick thread to update
things like the village distance tracker.

To fix this, this commit now marks the PoiChunks loaded state as false
if the parse logic actually read and parsed any data.
This allows the PoiChunk#load method to properly run its callbacks when
called for the first time.
2022-09-29 08:54:47 -07:00
F1rsi 017af785ff
[ci skip] Added the missing "d" character (#8267) 2022-09-29 15:36:01 +01:00
Remynfv 21661a7557
Fix jigsaw block kicking user (#8404) 2022-09-29 12:37:56 +01:00
Jason 79f2aa3eed
Update Velocity natives (#8387) 2022-09-29 12:18:20 +01:00
Shane Freeder bd496d0e0d
[ci skip] shuffle patches and rebuild 2022-09-28 04:27:26 +01:00
Nassim Jahnke 1bbd273bbd
Fix user auth thread pool queue 2022-09-27 18:00:46 +02:00
Jake Potrebic f7d16f656a
Fixes a couple issues with entity spawn reasons (#8390) 2022-09-27 01:24:56 +01:00
Spottedleaf 01a13871de
Rewrite chunk system (#8177)
Patch documentation to come

Issues with the old system that are fixed now:
- World generation does not scale with cpu cores effectively.
- Relies on the main thread for scheduling and maintaining chunk state, dropping chunk load/generate rates at lower tps.
- Unreliable prioritisation of chunk gen/load calls that block the main thread.
- Shutdown logic is utterly unreliable, as it has to wait for all chunks to unload - is it guaranteed that the chunk system is in a state on shutdown that it can reliably do this? Watchdog shutdown also typically failed due to thread checks, which is now resolved.
- Saving of data is not unified (i.e can save chunk data without saving entity data, poses problems for desync if shutdown is really abnormal.
- Entities are not loaded with chunks. This caused quite a bit of headache for Chunk#getEntities API, but now the new chunk system loads entities with chunks so that they are ready whenever the chunk loads in. Effectively brings the behavior back to 1.16 era, but still storing entities in their own separate regionfiles.

The above list is not complete. The patch documentation will complete it.

New chunk system hard relies on starlight and dataconverter, and most importantly the new concurrent utilities in ConcurrentUtil.

Some of the old async chunk i/o interface (i.e the old file io thread reroutes _some_ calls to the new file io thread) is kept for plugin compat reasons. It will be removed in the next major version of minecraft.

The old legacy chunk system patches have been moved to the removed folder in case we need them again.
2022-09-26 01:02:51 -07:00
Owen b4c025b92c
Fix player desync on dimension change (#8253) 2022-09-24 06:45:13 +01:00
Lulu13022002 62680d5f83
Avoid item meta usage for itemstack enchantment getter (#8373) 2022-09-24 06:19:51 +01:00
willkroboth 4d52f1d247
Add method isTickingWorlds to Bukkit (#8316)
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>

Also, restores un/loading worlds mid tick. This will not be officially supported API contract that such a routine is safe, and these restrictions may be restored in the future.
2022-09-24 06:19:05 +01:00
Shane Freeder 6736f390a2
Fix mangled patch 2022-09-24 05:48:46 +01:00
willkroboth d3326235f0
Avoid potential place where the world map could be modified after its iterator is created (#8315) 2022-09-24 05:33:20 +01:00
Shane Freeder 3996e6ef29
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
c7c11188 SPIGOT-2620: Add Player#sendBlockChanges()
f63d2b44 Improve annotation test on parameters
3372e7b4 SPIGOT-1244, SPIGOT-6860, SPIGOT-6874: Various Javadoc and formatting fixes
a1e8a9ab PR-793: Ignore .checkstyle file generated by Eclipse IDE

CraftBukkit Changes:
c2c39089e SPIGOT-2620: Add Player#sendBlockChanges()
8209158db PR-1113: Ignore .checkstyle file generated by Eclipse IDE

Spigot Changes:
4aa5ead2 Rebuild patches
2022-09-24 02:38:12 +01:00
Jake Potrebic f528f53e81
Correct javadocs on PlayerArmorStandManipulateEvent (#7719) 2022-09-23 06:55:02 +01:00
Lulu13022002 ec0c550482
Call BlockPhysicsEvent more often (#8264) 2022-09-23 06:35:15 +01:00
Lulu13022002 8681503d10
Call EntityChangeBlockEvent for frogs egg (#8136) 2022-09-23 06:32:32 +01:00
Shane Freeder 980c1d1f90
Updated Upstream (Bukkit/CraftBukkit) (#8378) 2022-09-23 06:08:43 +01:00
Jake Potrebic 9e614e6f9a
Fix ground pathfinding (#7683) 2022-09-20 14:06:11 -07:00
ChristopheG 8db45c4312
Copper clear on lightning strike calls EntityChangeBlockEvent (#8126) 2022-09-20 03:35:38 +01:00
Owen ad3dffe715
Respect preventMovingIntoUnloadedChunks for optimized collision checking (#8259) 2022-09-20 03:02:52 +01:00
tahmid-23 f7e68091a0
Fix Pathfinding After World Has Changed (#8068) 2022-09-20 02:39:46 +01:00
Shane Freeder dbc2d60ce0
Make WorldCreator#keepSpawnLoaded return the WorldCreator (Fixes #8321) (#8371)
* Make WorldCreator#keepSpawnLoaded return the WorldCreator (Fixes #8321)

Thought that I fixed this before push/merge, apparently not, hence, fix
the return type and add mitigation for this.

* Fix patch/build

* Rebuild patches
2022-09-20 01:28:22 +01:00
Shane Freeder 470c6388d2
Configurable chat thread limit (#7878) 2022-09-20 01:16:23 +01:00
Melncat ea777c345b
Add a consumer parameter to ProjectileSource#launchProjectile (#8374)
Co-authored-by: MelnCat <melncatuwu@gmail.com>
2022-09-20 01:03:59 +01:00
Nex 63cb7472ac
Added byte array serialization/deserialization for PersistentDataContainers (#7505) 2022-09-18 05:06:53 +01:00
Lulu13022002 dbda887457
Missing some effect cause (#8307) 2022-09-18 04:46:20 +01:00
Lulu13022002 34777cdcbe
Missing eating regain reason (#8244) 2022-09-18 04:24:28 +01:00
Jake Potrebic b826065a4b
fire EntityChangeBlockEvent in more places (#6371)
* fire EntityChangeBlockEvent in more places

* Rebuild patches

Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2022-09-18 04:03:54 +01:00
elmital ef670ebafb
EndDragonFight killed statuses should be false for newly created worlds (#8354) 2022-09-18 02:44:06 +01:00
Peter Crawley 05f6a5c005
Limit size of Authenticator Cache Thread Pool (#8360) 2022-09-17 22:58:51 +01:00
Fruxz f5f84ff476
Add custom destroyerIdentity parameter to the sendBlockBreak function (#5840) 2022-09-17 22:27:46 +01:00
Bjarne Koll 751d092af3
Properly close section storage managed files (#8364) 2022-09-17 19:50:01 +01:00
Shane Freeder 36f0c1b3cc
Rebuild patches 2022-09-17 04:35:39 +01:00
Jaren 267dd180b6
Stop large look changes from crashing the server (#8326) 2022-09-17 04:30:00 +01:00
karthanistyr 178f035aa7
Restore no-crash behaviour when read-only config file(s) (#8318) 2022-09-17 04:22:17 +01:00
Nassim Jahnke ef0e5a642d
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
48c0c547 PR-786: Add methods to get sounds from entities

CraftBukkit Changes:
5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event
4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation
4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
e5d6a9bbf PR-1100: Add methods to get sounds from entities
b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta

Spigot Changes:
4c157bb4 Rebuild patches
2022-09-12 13:31:45 +02:00
Jake Potrebic 51183af967
Fix console completer/highlighter having invalid source stack (#8346) 2022-09-09 14:25:54 -07:00
Jake Potrebic e51401e764
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8347) 2022-09-09 11:54:00 -07:00
okx-code 36a5f150c5
Allow preventing BlockDestroyEvent from dropping items (#8349) 2022-09-08 17:13:50 +02:00
Spottedleaf 09904fd780 Re-add legacy getChunkAtAsynchronously to ChunkProviderServer
Apparently some plugins use it
2022-09-02 04:42:05 -07:00
Spottedleaf e8c2c3bfda Fix World#refreshChunk not working for chunks in no-tick range
The chunk would not be marked as ticking in this case, so
retrieving the ticking chunk would not work.
2022-09-01 15:39:24 -07:00
Spottedleaf 046466f3ba
Re-arrange most chunk system patches to front (#8338)
* Re-arrange most chunk system patches to front

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-09-01 09:51:59 -07:00
Spottedleaf eff22eb054 Ensure players are removed from pendingLogin
Looks like they would not have been removed if they disconnected
during the chunk load, preventing the world from being unloaded.
2022-08-29 06:21:45 -07:00