Commit Graph

5896 Commits

Author SHA1 Message Date
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
Samuel
e257d4b4b2
Add blockFace to BlockHandler.Interaction (#2388) 2024-09-16 21:57:41 +00:00
TheMode
4305006e6b
Remove Instance dependency from pathfinding (#2397) 2024-09-13 17:01:26 -04:00
themode
44d8a810bc PlayerInit shouldnt be static 2024-09-13 17:03:42 +02:00
Samuel
d955f51899
Add Block::nbtOrEmpty (#2389) 2024-09-10 10:00:51 +02:00
themode
7ce047b22e More Vec operator, more min/max methods 2024-09-08 19:12:32 +02:00
Floweynt
11ed85a921
fix missing inversion in DataComponentMap#diff handling for removed entries (#2359) 2024-09-07 22:31:42 +00:00
SLH
af7e357140
fix: saturation not working in food item component (#2382) 2024-09-07 22:27:18 +00:00
Samuel
c509804300
Playsound exclude (#2381)
* Add Instance::playSoundExcept

* Uh...
2024-09-07 22:24:53 +00:00
Lorenz Wrobel
b0bad7e180
give more control of collisions to the entities colliding (#2350)
* give more control of collisions to the entities colliding
2024-09-06 01:17:16 -04:00
GreatWyrm
1b85254f91
Fix chunks not being refreshed when view distance updates (#2197)
* Fix chunks not being refreshed when view distance updates
2024-09-06 03:22:24 +00:00
bea4dev
3172039f39
fix team visibility (#2186) 2024-09-06 03:15:41 +00:00
themode
6e0ee029a6 Remove mojang utils cache 2024-09-05 01:33:58 +02:00
TheMode
c24f3a5d99
Remove caffeine dependency from EventNode (#2375) 2024-09-05 00:15:56 +02:00
themode
4553d3c574 update dependencies 2024-09-04 02:13:47 +02:00
Kerman
f591566407
Implement Graph Cache in CommandManager (#2360) 2024-09-03 23:54:33 +00:00
themode
2d92fa6657 unused cache 2024-09-04 01:46:33 +02:00
TogAr2
61f7b61fa9
Add EquipmentSlot.BODY (#2325)
* Add EquipmentSlot.BODY

* EntityEquipmentPacket should now have 7 entries

* Simplify isHand check

* Fix tests

---------

Co-authored-by: Matt Worzala <35708499+mworzala@users.noreply.github.com>
2024-09-03 23:46:04 +00:00
TheMode
b1c34cc9d7
record namespace (#2374) 2024-09-04 01:09:35 +02:00
TheMode
5ec42c6ba9
Light cleanup (#2372) 2024-09-04 01:05:43 +02:00
TheMode
a3dec124aa
Use a single int for all block states (#2373) 2024-09-04 00:52:01 +02:00
TheMode
b1ad94cd1b
Make BoundingBox/ShapeImpl records (#2371) 2024-09-03 11:01:34 +02:00
themode
65f75bb059 clear remaining hephaistos usage 2024-08-28 21:01:41 +02:00