Commit Graph

255 Commits

Author SHA1 Message Date
Spottedleaf
d79708296e Update Paper 2024-06-19 14:42:39 -07:00
Spottedleaf
151264ebf9 Update Paper 2024-05-30 17:17:04 -07:00
Spottedleaf
509de1c265 Properly use WorldGenRegion structure manager for swamp hut cat generation
Fixes a crash when attempting to retrieve the chunk data,
as Folia does not support off-region sync chunk loads.

Fixes https://github.com/PaperMC/Folia/issues/221
2024-05-30 17:17:04 -07:00
Spottedleaf
087c6ae12a Update Paper 2024-05-30 17:17:04 -07:00
Spottedleaf
e11cf545b9 Update Paper 2024-05-30 17:17:04 -07:00
Spottedleaf
9a9dbd2188 Fix compile errors 2024-05-30 17:17:04 -07:00
Spottedleaf
7c75e53c65 Update to Paper 1.20.6 2024-05-30 17:17:02 -07:00
Spottedleaf
46d3ab50b4 Update to latest Paper 1.20.4 2024-05-09 16:36:04 -07:00
Spottedleaf
25ee657a82 Add missing synchronisation for map data
Fixes possible CME when accessing the map data storage
2024-04-11 17:07:12 -07:00
Spottedleaf
6b9a96f604 Update Paper 2024-04-11 17:03:29 -07:00
Spottedleaf
ef2c697189 Properly handle unticked hopper tick adjustment
For unticked hoppers, we should use MIN_VALUE as a marker
so that they compare equivalently regardless of whether they've
been through a region merge.
2024-03-28 18:43:02 -07:00
Spottedleaf
e50d09b67b Use redstone time in a few appropriate areas
1. Moving piston last tick
2. Living entity last damage stamp
3. Entity piston deltas

This should resolve primarily timing problems using pistons.
2024-03-28 18:38:09 -07:00
Spottedleaf
a9e9e5f7e0 Use ThreadLocal for SignItem#openSign
This fixes cross-region data access where there shouldn't be any
2024-03-28 18:38:09 -07:00
Spottedleaf
e73566fdc2 Use redstone game time for hopper tickedGameTime
This should fix timing inconsistencies for hoppers
2024-03-28 18:38:09 -07:00
Jason Penilla
7bc84f49be
Add missing remove event cause (fixes tests) 2024-03-27 12:17:09 -07:00
Spottedleaf
3a91a4a5cf Allow off-region access to entities not added to world
This should allow worldgen threads to interact with the entity.

Fixes https://github.com/PaperMC/Folia/issues/204
2024-03-24 14:14:51 -07:00
Spottedleaf
b843a3512d Fix incorrect max player slot check
Using the total number of users in the connection set
is not correct since those users may not be logged in
yet. Instead, track separately the number of users
who have passed the slot check.

Fixes https://github.com/PaperMC/Folia/issues/205
2024-03-24 14:01:03 -07:00
Spottedleaf
ad2ef004b9 Update Paper 2024-03-24 13:44:25 -07:00
Spottedleaf
035f8e33c5 Make RedStoneWireBlock.isSignalSource return true if off-region
This may be invoked by a worldgen thread, in which case the
region data would be null and cause a crash. Returning true
is the default state of shouldSignal, so this should maintain
expected behavior.
2024-03-24 13:10:56 -07:00
Spottedleaf
e97b1eee63 Move Connection tick to after world tick
The world tick will synchronise block data to clients. If
the connection tick is ran before, then the server will
send the block ack before the block updates - which causes
the client to think that any blocks it broke/placed
were rejected.

Fixes https://github.com/PaperMC/Folia/issues/194
2024-02-21 16:23:51 -08:00
Spottedleaf
7f0a317854 Update Paper 2024-02-20 18:42:54 -08:00
Spottedleaf
5652259e1a Fix entity tracker desync when new players are added to the tracker
The delta position packet instructs the client to update
the entity position by a position difference. However, this position
difference is relative to the last position in the entity tracker
state, not the last position which has been sent to the player. As
a result, if the last position the player has recorded is different
than the one stored in the entity tracker (which occurs when a new
player is added to an existing entity tracker state) then the sent
position difference will cause a position desync for the client.

We can resolve this problem by either tracking the last position
sent per-player, or by simply resetting the last sent position
in the entity tracker state every time a new player is added.
Resetting the last sent position every time a new player is
added to the tracker is just easier to do, so that is what
this patch does.

Fixes https://github.com/PaperMC/Folia/issues/197
2024-02-20 18:30:53 -08:00
Spottedleaf
0265fdd4f4 Make endermite spawn at original thrower position
This is how Vanilla does it, and we don't have any reason to change
this other than an oversight in copying the code.
2024-02-20 17:25:53 -08:00
Spottedleaf
e22501a8e3 Remove pending connections for login VERIFYING state
The login state PROTOCOL_SWITCHING is only set once the player
passes initial login checks during the VERIFYING state
(ban,whitelist,slots,login event), but we add to pending during
the VERIFYING state.

Fixes https://github.com/PaperMC/Folia/issues/201 https://github.com/PaperMC/Folia/issues/200
2024-02-20 16:26:42 -08:00
Spottedleaf
7a3dea9038 Add support for Eigen/Alternate current
The data both store are caches which are cleared after updates,
which means that there is no block/position data being tracked
across ticks. As long as each region has its own instance, there
should be no cross-region data access.

Fixes https://github.com/PaperMC/Folia/issues/202
2024-02-20 16:16:18 -08:00
Spottedleaf
d3d0df309c Update Paper 2024-02-13 16:20:10 -08:00
Spottedleaf
32ff12e4dc Update Paper
Also included is a fix to Connection#handleDisconnection
using the wrong login state for removing pending login
2024-02-05 11:41:39 -08:00
Spottedleaf
7bc26ecc74 Update Paper
Additionally, fix ActivationRange using global state to store
the AABBs it checks entities against. This fixes an issue where
entities would not be activated when they should be.
2024-01-20 20:33:21 -08:00
Spottedleaf
27561750dd Add rcon command source to dispatch check
I am surprised it does not implement ConsoleCommandSender.
2024-01-20 19:11:06 -08:00
Spottedleaf
be90fb8d36 Update Paper 2024-01-09 14:49:27 -08:00
Spottedleaf
16e8d3aea4 Check processed disconnect after invoking keepConnectionAlive()
Since we move this up, we need to check it to prevent ticking
a possibly removed player
2024-01-09 14:37:27 -08:00
Spottedleaf
e89a107ef0 Guard against double onDisconnect calls in common packet listener
The non-game type implementation will not guard against double calls,
which means that any invocation of disconnect() would immediately
call onDisconnect and then later the connection handler would
also call onDisconnect.

Fixes https://github.com/PaperMC/Folia/pull/181
2024-01-09 14:22:00 -08:00
Spottedleaf
6928284a56 Update Paper and add configurable region shift
The region shift is configurable under `grid-exponent`, which
allows setting the region shift to any value in [0, 31]. Note
that values above 6 affect the lock shift, as the lock shift
currently is computed as max(ticket shift = 6, region shift).
The shift is left configurable for now as the lower default
shift of 2 may have negative performance impacts.

The default region shift has been adjusted to 2 from 4, and
the empty chunk buffer has been reduced to 8 from 16. These
changes reduce, but do not eliminate, player spread
requirements. The previous block range was around ~1500 blocks
at VD = 10, but is now closer to ~900 blocks at VD = 10. This
roughly reduces the area that each player uses in the regioniser
by 2.5x.
2023-12-30 17:20:19 -08:00
Spottedleaf
9a389a1a5e Update Paper 2023-12-23 06:03:14 -08:00
Spottedleaf
cd713b8ea2 Fix compile/run for 1.20.4
Currently, /tick is disabled but is planned to be re-added.
It's unlikely that support for sprinting can be implemented
precisely due to the fact that Folia ticks many regions
independently. However, a best-effort approach will be used.
2023-12-18 15:06:11 -08:00
Spottedleaf
de6a87e338 Apply patches for 1.20.4
- Compile needs to be checked.
- Behaviors around the new tick manager need to be designed
  and implemented.

Chk update.txt for anything specific.
2023-12-16 15:32:48 -08:00
Spottedleaf
1e5e2154c9 Implement command execution support for RCON
Just need to change the executeBlocking() call to use the
global region to execute the command instead.
2023-11-24 19:43:47 -08:00
Jason Penilla
c1e3c3c532 Bump paper-mojangapi and Gradle 2023-11-24 17:23:52 -08:00
Jason Penilla
3843340cba Fix command sender check 2023-11-21 13:27:29 -08:00
Siroshun09
d58fab2cce Fix animal spawning issue 2023-11-21 13:12:55 -08:00
Spottedleaf
7aacf902b0 Update Paper 2023-11-16 14:33:41 -08:00
Spottedleaf
757cb09c41 Update Paper 2023-10-16 19:08:01 -07:00
Spottedleaf
9190eb011c Update paper 2023-10-15 13:03:17 -07:00
Spottedleaf
84aecdc64a Update paper 2023-10-09 10:13:26 -07:00
Spottedleaf
905cf0b6be Fix crash when generating swamp structure
Need to implement structureManager on CB's DelegatedGeneratorAccess,
as that is now used during population.
2023-10-06 19:33:13 -07:00
Spottedleaf
8cde60d1f9 Use tracker field instead of entity map lookup in CraftEntity#getTrackedBy
Fixes compilation
2023-10-06 18:30:21 -07:00
Spottedleaf
dc3fcef3bb Use postprocess annotation for config 2023-10-06 18:26:56 -07:00
Spottedleaf
6c59a955b0 Re-add RandomCommand
Now that RandomSequences is thread-safe, do not need to disable
this command
2023-10-06 17:53:48 -07:00
Spottedleaf
726cdc39a5 Update paper 2023-10-06 17:50:00 -07:00
Spottedleaf
e5b552fb0c Properly synchronise RandomSequences access
The underlying map should be CHM, and the access to the
underlying random should be synchronised as well.
2023-10-06 17:34:34 -07:00