Commit Graph

5145 Commits

Author SHA1 Message Date
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
Phillipp Glanz 7ec3e3021e
Improved socket handling for the server (#1998)
* Improves socket handling from the server.
A logging is added which catches errors as soon as the server socket connection cannot be closed. In addition, the program terminates itself immediately to avoid further errors.

* Worker stop has been transferred.
The worker stop was implemented in a close method in the worker class and is now called from the server. The access modifier was adapted for this

* Adding a wakup call before the server closes its socket
2024-02-17 19:43:05 -05:00
Phillipp Glanz ffb33e608d
Fixes minor bug in the biome implementation. (#1999)
The registry method was never implemented correctly and always returns a null reference. This commit solves the problem and will return an object in some cases in the future.
2024-02-17 09:24:08 -05:00
Spanner fe46ed4ac2
Prioritise errors by chain length, build subcommands first (fix #1934) (#1935)
* Fix empty command chain causing NullPointerException

* Add test for empty command input

* Add test for #1934; subcommand priority issue

* Fix ConversionNode; process subcommands first

* Fix command error priority, add test for literal suggestions

* Test for subcommand priority in graph tests

(cherry picked from commit 2cdb3911b0)
2024-02-12 18:28:15 -05:00
iam 7320437640
Optionally load vanilla biomes (#1988)
* Add biomes from vanilla

* cleanup

* rework biomes

* nullability

* getByName string

* expose vanilla biomes

* not null

* before rename

* rename

* nbt cache

* fix

* fix

* fix

* final on vanilla biome
2024-02-12 15:25:46 -05:00
iam4722202468 6d175c4ff9 expose internal and external lighting 2024-02-10 18:06:31 -05:00
iam4722202468 4fea03fe32 Never relight non-lighting chunk 2024-02-10 18:06:31 -05:00
iam4722202468 4b9e260f23 Don't relight dynamic chunk 2024-02-10 18:06:31 -05:00
iam4722202468 3ea09e243f Add another test 2024-02-10 18:06:31 -05:00
iam4722202468 aca67fc5d8 Don't relight entire chunk 2024-02-10 18:06:31 -05:00
iam4722202468 225a834ef8 Add api to get lighting of instance 2024-02-10 18:06:31 -05:00
mworzala 77df1bdfd2
fix: correctly refresh client state on death 2024-02-10 17:42:02 -05:00
iam4722202468 9ed8605edc Documentation 2024-02-10 14:23:49 -05:00
Steank d03466e5a3
Fix for #1883 (#1884)
* fix NPE when stopping server after MinecraftServer#init() but before starting

* add unit test

* fix for #1712

* fix hashCode contract violation between NamespaceID and KeyImpl objects
2024-02-09 15:53:52 -05:00
NxDs 82725b5e32
Add BlockFace#fromDirection
(cherry picked from commit cc39a90857)
2024-02-09 15:04:36 -05:00
Spongecade e9e58e4fce
Update Minecraft Wiki links to new domain
(cherry picked from commit 478eba12fb)
2024-02-09 15:03:05 -05:00
mworzala 27e774dd1b
fix: javadoc tag issue in ServerFlag :| 2024-02-09 14:35:09 -05:00
mworzala e1140b5856 chore: remove extensions 2024-02-09 14:27:43 -05:00
mworzala 909cc992eb chore: remove terminal 2024-02-09 14:27:43 -05:00
mworzala 4240e535cc chore: remove (very outdated) Hologram utility 2024-02-09 14:27:43 -05:00
mworzala b63ea72e36 chore: minor cleanup from big cherry pick 2024-02-09 14:27:43 -05:00
mworzala d6470594ae feat: handle ping request packet to make f3+3 ping graph functional
(cherry picked from commit 9fa936af0c298150a0d657415bea632b73f78048)
2024-02-09 14:27:43 -05:00
iam f0f81803a5 Fix lighting tests & heightmap (#137)
* fix tests

* fix heightmap lookup

(cherry picked from commit 7d717ada584bc3a3feaeda470113bb4adeb774ae)
2024-02-09 14:27:43 -05:00
iam 8aedd5fc26 Send Lighting Immediately (#131)
Fix lighting

(cherry picked from commit 0494ee0b97c0ce28ffd6d744a494c65fa8308658)
2024-02-09 14:27:43 -05:00
Kil'jaeden 12da0c7e4a Added support for trim registries (#128)
* trim_material and trim_pattern registries are now generated, loaded and sent to the clients

* fixed override_armor_materials

* allowing TrimMaterial and TrimPattern to be created dynamically

* cleanup and formatting

(cherry picked from commit 70e4355ca1)
2024-02-09 14:27:43 -05:00
mworzala a14dbf5cdd fix: shaped recipe protocol reorder
(cherry picked from commit 9d6752c86f)
2024-02-09 14:27:43 -05:00
mworzala f80d11d719 fix: still update pose for players who had their entity type switched
(cherry picked from commit da46d07699)
2024-02-09 14:27:43 -05:00
mworzala 3a25d0124d fix: Player#switchEntityType throws an exception
(cherry picked from commit 9fc4137995)
2024-02-09 14:27:43 -05:00
Ryan Jones 0bef1b37fc More safely handle offline authentication servers. (#124)
(cherry picked from commit 002dcc2745)
2024-02-09 14:27:43 -05:00
mworzala 46ba2f0f40 fix: add missing default metadata values
(cherry picked from commit 6b3f670cfb)
2024-02-09 14:27:43 -05:00
mworzala 35a4c803d9 feat: expose isFaceFull for testing if a block shape has a full face
(cherry picked from commit cf4a2d134e)
2024-02-09 14:27:43 -05:00
mworzala 38076fe707 fix: fix to closing inventories serverside while sending updates
(cherry picked from commit f5727c207b)
2024-02-09 14:27:43 -05:00
mworzala 48d87db6e9 fix: InventoryCloseStateTest (#111)
(cherry picked from commit aec3694a4a)
2024-02-09 14:27:43 -05:00
GreatWyrm 7cec8f0bfc Fix server replaying the close window packet
(cherry picked from commit 4ba779d3f1)
2024-02-09 14:27:43 -05:00
mudkip cf8c275cf2 add hardcore property to config event (#117)
(cherry picked from commit f5f8e21427)
2024-02-09 14:27:43 -05:00
mworzala 06695f71f0 fix: send load chunks game state in Player#refreshClientStateAfterRespawn to fix change skin & dimension changes
(cherry picked from commit e7b0e702f6)
2024-02-09 14:27:43 -05:00
mworzala d544c8776a fix: fakeplayer can spawn once again (#94)
(cherry picked from commit 5347c0b11f)
2024-02-09 14:27:43 -05:00
mworzala f4cb5272f9 fix: re-merge connection states, remove OptifineSupport
(cherry picked from commit a0ca4895b1)
2024-02-09 14:27:43 -05:00
mworzala 69aeb8e2ea fix: preserve instance tag on #copy() (fix #112)
(cherry picked from commit 5f49033842)
2024-02-09 14:27:43 -05:00
mworzala 833c5fe365 fix: test failures
(cherry picked from commit c0d3f01fa2)
2024-02-09 14:27:43 -05:00
mworzala ef0daa08bb chore: field reordering
(cherry picked from commit 2b0737615f8171a0172ba902786da0542f962d78)
(cherry picked from commit a032bc32a7)
2024-02-09 14:27:43 -05:00
bea4dev 7cbce377a7 fix Low accuracy tick rate
(cherry picked from commit ce9d254a23791403a2b19ee4bb6bb52e175fa5dd)
(cherry picked from commit 4e33a5e6d8)
2024-02-09 14:27:43 -05:00
mworzala c3a9841967 fix: link to correct wikivg packet
(cherry picked from commit aa2c820e40)
2024-02-09 14:27:43 -05:00
Mallory Hayr b5dc662262 Add missing inventory properties
(cherry picked from commit 600429e7d6)
2024-02-09 14:27:43 -05:00
DeidaraMC 35f9489280 update: infinite potion duration support (#106)
* upgrade: infinite potion duration

* fix: no more aqgit

---------

Co-authored-by: mworzala <mattheworzala@gmail.com>
(cherry picked from commit bb4d925ec4)
2024-02-09 14:27:43 -05:00
rockquiet c421971eaa fix typo in builtin command conditions (#115)
(cherry picked from commit 3be7b09b7d)
2024-02-09 14:27:43 -05:00
mworzala 9aa34529a9 fix: smithing table has 4 slots, not 3
(cherry picked from commit 6a19940b4d)
2024-02-09 14:27:43 -05:00
mworzala 84a1150afe fix: update advancement packet to 1.20.4
(cherry picked from commit 03ef3e2374)
2024-02-09 14:27:43 -05:00
mworzala 6be9ba629e fix: reenable metadata on exiting configuration
(cherry picked from commit 3bbdb1f0c9)
2024-02-09 14:27:43 -05:00
mworzala 8fafe723ae feat: add properties to configure chunk queue
(cherry picked from commit a910ce359d)
2024-02-09 14:27:43 -05:00
mworzala d7abff5c43 feat: conform to Adventure resource pack API, remove Minestom resource pack types
(cherry picked from commit 40ac94d092)
2024-02-09 14:27:43 -05:00
mworzala 6f30edb411 feat: implement 1.20.2 client-rate-limited chunk batching
(cherry picked from commit e24cb62583)
2024-02-09 14:27:43 -05:00
DeidaraMC 0bb237f737 explosion packet fix, add bundle packet, rename tick rate packet to match wiki.vg (#103)
* packet fixes

* explosion packet touchup

(cherry picked from commit d576228655)
2024-02-09 14:27:43 -05:00
GreatWyrm 6f6a54857e Update block interact event, and add some clarifying Javadocs on what blockItemUse method does (#102)
(cherry picked from commit dfe892aa1a)
2024-02-09 14:27:43 -05:00
GreatWyrm 20bd56ebca Fix block entity data not being resent when a block break event was cancelled (#101)
(cherry picked from commit 2d5fa3a7c7)
2024-02-09 14:27:43 -05:00
DeidaraMC a5b21c48fd fix incorrect skin layer setting (#100)
This seems to be the right place to send the metadata without interfering with the configuration state

(cherry picked from commit 8c3478beca)
2024-02-09 14:27:43 -05:00
Matt Worzala 58b550c5ff Fix testing (v2) (#99)
* Fix Minecraft changes since 1.19 (Block.GRASS, recipe packet, DamageType.VOID)

* Add packets in play state

* Fix some tests via TestConnectionImpl and API changes

* fix: add some missing entity metas, group projectiles

---------

Co-authored-by: GoldenStack <goldenfire64yt@gmail.com>
(cherry picked from commit 89a665fdf5)
2024-02-09 14:27:43 -05:00
DeidaraMC ed13961e90 new scoreboard protocol number format conformance (#98)
* new scoreboard protocol conformance

* fix: pass number format through when reading scoreboard packet

---------

Co-authored-by: mworzala <mattheworzala@gmail.com>
(cherry picked from commit 2003f75f1f)
2024-02-09 14:27:43 -05:00
mworzala e6e16a7a08 fix: do not send login disconnect packet before switching to login state
(cherry picked from commit 6d5b1ea77e)
2024-02-09 14:27:43 -05:00
mworzala c9ee2b56b2 chore: revert (mostly) ConnectionManager#getOnlinePlayers change
(cherry picked from commit 8859af87ba)
2024-02-09 14:27:43 -05:00
mworzala d72e56b4be fix: begin join game sequence only after client acks configuration finish
(cherry picked from commit 197daae608)
2024-02-09 14:27:43 -05:00
mworzala efc0620afe fix: add missing resource pack status events
(cherry picked from commit 89c57bfac6)
2024-02-09 14:27:43 -05:00
mworzala ef2b5e03bc fix: send LEVEL_CHUNKS_LOAD_START state on all instance changes, not just first join
(cherry picked from commit 1813cdb1a8)
2024-02-09 14:27:43 -05:00
mworzala 055b927bca upgrade: minor fixes, disable some scoreboard stuff temporarily
(cherry picked from commit db28c44b40)
2024-02-09 14:27:43 -05:00
mworzala 5de3436c71 upgrade: 1.20.4 data, most missing packets
(cherry picked from commit dc6a6089f1)
2024-02-09 14:27:43 -05:00
mworzala 6416e8e441 upgrade: first join
(cherry picked from commit ed06d71ac8)
2024-02-09 14:27:43 -05:00
mworzala 772b484864 upgrade: NBT chat component serializer implementation
(cherry picked from commit ed240d6f14)
2024-02-09 14:27:43 -05:00
mworzala fad5537017 chore: use common function to generate invalid state errors
(cherry picked from commit 7e47136f28)
2024-02-09 14:27:43 -05:00
MelonHell aea1872f4b throw IllegalArgumentException on wrong ConnectionState
(cherry picked from commit 2643c4dec3cb7a5960e88fd662cddd81ff39fbfc)
(cherry picked from commit 01ca4969d8)
2024-02-09 14:27:43 -05:00