Commit Graph

605 Commits

Author SHA1 Message Date
TheMode
bcf184123d Fix build 2021-05-15 10:12:04 +02:00
TheMode
88dba380f9 Remove apache common text dependency 2021-05-15 08:31:24 +02:00
TheMode
dfad9f2947 Remove minecraft repo 2021-05-15 07:57:28 +02:00
TheMode
6a712b33a0 Revert "Added CachedObject to access a single-object cache"
This reverts commit 1c39e06d
2021-05-13 08:32:26 +02:00
TheMode
1c39e06d55 Added CachedObject to access a single-object cache 2021-05-13 08:06:42 +02:00
TheMode
4ab35fbbc0 Remove magic value for pre-filled var ints 2021-05-11 03:10:18 +02:00
TheMode
d41a4dcf54 Reduce grouped packet buffer overhead 2021-05-10 11:16:17 +02:00
TheMode
96fe9f1063 Framed packet cleanup 4 2021-05-10 11:03:58 +02:00
TheMode
aaa012a975 Framed packet cleanup 3 2021-05-10 11:02:12 +02:00
TheMode
590b42c223 Framed packet cleanup 2 2021-05-10 07:00:16 +02:00
TheMode
b96386cee5 PacketUtils#writeFramedPacket cleanup 2021-05-10 05:47:14 +02:00
TheMode
9cf897a4cc Remove empty lines 2021-05-10 01:17:43 +02:00
TheMode
f69b40109c Merge branch 'master' into position-cleanup 2021-05-10 00:31:17 +02:00
TheMode
5d7a49c009 Steal velocity VarInt optimization 2021-05-09 07:36:09 +02:00
TheMode
165b7bced2 Only direct buffer should be used for IO 2021-05-08 22:45:57 +02:00
TheMode
fbae08a5a6 Remove unused method 2021-05-08 01:05:51 +02:00
TheMode
f1e48b07b9 Reduce use of the pooled allocator 2021-05-08 00:52:46 +02:00
Németh Noel
2f1ada9a9f Merge remote-tracking branch 'upstream/master' into position-cleanup 2021-05-05 18:26:57 +02:00
Kieran Wallbanks
42933e58b0 Minor formatting and javadoc changes 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
17d584a2e3 Swap to SocketAddress 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
a6294ffd5b Cleanup imports 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
94ecb8de7b Add Query system 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
f9245e8404 Move free port obtaining to util class 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
462397d102 Remove Named and Identified interfaces 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
0ac6d1aa37 Add shorthand methods for string creation 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
3651a132fe Correct Javadoc 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
a16c8d3273 Use Component in NamedAndIdentified 2021-05-05 16:18:10 +01:00
Kieran Wallbanks
8d192fcb9c Add NamedAndIdentified interface 2021-05-05 16:18:10 +01:00
Németh Noel
5b41f3ffd0 Spiral chunk loading 2021-05-05 17:05:22 +02:00
TheMode
e92fb1e8d5 Invalidate cache chunk packets when unloaded 2021-04-23 17:52:10 +02:00
TheMode
6b5f755bfd Allow null nbt, remove NBTUtils.loadItem 2021-04-18 04:44:16 +02:00
TheMode
683a6d35fa Merge branch 'master' into tickable
# Conflicts:
#	src/main/java/net/minestom/server/entity/Entity.java
#	src/main/java/net/minestom/server/instance/DynamicChunk.java
#	src/main/java/net/minestom/server/instance/Instance.java
2021-04-14 20:06:35 +02:00
TheMode
c57e35c58a Add completable future return to AsyncUtils 2021-04-14 04:06:41 +02:00
TheMode
b68c30423c Add BinaryWriter#write(ByteBuf) 2021-04-14 01:40:21 +02:00
TheMode
1b98a65869 Get entities from all instances when none is specified in an entity query 2021-04-13 02:08:09 +02:00
TheMode
4932262750 Use chunk instead of instance to check if an entity is on ground 2021-04-12 04:45:11 +02:00
TheMode
1d5262caf2 Merge branch 'master' into item-api
# Conflicts:
#	src/test/java/demo/PlayerInit.java
2021-04-12 00:44:47 +02:00
TheMode
f7bf7c1321
Merge pull request #204 from kezz/send-packets-to-audience
Add util method to send a packet to an audience
2021-04-11 15:29:04 +02:00
TheMode
6e0202c33b Fix math, improve physics performance 2021-04-11 03:21:38 +02:00
TheMode
e0c2c4b655 Support for canPlace & canDestroy meta 2021-04-11 00:42:09 +02:00
TheMode
032343011a Reduce map lookup when looping through surrounding custom blocks 2021-04-10 22:03:03 +02:00
TheMode
c74946cc3c Cache entity current chunk 2021-04-10 21:42:45 +02:00
TheMode
be2d1db9e0 Merge branch 'master' into item-api 2021-04-10 19:37:36 +02:00
TheMode
e81c31f61b Remove Ownership code 2021-04-10 17:47:45 +02:00
TheMode
e4f7a66046 Packet cache rename 2021-04-10 02:02:59 +02:00
TheMode
d1f8e60a7e Cache meta binary 2021-04-10 00:55:18 +02:00
TheMode
5e8e7cbaf4 Rename nbt method to remove confusion about the object being mutable or not 2021-04-10 00:24:29 +02:00
TheMode
d6e7c9a635 Handle nbt directly inside builders instead of lazily 2021-04-09 23:57:05 +02:00
TheMode
e19af0377c Merge branch 'master' into item-api
# Conflicts:
#	src/main/java/net/minestom/server/item/ItemDisplay.java
#	src/main/java/net/minestom/server/utils/binary/BinaryReader.java
2021-04-09 23:19:38 +02:00
TheMode
e4a26df2b6 Rename ItemMeta#nbt, remove unnecessary cache 2021-04-09 23:16:57 +02:00
Kieran Wallbanks
05192de8e1 Make NamespaceID implement Key directly 2021-04-09 13:47:53 +01:00
TheMode
01d233f7d8 Overall performance improvement 2021-04-09 05:40:40 +02:00
TheMode
25176e9b9d
Merge pull request #231 from DiamondCodingYT/yaw-fix
Added a yaw fix to for issue #168
2021-04-08 15:04:08 +02:00
Florian Fuhrmann
9c1eeb56d3 Added the Position#fixYaw method that fixes yaw values an used it on Position#setYaw and on a Position constructor to fix issue #168 2021-04-08 12:45:17 +02:00
TheMode
4c495f401d Code cleanup 2021-04-07 18:35:19 +02:00
LeoDog896
9d1d60cdcd Equals & hashcode overrides 2021-04-06 15:25:18 -04:00
TheMode
0bb8144d33 Improve BinaryReader & BinaryWriter 2021-04-06 18:31:30 +02:00
TheMode
017bbf8a60 Remove 0 size check 2021-04-06 06:43:16 +02:00
TheMode
720c986cea Fix reading of non-ASCII characters being higher than the protocol limit 2021-04-06 06:39:57 +02:00
Felix Cravic
e3867c659b Merge branch 'master' into item-api
# Conflicts:
#	src/main/java/net/minestom/server/item/ItemStack.java
2021-04-06 05:10:58 +02:00
themode
5a5531723c Fix original nbt overwriting modified meta 2021-04-04 21:34:48 +02:00
Konstantin Shandurenko
e295ffea51 Switched to Cooldown object in attacking goals 2021-04-04 03:13:56 +03:00
themode
4a075da3e0 Ensure that the meta is new when instantiating from NBT 2021-04-02 22:40:24 +02:00
themode
8d8a22f209 Use original NBT when possible 2021-04-02 22:14:48 +02:00
themode
7dcc52de57 Support item stacking, cleanup 2021-04-02 18:25:20 +02:00
themode
a128d30b6b WIP Item rework implementation 2021-04-02 18:13:02 +02:00
Matt Worzala
481494d572
Remove deprecated copy methods 2021-04-01 11:32:09 -04:00
themode
d332855bc4 Renamed CooldownUtils to Cooldown 2021-03-31 19:17:37 +02:00
TheMode
b386472eb3 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/main/java/net/minestom/server/network/player/NettyPlayerConnection.java
2021-03-30 22:40:48 +02:00
TheMode
f3eb3f6e34 Remove packet caching to CacheablePacket#getCache
Signed-off-by: TheMode <themode@outlook.fr>
2021-03-30 22:38:45 +02:00
jglrxavpok
1ffd327214 Read/Write methods inside BinaryReader/BinaryWriter for Writeable and Readable interfaces 2021-03-30 22:11:30 +02:00
jglrxavpok
930054385f More packets, just missing ChunkDataPacket 2021-03-30 19:50:55 +02:00
jglrxavpok
43957805fd Handshake and login packets, even more readable server packets 2021-03-30 19:42:40 +02:00
jglrxavpok
f9dcbafddf More readable server packets 2021-03-30 19:39:05 +02:00
jglrxavpok
7b8a8e3eb0 Tests to check which packets fail to write then read properly 2021-03-30 19:37:43 +02:00
Kieran Wallbanks
18608deefa Add util method to send a packet to an audience 2021-03-30 15:54:56 +01:00
themode
f3a67f8f50 Fix heap buffer being used for cached packets 2021-03-29 20:31:06 +02:00
themode
1e817ee4b5 Use velocity native compression 2021-03-28 20:40:27 +02:00
themode
85d01e5009 Micro optimize packet header varint 2021-03-28 19:34:38 +02:00
TheMode
d73f87d545 Use default compression level
Signed-off-by: TheMode <themode@outlook.fr>
2021-03-28 17:35:22 +02:00
themode
56a34f73d9 Improve/simplify packet memory allocation 2021-03-28 15:58:52 +02:00
Kezz
156c6a31df
Write scoreboard objects using standard JSON serialization (#196) 2021-03-28 01:52:35 +10:00
themode
66ab1bb53d Prevent Check#notNull from concatenating strings unnecessarily 2021-03-26 22:23:41 +01:00
Kieran Wallbanks
d433b0d3bc Write scoreboard values using legacy strings 2021-03-26 19:42:04 +00:00
themode
d33f7df512 Force non-null components 2021-03-26 20:00:52 +01:00
TheMode
74947251fd
Merge pull request #157 from kezz/adventure
Adventure Time!
2021-03-26 19:46:41 +01:00
themode
52c7192462 Fix EntityFinder for non-player entities 2021-03-26 19:32:12 +01:00
Kieran Wallbanks
aa2d1f6397 Rename serializer and make static static 2021-03-26 17:34:39 +00:00
Kieran Wallbanks
cd06fbdfaa Fix ItemStack display name serialization 2021-03-26 17:34:39 +00:00
Kieran Wallbanks
e02a521494 Send all Adventure packets grouped where possible 2021-03-26 17:34:39 +00:00
Kieran Wallbanks
0178a0a852 Add Contract annotation to asBinaryTagHolder 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
9e6b1203e1 Fix NamespaceID tests 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
8cb10a2049 Implement Keyed in NamespaceID 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
8dc7328c76 Off-by-default component translation 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
52ce8027f2 Simplify component translation 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
c40139349b Add null check for Component in BinaryWriter 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
6dd3eb8044 Implement HoverSource for ItemStack, Entity and Player 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
327558c003 begin bringing packets back to use components 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
4179e5b91e allow obtaining enum values from registries using adventure key 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
f2897eedca fix title ticks 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
3b0aa2d63b Deprecate legacy chat functions 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
522367dd78 Begin removing deprecated usages 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
4f0944ba9f Initial adventure implementation
- deprecate old text classes
- make CommandSender and Audience
- implement in ConsoleSender
- partially implement in Player
2021-03-26 17:34:38 +00:00
themode
0d7d7ef453 Cleanup comment 2021-03-26 16:43:25 +01:00
themode
cef7e3d591 Optimize packet writing & reduce allocation 2021-03-26 15:58:46 +01:00
themode
9c8c8c8bf8 WIP packet allocation improvement 2021-03-26 13:08:05 +01:00
themode
0eea491f9d Fix intellij warning 2021-03-26 08:52:16 +01:00
themode
622f632989 Use heap buffer for short lived packets 2021-03-25 16:51:36 +01:00
themode
b3655ad82d Small style cleanup 2021-03-25 16:05:10 +01:00
Eoghanmc22
0f5bb0e4f2 Changes to networking 2021-03-25 10:44:02 -04:00
themode
4c3215bf1b Fix packet writing when compression is disabled 2021-03-22 19:37:16 +01:00
themode
01e56636da Reduce the number of buffer copy 2021-03-22 14:31:38 +01:00
themode
126382f55d Reduce memory allocation 2021-03-21 13:22:49 +01:00
themode
cd75740e41 Fix compilation 2021-03-21 11:46:04 +01:00
themode
cd273b4d99 Use direct buffer for framed packets 2021-03-20 11:59:02 +01:00
themode
a9a0a672f0 Reduce deflater level, prevent race condition when releasing tick buffer 2021-03-20 10:20:45 +01:00
themode
71d0d06f90 Improve block placement performance, more abstraction for future features 2021-03-19 05:51:42 +01:00
themode
933b2663eb small style cleanup 2021-03-19 03:56:25 +01:00
themode
4f2ec0a65f Fix chunk coordinates not being properly calculated 2021-03-13 23:04:15 +01:00
themode
3ecace5bd6 Introduce the Tickable interface 2021-03-11 20:54:30 +01:00
themode
999a815eba Use ThreadLocal for deflater instead of dirty hack 2021-03-05 23:57:28 +01:00
themode
469a4a32f7 Cache values from the mojang api 2021-03-05 23:03:18 +01:00
LeoDog896
b20de605e1 Add default method and fix tests 2021-03-04 11:57:58 -05:00
LeoDog896
283469e025 Prefer position over entity 2021-03-04 11:54:29 -05:00
themode
93bd039938 Fix EntityFinder performance when searching for a constant name or uuid 2021-03-04 13:54:46 +01:00
themode
25c2dc661f Fix position yaw/pitch not being copied 2021-03-02 19:36:11 +01:00
themode
a927938677 Fix cached packets being outdated 2021-03-02 19:14:52 +01:00
Németh Noel
2f725becf2 canPlaceOn and canDestroy getters no longer return an unmodifiable list, methods for additions and removals are therefore removed 2021-02-28 22:39:38 +01:00
Németh Noel
10ece83d75 Cleaned up imports and removed unnecessary .toString() calls 2021-02-28 20:35:10 +01:00
Németh Noel
7abf6ba9e7 Added CanPlaceOn and CanDestroy properties for ItemStacks and implemented checks for them 2021-02-28 19:37:31 +01:00
themode
419ebe7553 Use soft references for cached packet instead of weak 2021-02-26 12:48:53 +01:00
TheMode
d3bea57ddc Packet caching cleanup
Signed-off-by: TheMode <themode@outlook.fr>
2021-02-25 20:14:13 +01:00
themode
882720c822 Added RawJsonMessage constructor taking a json object as a string to reduce boilerplate code 2021-02-25 19:01:29 +01:00
Konstantin Shandurenko
23ee4c7fdf Deprecated Entity constructors accepting spawnPosition and introduces Entity#setInstance(Instance, Position) 2021-02-25 13:56:10 +03:00
Konstantin Shandurenko
ebb061ae39 Removed LambdaMetafactoryUtils 2021-02-23 18:45:24 +03:00
Konstantin Shandurenko
6eda8f97db Removed @author javadocs 2021-02-23 09:14:38 +03:00
Konstantin Shandurenko
d2c5d87582 EntityType improvements 2021-02-23 06:02:52 +03:00
themode
0cef390ff2 Fix null check 2021-02-22 14:06:47 +01:00
TheMode
60385c0887
Merge pull request #141 from MrBretze/master
Fixed somme read for NBT Tag to ItemStack
2021-02-22 14:03:48 +01:00
TheMode
71f1e51df3
Merge pull request #146 from RinesThaix/goals
Arrows and RangedAttackGoal
2021-02-22 13:58:43 +01:00
themode
3d585825b2 Use weak references for cached values 2021-02-22 08:43:06 +01:00
themode
04b5a4f166 Use google common cache instead of our own dirty solution 2021-02-22 08:41:38 +01:00
Konstantin Shandurenko
3c8824c7b0 RangedAttackGoal implementation initial commit 2021-02-22 08:46:37 +03:00
themode
78e37258ed Improve ArgumentEntity to support entity UUID & pre-check for player name 2021-02-21 17:43:30 +01:00
ALS
fb6c51204b getAsByte 2021-02-21 16:59:50 +01:00
ALS
12f0190f97 Revert AttributeSlot.parse(String string) 2021-02-21 16:56:06 +01:00
themode
728107b0fe Added convenient EntityFinder#findFirstEntity 2021-02-21 12:35:04 +01:00
ALS
b842f07c3c Use getAsInt and getAsDouble 2021-02-20 23:54:25 +01:00
ALS
0f9a2b5b4f Fixed a possible null for attributeSlot 2021-02-20 20:39:49 +01:00
ALS
01ff9e2123 Fix failed issue 2021-02-20 19:51:45 +01:00
ALS
ac7ca6f8e4 Fixed somme read for NBT Tag to ItemStack 2021-02-20 17:35:02 +01:00
themode
f1448c8c89 Renamed RelativeLocation#from 2021-02-14 00:31:49 +01:00
themode
8334e100cf Don't send packet to disconnected clients 2021-02-07 22:02:03 +01:00
themode
2d7e16fa8e change UpdateOption value from int to long 2021-02-07 20:14:40 +01:00
themode
9fe2b8359c Added convenient EntityFinder#findFirstPlayer(CommandSender) 2021-02-03 17:21:49 +01:00
themode
b5d03cb7a9 Added convenient EntityFinder#find(CommandSender) 2021-02-03 16:57:58 +01:00
themode
7843f74b4b Fix string encoding to UTF-8 2021-02-01 23:39:44 +01:00
themode
3026e46220 Added new metadata API 2021-01-30 04:44:44 +01:00
themode
59c4cd9382 Reorder Direction enum to support entity metadata 2021-01-29 21:05:18 +01:00
themode
e0c8e94bc1 Limit the number of velocity packet used for entities 2021-01-27 19:35:53 +01:00
themode
7a54b4162d Style cleanup 2021-01-26 15:53:03 +01:00
themode
5f75ea7d3a Remove unnecessary casts 2021-01-25 19:33:53 +01:00
themode
3067f1daaa Merge with master 2021-01-25 19:27:04 +01:00
themode
9ee25ee8ce Merge branch 'master' into double-position 2021-01-25 19:24:19 +01:00
themode
fa02a12c1e More math 2021-01-25 14:09:36 +01:00
themode
f48c291929 More math methods in Vector 2021-01-25 13:56:17 +01:00
themode
c01736f863 Use doubles instead of floats to represent Position and Vector 2021-01-25 13:47:13 +01:00
TheMode
1cd3228c06
Merge pull request #109 from DerTyan/exception-handling
Added ExceptionManager for custom exception handling
2021-01-21 06:06:27 +01:00
Tyan
855c8af455 Added ExceptionManager for custom exception handling 2021-01-20 11:43:45 +01:00
themode
d83abcef85 Fix inventory click on size non-divisible by 9 2021-01-20 08:18:00 +01:00
LeoDog896
3b3a86a402 Prefer nullable over optional 2021-01-15 13:39:12 -05:00
themode
1859f513e5 Added convenient EntityFinder#findFirstPlayer 2021-01-10 02:39:05 +01:00
themode
b1db46f575 Allow null instance for entity query 2021-01-10 02:30:57 +01:00
themode
9aaecceb01 Added support for player name only 2021-01-09 03:31:24 +01:00
themode
8f99753235 WIP entity selector argument 2021-01-09 00:59:03 +01:00
themode
ef1afb9cd9 WIP EntityFinder 2021-01-08 23:47:31 +01:00
themode
90006ac48d Prevent compression from blocking the thread too much 2021-01-08 16:20:04 +01:00
themode
066b3dc417 Cleanup 2021-01-08 08:32:33 +01:00
themode
6b39cb1e32 Execute the async login event before sending the login success packet 2021-01-06 19:02:35 +01:00
themode
261d734740 Added all missing server packets 2021-01-05 13:44:14 +01:00
themode
640521e6dc Fix item hide flags and custom model data not being saved in the creative packet 2021-01-04 20:26:17 +01:00
themode
7019b7da85 Fix onGround field and gravityTickCount 2021-01-04 03:04:45 +01:00
themode
0faaea2c1b Added option to disable the grouped packet feature 2021-01-02 15:44:50 +01:00
Matt Worzala
0b9b95e6cb
remove debugging code & use inventory offset constant 2021-01-02 06:51:21 -05:00
Matt Worzala
1f60330abe
Fix double click result handling 2021-01-02 04:40:24 -05:00
Matt Worzala
46ac38d5b3
Change ColoredText usages to JsonMessage 2020-12-31 13:53:21 -05:00
Nesaak
ebea74f3c6 Remove unused import 2020-12-29 11:54:06 -05:00
Nesaak
fd73cc1d23 Add BlockIterator and LivingEntity#getTargetBlockPosition 2020-12-28 20:24:03 -05:00
Matt Worzala
071a2ce196
Change ArrayList types to List 2020-12-28 14:57:39 -05:00
themode
924fac562b Print exceptions properly during server tick 2020-12-28 12:27:25 +01:00
themode
f4818d46fb Cleanup extension code and added an option to disable extension loading on startup 2020-12-26 11:55:22 +01:00
R0bbyYT
4818e29d81 Merge remote-tracking branch 'origin/master' into feature/item-meta 2020-12-24 15:29:59 +01:00
R0bbyYT
724f0b9c7a Adds some documentation 2020-12-24 15:29:34 +01:00
themode
18eab183a0 Auto entity viewing cleanup 2020-12-23 10:40:50 +01:00
MichaelPriebe
881ed5deca Update code style 2020-12-17 01:16:24 -05:00
MichaelPriebe
917c4ddfd6 Fix and Cleanup Redstone Placement Rule 2020-12-17 00:51:13 -05:00
themode
0658d1659c Renamed ChunkSupplier#createChunk 2020-12-15 04:21:26 +01:00
themode
a3613bff89 Use CloneUtils for deep copy 2020-12-15 03:40:07 +01:00
themode
69d4792191 WIP collection deep cloning. Starting with PotionMeta 2020-12-15 03:29:47 +01:00
themode
3a988ddba1 Fixed block break particles and sound being played two times for the breaker 2020-12-14 06:06:28 +01:00