Commit Graph

406 Commits

Author SHA1 Message Date
TheMode
ca2a2eb233 Rename with to apply 2021-07-08 13:22:04 +02:00
TheMode
30464d903d Fix position packet being sent twice 2021-07-07 19:38:43 +02:00
TheMode
c9b2356a0b Fix entity chunk tracking 2021-07-07 19:20:58 +02:00
Németh Noel
ce8e14ede1 Use proper method for refreshing position 2021-07-07 18:36:24 +02:00
Németh Noel
5ae26c44e1 Initial npe fix 2021-07-07 17:56:17 +02:00
TheMode
84eb0a8934 Fix build 2021-07-07 14:59:53 +02:00
TheMode
8a5147c994 More fixes 2021-07-07 01:32:30 +02:00
Németh Noel
6f6b15fa96 Update part of Entity.java 2021-07-07 01:06:32 +02:00
Németh Noel
f29ed48da9 update getter names 2021-07-06 23:03:01 +02:00
Németh Noel
65a97e5b00 Initial collision update 2021-07-06 22:26:11 +02:00
TheMode
28dca16b29 Initial position api implementation 2021-07-06 20:44:24 +02:00
TheMode
796b6820ce Start implementing the new coordinate API 2021-07-05 09:10:03 +02:00
TheMode
0d031d4c15 Merge branch 'master' into new-block-api
# Conflicts:
#	src/main/java/net/minestom/server/instance/DynamicChunk.java
#	src/main/java/net/minestom/server/instance/Instance.java
#	src/main/java/net/minestom/server/instance/InstanceContainer.java
#	src/main/java/net/minestom/server/instance/SharedInstance.java
#	src/main/java/net/minestom/server/instance/block/CustomBlock.java
#	src/test/java/demo/Main.java
#	src/test/java/demo/blocks/CustomBlockSample.java
#	src/test/java/demo/blocks/UpdatableBlockDemo.java
2021-07-05 08:21:47 +02:00
Németh Noel
3f1c433c94 Removed unnecessary deprecations 2021-07-03 14:41:57 +02:00
Németh Noel
bcc1132ed7 Deprecated net.minestom.server.entity.Entity.scheduleRemove(long, java.time.temporal.TemporalUnit) 2021-07-01 15:03:16 +02:00
TheMode
5969ec1709 Merge branch 'master' into new-block-api
# Conflicts:
#	src/main/java/net/minestom/server/item/ItemMetaBuilder.java
2021-07-01 02:22:20 +02:00
Németh Noel
059565b397 Flip ?: null checks 2021-06-30 22:25:24 +02:00
Németh Noel
a5a370783d Removed redundant check 2021-06-30 22:00:05 +02:00
Németh Noel
c9dd06ba20 Simplified millis calculation 2021-06-30 13:10:22 +02:00
Németh Noel
01dfe2f48d Replaced ChronoUnit with TimeUnit for consistency 2021-06-30 13:05:52 +02:00
Németh Noel
67dc8bf996 Updated Entity.java 2021-06-30 00:59:26 +02:00
Németh Noel
f6425d9fb2 Reduce the visibility of Entity#initializeDefaultGravity 2021-06-28 21:58:59 +02:00
Németh Noel
796d296f0d Removed terminal velocity 2021-06-28 19:24:53 +02:00
Németh Noel
13779aabde Fix knockback 2021-06-28 19:23:36 +02:00
Németh Noel
1ea526aa89 Fix gravity acceleration 2021-06-27 23:29:28 +02:00
Németh Noel
6c60c4d0fc Implement knockback 2021-06-27 23:05:54 +02:00
Németh Noel
17aa606037 Added javadoc to gravity related fields 2021-06-27 22:48:58 +02:00
Németh Noel
811531da70 Remove unit conversion 2021-06-27 22:45:05 +02:00
Németh Noel
adf0e06888 Changed gravity calculation 2021-06-27 22:44:04 +02:00
Németh Noel
b900d0e73d Introduced Entity#initializeDefaultGravity method 2021-06-27 22:29:25 +02:00
TheMode
74073f13b5 Use classes instead of interfaces for BlockHandler type 2021-06-25 19:00:50 +02:00
TheMode
2b817e5590 Merge branch 'master' into new-block-api
# Conflicts:
#	src/main/java/net/minestom/server/tag/Tag.java
2021-06-22 03:09:02 +02:00
TheMode
b5c7106f9b Use the tag api inside Entity, deprecate DataContainer 2021-06-22 02:56:00 +02:00
TheMode
c2270f8922 Merge branch 'master' into new-block-api 2021-06-20 23:52:08 +02:00
TheMode
0be2addbd8 Remove most unnecessary uses of google common 2021-06-20 22:03:14 +02:00
TheMode
4db3b9317d Replace google Beta annotation to jetbrains ApiStatus.Experimental 2021-06-20 21:48:07 +02:00
TheMode
106125319a Remove get prefixes for protocol objects to be more record-friendly 2021-06-19 21:01:54 +02:00
TheMode
ddae239e30 Rename onTouch 2021-06-17 15:11:19 +02:00
TheMode
894b1a68a7 Make BlockHandler more flexible and future-proof for incoming amber language features 2021-06-17 14:34:55 +02:00
TheMode
de22a76e9f Merge branch 'master' into new-block-api
# Conflicts:
#	build.gradle
2021-06-17 13:58:01 +02:00
TheMode
84f22a6ed4 Replace float to double 2021-06-16 12:26:27 +02:00
Kieran Wallbanks
0ba27939d9 Implement new sound changes 2021-06-15 13:19:48 +01:00
TheMode
63004cf4ba Merge branch 'master' into new-block-api
# Conflicts:
#	src/main/java/net/minestom/server/event/player/PlayerBlockBreakEvent.java
#	src/main/java/net/minestom/server/event/player/PlayerBlockInteractEvent.java
#	src/main/java/net/minestom/server/event/player/PlayerBlockPlaceEvent.java
#	src/main/java/net/minestom/server/event/player/PlayerStartDiggingEvent.java
#	src/main/java/net/minestom/server/instance/Instance.java
#	src/main/java/net/minestom/server/instance/InstanceContainer.java
#	src/main/java/net/minestom/server/listener/BlockPlacementListener.java
#	src/main/java/net/minestom/server/listener/PlayerDiggingListener.java
#	src/test/java/demo/PlayerInit.java
2021-06-14 15:22:54 +02:00
TheMode
911c983957 Merge branch 'master' into event-api
# Conflicts:
#	src/main/java/net/minestom/server/entity/Player.java
#	src/main/java/net/minestom/server/event/player/UpdateTagListEvent.java
#	src/main/java/net/minestom/server/instance/Chunk.java
2021-06-14 00:11:41 +02:00
TheMode
342554cb36 Remove BlockHandler#drag 2021-06-12 15:06:52 +02:00
TheMode
ab51b50072 Use per-block handler 2021-06-12 13:57:59 +02:00
TheMode
94e92741c8 Reuse chunk code 2021-06-12 13:37:37 +02:00
TheMode
457ef9df17 Merge branch 'master' into new-block-api
# Conflicts:
#	src/autogenerated/java/net/minestom/server/instance/block/Block.java
#	src/main/java/net/minestom/server/MinecraftServer.java
#	src/main/java/net/minestom/server/entity/Player.java
#	src/main/java/net/minestom/server/entity/pathfinding/PFBlockDescription.java
#	src/main/java/net/minestom/server/entity/pathfinding/PFBlockObject.java
#	src/main/java/net/minestom/server/instance/Chunk.java
#	src/main/java/net/minestom/server/instance/palette/PaletteStorage.java
#	src/main/java/net/minestom/server/network/packet/server/play/ChunkDataPacket.java
#	src/main/java/net/minestom/server/network/packet/server/play/TagsPacket.java
2021-06-11 16:31:01 +02:00
TheMode
12a215349d Lazily add eventhandler node to root for backward compatibility 2021-06-09 08:31:06 +02:00
TheMode
25f1183a1b Remove EventNode#map 2021-06-04 21:12:27 +02:00
TheMode
d9b26f84d3 Keep using GlobalEventHandler 2021-06-04 04:54:07 +02:00
TheMode
c4d521cde5 All node should have a name 2021-06-04 04:10:13 +02:00
TheMode
d81df24132 Support old EventHandler API 2021-06-04 04:05:57 +02:00
TheMode
8b255651ab Call events using EventDispatcher 2021-06-04 03:48:51 +02:00
TheMode
6858690cc1 Use a static method to create the destroy entity packet 2021-05-31 18:53:57 +02:00
TheMode
17fc62632d Update most packets 2021-05-31 18:29:44 +02:00
TheMode
e62a837bf0 Added custom block drag support 2021-05-29 00:58:40 +02:00
TheMode
ba892ced05 Added BlockHandler#handleContact 2021-05-29 00:55:24 +02:00
Articdive
a95a89932e
Remove CustomBlock and fix some compiler errors. 2021-05-24 22:51:34 +02:00
TheMode
333825c032 Cleanup... 2021-05-23 00:28:31 +02:00
TheMode
9e2d8bc408 Fix view being reset after velocity application 2021-05-16 23:57:42 +02:00
Németh Noel
e3d31f113a Don't send scheduled sync to the player it self 2021-05-15 21:07:42 +02:00
Németh Noel
78937a6b0b Updated javadoc 2021-05-05 00:48:29 +02:00
Kieran Wallbanks
2fdfce703d Fix javadoc errors 2021-05-04 15:46:34 +01:00
Németh Noel
1b059c5981 Inverted and renamed method parameter 2021-05-04 01:19:33 +02:00
Németh Noel
818251331f Made #sendPositionUpdate(boolean) protected 2021-05-02 00:05:48 +02:00
Németh Noel
f4c55dd4b2 Fixed javadoc 2021-05-01 04:38:28 +02:00
Németh Noel
78dc2b32cd Removed isNettyClient field 2021-05-01 04:38:04 +02:00
Németh Noel
3abef8c9a7 Fix position update 2021-05-01 04:27:21 +02:00
Németh Noel
dbd0c302d5 Fix player unable to move 2021-05-01 04:00:25 +02:00
Németh Noel
66f1c8847d Extracted position sending from Entity#tick and improved checks, also removed duplicate code from Player#update 2021-05-01 02:21:11 +02:00
Németh Noel
998d0d6f5c Renamed method 2021-05-01 00:51:10 +02:00
Németh Noel
5e55c0199d Moved cloning back into methods 2021-05-01 00:34:04 +02:00
Németh Noel
ea368876af Merged Entity#sendSynchronization and Player#updatePlayerPosition to #sendTeleportPacket and increased scheduled sync delay 2021-05-01 00:05:49 +02:00
Németh Noel
fa8a499321 Merged individual position values to position fields 2021-04-30 23:01:43 +02:00
TheMode
b27e1fcf94 Added beta annotations 2021-04-26 14:53:47 +02:00
TheMode
c3f1b9159c Unchecked cast for acquirable getter 2021-04-26 12:52:02 +02:00
TheMode
845a8608db Simplify Acquirable, support for all objects 2021-04-24 18:14:12 +02:00
TheMode
db2550f9ab Merge branch 'master' into acquirable 2021-04-24 15:03:39 +02:00
TheMode
7d4e04bc66 Prevent potion effect filter when the list is empty 2021-04-24 15:03:27 +02:00
TheMode
cf38103621 Merge branch 'master' into acquirable 2021-04-23 23:50:14 +02:00
TheMode
a671de1e01 Change addViewer0/removeViewer0 access to protected 2021-04-23 21:06:47 +02:00
TheMode
cad488bb5d Override Player#getAcquirable 2021-04-23 11:51:14 +02:00
TheMode
c24cc07b7c Improve efficiency of entity chunk update 2021-04-23 10:17:42 +02:00
TheMode
297652c610 Remove generic Acquirable 2021-04-22 16:38:37 +02:00
TheMode
bd9cab5805 Remove AcquirableImpl.java, more comment 2021-04-18 16:50:06 +02:00
TheMode
23664292de Simplify acquisition, reduce overhead 2021-04-17 14:22:47 +02:00
TheMode
11b1bbea2e Update entities thread 2021-04-15 01:44:08 +02:00
TheMode
c1b278f4b9 Fix merge, remove unnecessary methods (for now)
Signed-off-by: TheMode <themode@outlook.fr>
2021-04-14 20:09:49 +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
adfb487140 Fix entity currentChunk being null 2021-04-12 04:50:45 +02:00
TheMode
3b37987f15 Remove dead line 2021-04-11 14:55:27 +02:00
TheMode
032343011a Reduce map lookup when looping through surrounding custom blocks 2021-04-10 22:03:03 +02:00
TheMode
f5a21948c6 Reduce chunk lookup when switching 2021-04-10 21:57:33 +02:00
TheMode
c74946cc3c Cache entity current chunk 2021-04-10 21:42:45 +02:00
TheMode
aaab620839 Reduce entity movement overhead (chunk lookup) 2021-04-10 21:21:37 +02:00
TheMode
4c495f401d Code cleanup 2021-04-07 18:35:19 +02:00
themode
d332855bc4 Renamed CooldownUtils to Cooldown 2021-03-31 19:17:37 +02:00
themode
66ab1bb53d Prevent Check#notNull from concatenating strings unnecessarily 2021-03-26 22:23:41 +01:00
themode
705f419f9d Rename some internal-only methods 2021-03-26 21:31:57 +01:00
themode
55626738e2 Style cleanup 2021-03-26 21:26:35 +01:00
Kieran Wallbanks
6dd3eb8044 Implement HoverSource for ItemStack, Entity and Player 2021-03-26 17:34:38 +00:00
Kieran Wallbanks
522367dd78 Begin removing deprecated usages 2021-03-26 17:34:38 +00:00
themode
6db1c34c50 Remove mention of deprecated class 2021-03-26 11:25:03 +01:00
themode
c92a7873db Only send velocity packet in #addViewer if required 2021-03-26 09:04:28 +01:00
themode
169dbedea2 Fix entity head position, improve performance for Player#addViewer0 2021-03-22 14:54:52 +01:00
Eoghanmc22
8975161edb use a ConcurrentHashMap key set instead of a CopyOnWriteArraySet for viewers so .contains() is O(1) 2021-03-19 22:50:28 -04:00
themode
c960bb297b Remove unnecessary condition, prevent double chunk refresh 2021-03-16 05:16:11 +01:00
themode
3ecace5bd6 Introduce the Tickable interface 2021-03-11 20:54:30 +01:00
themode
c253a27260 Added copy to clipboard message click event 2021-03-05 14:30:50 +01:00
themode
55179082e9 Remove final methods 2021-03-04 23:06:29 +01:00
themode
7c505ecc17 Do not deprecate Entity#setInstance 2021-03-04 16:43:10 +01:00
themode
25c2dc661f Fix position yaw/pitch not being copied 2021-03-02 19:36:11 +01:00
TheMode
29a8542d3e
Merge pull request #129 from Minestom/improve-extension-system
Improve extension system
2021-03-02 18:22:21 +01:00
Konstantin Shandurenko
1ae2cf78af Added support of custom entity position synchronization cooldown 2021-03-01 13:09:08 +03:00
themode
e8e8022ec6 Fix pathfinding + cleanup 2021-02-25 15:48:48 +01:00
themode
7da3a16978 Fix connection loop 2021-02-25 15:35:31 +01:00
Konstantin Shandurenko
6192d1fead removed duplicating code piece 2021-02-25 14:40:14 +03: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
3c5b76c0a8 Tiny improvement for Entity#switchEntityType 2021-02-25 13:39:22 +03:00
Konstantin Shandurenko
8ca43c4caa Entity is not abstract anymore 2021-02-25 13:00:02 +03:00
Konstantin Shandurenko
83c5d3c95f Marked Entity#getEntityType as NotNull 2021-02-25 10:38:53 +03:00
Konstantin Shandurenko
18da3e0168 Moved switchEntityType from EntityCreature to Entity 2021-02-25 10:37:02 +03:00
Konstantin Shandurenko
ca6546eb7d Removed obsolete metadata type values inside Entity 2021-02-25 10:00:29 +03:00
Konstantin Shandurenko
7db7dab4b9 EntitySpawnType initial commit 2021-02-25 08:59:55 +03:00
Konstantin Shandurenko
3f941d51bb Fixed initial BoundingBox of Pufferfish 2021-02-23 20:04:30 +03:00
Konstantin Shandurenko
6e950ab170 BaseEntityMeta is now an EntityMeta 2021-02-23 19:18:53 +03:00
Konstantin Shandurenko
692dcfed4c Setting default entity BoundingBox from EntityType data 2021-02-23 18:41:24 +03:00
Konstantin Shandurenko
bbe143520e A bit more changes to EntityMeta 2021-02-23 18:37:00 +03:00
Konstantin Shandurenko
0915858df3 Meta wrappers for all the entities 2021-02-23 15:11:10 +03:00
TheMode
71f1e51df3
Merge pull request #146 from RinesThaix/goals
Arrows and RangedAttackGoal
2021-02-22 13:58:43 +01:00
Konstantin Shandurenko
dbfebc50ec Block collisions for arrows 2021-02-22 14:42:46 +03:00
Konstantin Shandurenko
3c8824c7b0 RangedAttackGoal implementation initial commit 2021-02-22 08:46:37 +03:00
themode
77148338b9 Added Entity#clearEffects 2021-02-22 06:00:49 +01:00
jglrxavpok
eadd4a2b39 Automatically unload GlobalEventHandler callbacks 2021-02-03 17:11:06 +01:00
themode
3026e46220 Added new metadata API 2021-01-30 04:44:44 +01:00
themode
e0c8e94bc1 Limit the number of velocity packet used for entities 2021-01-27 19:35:53 +01:00
themode
9775262c6a Fix velocity for netty clients 2021-01-27 19:20:52 +01:00
themode
0da4f96e7e Allow gravity values to be doubles 2021-01-25 21:30:56 +01:00
themode
5f75ea7d3a Remove unnecessary casts 2021-01-25 19:33:53 +01:00
themode
c01736f863 Use doubles instead of floats to represent Position and Vector 2021-01-25 13:47:13 +01:00
Tyan
7d7c65aa70 Set the last location at the end of refreshPosition 2021-01-23 15:51:07 +01:00
themode
bf692d8043 Clone the teleport position to prevent object sharing 2021-01-23 08:42:49 +01:00
themode
36933fe4b3 Ensure synchronization of the location field 2021-01-23 08:23:24 +01:00
LeoDog896
3536bdc856 Microoptimization cleanup
Just some small microoptimizations including preferring fastutils, Removing unnecessary checks already dealt with using @NotNull, all since I had extra unplanned free time.
2021-01-15 11:08:11 -05:00
KrystilizeNevaDies
7bc1f37e80 Add a direct way to set the bounding box in Entity 2021-01-13 21:57:55 +10:00
themode
29c8f924fa Added missing metadata types 2021-01-11 21:21:19 +01:00
themode
c5d56ae820 Small velocity code cleanup 2021-01-11 08:44:38 +01:00
themode
6b39cb1e32 Execute the async login event before sending the login success packet 2021-01-06 19:02:35 +01:00
themode
7019b7da85 Fix onGround field and gravityTickCount 2021-01-04 03:04:45 +01:00