Commit Graph

4891 Commits

Author SHA1 Message Date
mworzala
452943df23
chore: reapply #2027, throw if adding viewer before entity is active 2024-03-29 12:43:25 -04:00
mworzala
5b027599c5
fix: missing import in revert commit (somehow) 2024-03-29 12:07:21 -04:00
mworzala
ba1aaa7823
Revert "fix: send entity metadata immediately (#2027)"
This reverts commit e5cb2f7a1d.
2024-03-29 11:37:29 -04:00
DeidaraMC
832f0e7f5a
feat: proper passenger position handling for most entities, fix passengers not always being applied to the client, don't sync passengers (#2060)
* feat: proper passenger position handling for most entities, fix passengers not being applied properly on the client sometimes

* chore: ditch the complex passenger solution as 1.20.5 makes this much simpler

* chore: change EntityViewer to check for a vehicle rather than isViewer, add a test case for this bug

* fix: test only worked in isolation

* chore: revert additional pos allocation

* chore: this instead of vehicle
2024-03-29 15:11:16 +00:00
DeidaraMC
dc17d171ce
feat: vanilla style Instance#setWeather method overload, weather api improvements (#2064)
* feat: weather update

* chore: Weather#createIsRainingPacket use isRaining
2024-03-29 10:12:45 -04:00
DeidaraMC
f09d3db999
fix: entity onGround applies correctly (#2059) 2024-03-28 08:22:21 +00:00
GreatWyrm
f95d73eca8
Name magic values, respect client view distance setting (#2051)
* Name some magic values, replace getChunkViewDistance with ServerFlag.CHUNK_VIEW_DISTANCE, and respect client view distance settings (by using effective view distance when sending chunks)

* Attempt to fix test

* Preload chunks in test

* Fix OOM error for tests

* Rename constants and skin parts method

* Rename method
2024-03-27 22:08:36 -04:00
DeidaraMC
204b447cdb
feat: use ticks for potion duration instead of system time (#2050)
* feat: use ticks for potion duration instead of system time

* chore: remove redudant getter
2024-03-28 01:48:58 +00:00
DeidaraMC
59ea880d26
feat: added player#teleportWithFlags for relative teleportation (#2029)
* feat: added player#teleportWithFlags for relative teleportation

* requested changes and improvements

* add the new teleport method override player

* chore: cleanup

* chore: change relative flags from enums to constants

---------

Co-authored-by: DeidaraMC <DeidaraMC>
2024-03-28 01:45:55 +00:00
DeidaraMC
621f38c6a3
feat: justice for z (#2056) 2024-03-27 15:40:10 -04:00
DeidaraMC
f034296f28
feat: add aerodynamics record and the capability to set custom horizontal air resistance (#2053)
* feat: add aerodynamics record and the ability to set horizontal drag

* feat: entity physics simulation overhaul

* fix: made physics utils private, renamed to match other utils

* chore: separate concept of chunks and tps from PhysicsUtils, remove bad PhysicsResult constants

* chore: remove synchronization from PhysicsUtils, SYNCHRONIZE_ONLY_ENTITIES collection > set

* chore: remove extra vec allocations

* chore: improved flyingVelocity test

* chore: add all entities with client side prediction to SYNCRHONIZE_ONLY_ENTITIES, refactor velocity

---------

Co-authored-by: iam <iam4722202468@users.noreply.github.com>
2024-03-27 19:21:07 +00:00
DeidaraMC
d04e9e3e71
feat: improve server ticking accuracy, transition to Thread#sleep and… (#2054)
* feat: improve server ticking accuracy, transition to Thread#sleep and compensate for ticks that take too long

* feat: use nano time instead of milliseconds and add compensation for the rare case of the server oversleeping
2024-03-27 03:14:40 -04:00
DeidaraMC
ceeab08a2a
chore: minor entity class warning cleanup (#2049) 2024-03-25 23:33:24 -04:00
DeidaraMC
115f9c1355
chore: expose previous position with a getter (#2046) 2024-03-25 19:52:26 -04:00
DeidaraMC
c27ab180a5
fix: don't send EntityHeadLook/Rotation packets to self (#2048) 2024-03-25 23:47:56 +00:00
DeidaraMC
4f1017d398
feat: configurable entity synchronization interval (#2047)
* feat: entity synchronization overhaul

* chore: add getter for sync interval

---------

Co-authored-by: mworzala <mattheworzala@gmail.com>
2024-03-25 23:44:27 +00:00
mworzala
4d2e78e7cf
fix: do not add a 1,1,1->0,0,0 collision shape if no boundingbox is present 2024-03-25 19:02:12 -04:00
GreatWyrm
fa0cd40ac1
Add bounds check to CreativeInventoryListener (#2042)
* Add bounds check to CreativeInventoryListener

* Add test and change bounds check to exclude crafting output slot
2024-03-25 05:47:12 +00:00
mworzala
ee17c032e7
fix: use collision shape for Shape#isFaceFull instead of occlusion shape 2024-03-24 21:50:54 -04:00
iam
6e179dbd8a
Fix Lighting Invalidation (#2041)
-  Fix invalid lighting being sent to clients
-  Add cherry leaves to occludes
-  Fix lighting being generated when using loaded lighting
-  Send lighting to clients on block changes
-  Cleanup unused methods
-  Add sky lighting test for short grass
2024-03-24 16:23:26 -04:00
Samuel
17fd82a5c1
Scheduler try catch (#2037)
* try catch in SchedulerImpl to individually fail tasks

* Use exception manager

* chore: add a test

---------

Co-authored-by: mworzala <mattheworzala@gmail.com>
2024-03-21 21:42:24 +00:00
Samuel
1058d88552
Scheduler extends Executor for convenience (#2036)
* Scheduler extends Executor for convenience

* chore: doc on Scheduler#execute()

---------

Co-authored-by: mworzala <mattheworzala@gmail.com>
2024-03-21 21:05:12 +00:00
DeidaraMC
a31d239b51
feat: add leash holding support to the entity api (#2026)
Co-authored-by: DeidaraMC <DeidaraMC>
2024-03-19 16:48:52 +00:00
DeidaraMC
32f96683ee
feat: add weather to instances (#2032)
* feat: instance weather system

* chore: weather documentation

* chore: remove unused weather fields

* feat: linear weather interpolation

* chore: register weather command

---------

Co-authored-by: DeidaraMC <DeidaraMC>
Co-authored-by: mworzala <mattheworzala@gmail.com>
2024-03-19 16:44:51 +00:00
TheMode
9cfffc6ee4
Static packet ids (#2034) 2024-03-19 17:42:06 +01:00
DeidaraMC
705ec5cc07
fix: send EntityHeadLookPacket on teleport (#2031)
* fix: send EntityHeadLookPacket on teleport

* fix: new teleport test integration

---------

Co-authored-by: DeidaraMC <DeidaraMC>
2024-03-18 03:41:06 +00:00
DeidaraMC
e5cb2f7a1d
fix: send entity metadata immediately (#2027)
Co-authored-by: DeidaraMC <DeidaraMC>
2024-03-18 03:36:20 +00:00
Zax71
40ebd2b67f
Add getUUID() and getUsername() to MojangUtils (#2024)
* Add MojangUtils#getUUID() and MojangUtils#getUsername()

* Remove invalid UUID test as Java's UUID will not allow an invalid UUID

* Add `@Blocking` and some JavaDoc comments

* Override `MojangUtils#fromUuid(String)` with `MojangUtils#fromUuid(UUID)` and add a test

* Switch to IOException over custom ones
2024-03-18 03:25:35 +00:00
themode
6758737b80 Little nitpicks 2024-03-18 00:02:54 +01:00
mworzala
4b31570c9d
feat: redstone conductor & signal source 2024-03-14 22:04:12 -04:00
GreatWyrm
7e59603d5f
Add entity type to Material registry (for spawn eggs) (#2020)
* Add entity type to Material registry (for spawn eggs)

* Rename to spawn entity type and add javadoc
2024-03-14 00:50:54 -04:00
mworzala
dcbdad9a1b
fix: painting variant read entry, forgot to follow my own comment 2024-03-12 20:05:41 -04:00
mworzala
58fd95879a
fix: correct painting metadata 2024-03-12 15:22:15 -04:00
iam4722202468
7aaa85cd47 change maxspeed to float 2024-03-09 23:44:51 -05:00
Steank
2ff143a61d
Fix potential threading bug in Acquirable (#2013)
* Fix potential lock acquisition in Acquirable API

 * Calls to Acquirable#sync(Consumer) will now always unlock, even if the consumer throws an unchecked exception

* fix: formatting

---------

Co-authored-by: Matt Worzala <35708499+mworzala@users.noreply.github.com>
2024-03-05 19:27:56 +00:00
iam4722202468
a47dcb09ff Add intersect entity to shape 2024-03-02 16:09:42 -05:00
Matt Worzala
845113b6a9
Recipe manager cleanup (#2010)
* Improved code readability.
This code improves code flow, simplicity and reduces complexity

* chore: interface to final class, rename conversion functions to their recipe type for clarity, use cached packet

---------

Co-authored-by: Phillipp Glanz <6745190+TheMeinerLP@users.noreply.github.com>
2024-02-29 14:58:12 +00:00
iam
d595ce3468
ParticlePacket constructor should use floats (#2009) 2024-02-29 07:18:42 +00:00
iam
5162a00b1e
Add particle data types (#2004)
* Add particle data types

* misc

* misc

* remove spaces

* defaults, tests, change what mattw said to

* RGBLike

* RGBLike

* RGBLike

* add back changes

* tests

* refactor

* annotations

* more fixes

* another test

* more tests + fix

* logging + checks consistency

* review changes

* review changes
2024-02-28 21:54:24 +00:00
tahmid-23
aad7bdab0f
refresh pose on gamemode change (#1888) 2024-02-28 17:54:12 +00:00
Matt Worzala
2947279898
Remove FakePlayer (#2006)
* feat: remove FakePlayer

* fix: oops, demo server exists
2024-02-27 13:37:42 +00:00
GoldenStack
009ba773ed
Fix incorrect slot updating (#2007)
* Fix slot sending

* Test fixed slot sending

* Also send offhand slots
2024-02-27 08:35:30 -05:00
mworzala
a5e0641444
fix: use formatter args in Check calls 2024-02-24 19:43:30 -05:00
mworzala
fb7e4b10e0
fix: require size when reading collection to prevent oom. Do not allow string longer than remaining bytes 2024-02-24 17:46:56 -05:00
cosrnic
d86b890cc6 Change comments for expand, contract and withOffset 2024-02-24 12:10:49 -05:00
cosrnic
0555405064 Fix spelling mistake 2024-02-24 12:10:49 -05:00
cosrnic
0b66dd61db Change offset to withOffset 2024-02-24 12:10:49 -05:00
cosrnic
49a4226ebb Allow offsetting the BoundingBox 2024-02-24 12:10:49 -05:00
mworzala
b58db7d5b0
fix: drain worker queue during worker shutdown 2024-02-21 13:39:25 -05:00
mworzala
c9a4b4b9c1
fix: do not check instance if player was kicked during config state 2024-02-17 22:01:56 -05:00