Commit Graph

5818 Commits

Author SHA1 Message Date
TheMode
12e7bb327d entity status/meta storage (#2378) 2024-12-03 10:45:16 -05:00
Kerman
53e4e8d646 Rework LoginListener (#2384)
* Move kick to PlayerConnection

* Redo Mojang LoginListener

- Move away from HTTPClient and use MojangUtils
- Add feature to prevent proxy connections

* Kick before handling exception.

* Update to throw IOException back to the login listener.

* Use PlayerConnection#kick in HandshakeListener

Also remove unused import left over in Player
2024-12-03 10:45:16 -05:00
mudkip
5e2c1de0a5 fix javadoc (#2391) 2024-12-03 10:45:16 -05:00
themode
ba407a8a37 Remove Caffeine lib 2024-12-03 10:45:16 -05:00
themode
d04b11eebd Additional merging fixes 2024-12-03 10:45:16 -05:00
themode
30d86e1134 Remove buffer slice 2024-12-03 10:45:16 -05:00
themode
1913b0acf0 Remove caffeine from viewable packets 2024-12-03 10:45:16 -05:00
TheMode
a1048133d1 GameMode hardcoded abilities (#2366) 2024-12-03 10:45:16 -05:00
TheMode
5ccd0f0789 PlayerSettings record (#2365) 2024-12-03 10:45:16 -05:00
themode
388ed525aa Avoid reallocating buffer view 2024-12-03 10:45:16 -05:00
themode
dd1b584cd2 Add throws IndexOutOfBoundsException buffer warning 2024-12-03 10:45:16 -05:00
themode
879942e6ab fixes 2024-12-03 10:45:16 -05:00
TheMode
3f079d252e Network improvements (#2324) 2024-12-03 10:45:16 -05:00
mudkip
561470c82a Improve chat API (#2329)
* improve chat api

* fix typoes

* remove click event

* make requested changes
2024-12-03 10:45:16 -05:00
Eaterminer
000483dcde fix: grammatical mistake in PlayerChatEvent.java (#2313) 2024-12-03 10:45:16 -05:00
themode
a561cd0a3e Fix packet tests 2024-12-03 10:45:16 -05:00
TheMode
b5a53f8b6b Remove BinaryReader/Writer (#2291)
* Remove BinaryReader/Writer

* Fix UpdateEnabledFeaturesPacket
2024-12-03 10:45:16 -05:00
TheMode
00ca682d05 Compress packet serializers (#2289)
* WIP packet template serializers

* More packets

* More packets

* More packets

* No more packets

* rename to buffer

* less generic mess

* review stuff

* Fix ClientResourcePackStatusPacket enum

* Update UpdateEnabledFeaturesPacket
2024-12-03 10:45:16 -05:00
TheMode
e1e26cbd35 Get packet id from packet registry (#2288)
* Get packet id from packet registry

* Fix test, cleanup packet parser/registry

* Style
2024-12-03 10:45:16 -05:00
TheMode
6a95c6576d Recipe rework (#2285)
* Recipe rework

* Remove unnecessary lists

* Add remaining recipes

* Fix `dataSerializer`

* Fix DecoratedPot naming
2024-12-03 10:45:16 -05:00
TheMode
020c99fc44 PacketParser (#2283)
* PacketParser

* Remove old ClientPacketsHandler.java

* Use ClassValue, use packetparser subclass
2024-12-03 10:45:16 -05:00
TheMode
be6b723490 Remove MinecraftServer + Entity from packets (#2287)
* Remove `MinecraftServer` + `Entity` from packets

* No need for static cached packet
2024-12-03 10:45:16 -05:00
TheMode
9498b28fda Range rework (#2284)
* Range rework

* Range.Int
2024-12-03 10:45:16 -05:00
TheMode
3a8157f263 move enums (#2282) 2024-12-03 10:45:16 -05:00
mudkip
7ced218bf5 improve notification api (#2204) 2024-12-03 10:45:16 -05:00
Lukadcf
f966351cb7
Fixed switching slots while using item (#2500)
* Removed clearItemUse() from refreshHeldSlot() because offhand

* Use 0 itemUseTime if the player is already using their mainHand and tries to use their offHand as you can only use one hand at a time

* Call clearItemUse() only when not using offhand, also refreshActiveHand

* Removed duplicate check
2024-12-02 22:15:14 -05:00
Steank
ba55b05e14
fix: check spawn type before sending attributes packet (#2495)
* fix: check spawn type before sending attributes packet

* fix: add check in additional location where EntityAttributesPacket is sent
2024-11-30 21:57:29 +00:00
surv
afa8f4e96a
fix painting variants (#2490)
* fix: painting variants are now ordered and sent to the client correctly

* fix: use equals() to compare Strings

Co-authored-by: mudkip <mudkip@mudkip.dev>

* chore: add comment explaining painting variant check

* chore: improve explanation for painting variant exception

Proper support for "holder" types like this one should be added later.

---------

Co-authored-by: mudkip <mudkip@mudkip.dev>
2024-11-30 20:17:57 +00:00
Robert Dylan Brunson
f67112a584
fix position used in the 'onPlace' method when loading (#2409)
* fix position used in the 'onPlace' method when loading

* revert formatting change
2024-11-28 13:10:06 +00:00
mudkip
dc89d8d28c
remove tinylog service file (#2482) 2024-11-28 12:51:20 +00:00
Lukadcf
18d6e0c6d6
Fixed boundingBox.withOffset() (#2488) 2024-11-24 19:19:30 -05:00
GreatWyrm
bb7acc2e77
Add empty path check in PathGenerator (#2477) 2024-11-13 11:51:25 -05:00
mworzala
f71ab6d851
fix: change FireworkList.flightDuration from a byte to an int.
Mojang is somewhat inconsistent here. It is written over the wire as a var int, but the NBT type is a byte. DFU will coerce an int to a byte when reading so it is compatible to treat it as an int everywhere on our side.
2024-11-03 16:18:20 -05:00
GreatWyrm
c148954a47
Change Map Reduction flag to be an int property to avoid number parsing (#2460)
* Change Map Reduction flag to be an int property to avoid number parsing
2024-10-31 19:24:53 +00:00
GreatWyrm
16c9182ab0
Make entity interaction dependent on range (#2459)
* Make entity interaction dependent on range, and add a server flag controlling that
2024-10-31 15:21:02 -04:00
Samuel
dba90a461b
Fix anvil saving (minimum 4 bits per entry in block_states palette) (#2450) 2024-10-24 17:34:22 -04:00
boxic
bcb0301fb1
Duplicate block property ID fix + unit test (#2433)
* Duplicate property check

* increased bits per index

* fixed MAX_STATES error

* Block properties are now long, and new test for block state ID conversion

* Block properties are now long, and new test for block state ID conversion

* Block properties are now long, and new test for block state ID conversion

* excessive bits, and assertion fix

---------

Co-authored-by: Matt Worzala <35708499+mworzala@users.noreply.github.com>
2024-10-21 15:00:05 +00:00
mworzala
81ecb0fd5f
fix: PlayerAnvilInputEvent should be an InventoryEvent 2024-10-20 20:57:25 -04:00
mworzala
0ca1dda2fe
fix: allow zero length message in RAW_BYTES (plugin message) 2024-10-15 09:03:35 -04:00
GreatWyrm
1c47dd613f
Fix EffectChance network writer (#2429) 2024-10-06 23:14:02 +00:00
Athishh
1d360f3b3e
Fix possible crasher & console spammer (#2428)
fixes an ArrayOutOfBounds packet exploit abusing  ClientClickWindowPacket that spams console and could lead to a crash due to excess cpu usage.

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 46 at java.base/jdk.internal.util.Preconditions$2.apply(Preconditions.java:63) at java.base/jdk.internal.util.Preconditions$2.apply(Preconditions.java:60) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) at java.base/java.lang.invoke.VarHandleReferences$Array.getVolatile(VarHandleReferences.java:604) at net.minestom.server.inventory.AbstractInventory.getItemStack(AbstractInventory.java:185) at net.minestom.server.inventory.PlayerInventory.changeHeld(PlayerInventory.java:250) at net.minestom.server.listener.WindowListener.clickWindowListener(WindowListener.java:54) at net.minestom.server.listener.manager.PacketListenerManager.lambda$setPlayListener$2(PacketListenerManager.java:163) at net.minestom.server.listener.manager.PacketListenerManager.processClientPacket(PacketListenerManager.java:132) at net.minestom.server.entity.Player.lambda$interpretPacketQueue$12(Player.java:2131) at org.jctools.queues.MpscArrayQueue.drain(MpscArrayQueue.java:512) at net.minestom.server.entity.Player.interpretPacketQueue(Player.java:2131) at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) at java.base/java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:425) at net.minestom.server.network.ConnectionManager.tick(ConnectionManager.java:369) at net.minestom.server.ServerProcessImpl$TickerImpl.tick(ServerProcessImpl.java:37
2024-10-06 19:09:47 -04:00
Spliterash
b9780c8603
fix: call PlayerDisconnectEvent on all ConnectionState (#2243) 2024-10-06 17:24:40 -04:00
mworzala
59406d5b54
fix: catch any throwable in tick loop to prevent thread death 2024-10-04 19:22:35 -04:00
mworzala
38b3ad3a10
Revert "Dispatch InventoryCloseEvent after Player#closeInventory (#2415)"
This reverts commit e8f34c317a.
2024-10-02 17:27:21 -04:00
Tech
e8f34c317a
Dispatch InventoryCloseEvent after Player#closeInventory (#2415)
* feat: register multiple commands

* misc: requested changes

* fix: call close inventory before dispatching event
2024-09-30 02:06:13 -04:00
Perny
96bf14500a
feat: Added Instance.setWorldAge() (#2414) 2024-09-28 02:23:47 +00:00
unjoinable
916424e995
Update Tag.java (#2418)
Added docs for Transient tag due to being requested in Minestom discord.
2024-09-27 12:54:57 -04:00
Tyreece Rozycki
d0754f2a15
simplify teleport event + expose correct relativity fields (#2408) 2024-09-19 23:36:02 +10:00
CoPokBl
25901b3867
Add EntityTeleportEvent (#2407)
* add EntityTeleportEvent
2024-09-19 21:59:26 +10:00
Tech
9fbff439e7
feat: register multiple commands (#2394) 2024-09-17 00:45:55 +02:00