Commit Graph

422 Commits

Author SHA1 Message Date
TheMode
77f74bb7dc Introduce EventNode 2021-06-02 08:17:21 +02:00
TheMode
2d8474282b Made Event an interface 2021-06-02 08:17:03 +02:00
TheMode
9c87b4d54f Add EventTrait interface 2021-06-02 07:15:28 +02:00
TheMode
02fe4c65a2 Use traits for events 2021-06-02 07:09:15 +02:00
TheMode
047d4a92ac Merge branch 'master' into event-api 2021-06-02 06:41:42 +02:00
TheMode
36d2834b18 Remove unnecessary block manager reference 2021-05-25 04:44:11 +02:00
TheMode
47c7e36b1d Fix remaining errors 2021-05-24 23:39:22 +02:00
TheMode
b15422f406 More error fix 2021-05-24 22:00:18 +02:00
TheMode
86f7fa7e27 Fix more errors 2021-05-24 21:39:30 +02:00
TheMode
c4b3e40225
Merge pull request #282 from Bloepiloepi/equipment-improvements
Equipment improvements
2021-05-16 11:55:04 +02:00
TheMode
d31fe2d88e
Merge pull request #229 from Project-Cepi/better-catching
Better catching for events/commands
2021-05-15 22:51:20 +02:00
R0bbyYT
cd988f1271 Reset flying with elytra when the player is on the ground 2021-05-14 19:02:22 +02:00
R0bbyYT
34d428be10 Start with the elytra implementation 2021-05-14 18:35:09 +02:00
TheMode
36942708bb Introduce EventGroup 2021-05-13 09:11:02 +02:00
Arne Dalhuisen
00278881ee Revert "Made EntityEquipEvent cancellable"
This reverts commit d72fb72e
2021-05-11 20:11:56 +02:00
Arne Dalhuisen
d72fb72e74 Made EntityEquipEvent cancellable 2021-05-11 17:05:16 +02:00
Arne Dalhuisen
ed010ff110 Renamed armorItem to equippedItem in EntityEquipEvent 2021-05-11 14:48:52 +02:00
Arne Dalhuisen
77ef5f7d42 Made EntityEquipEvent, replacing ArmorEquipEvent 2021-05-11 14:45:14 +02:00
TheMode
920a36399f Merge branch 'master' into event-api 2021-05-11 04:53:03 +02:00
TheMode
3cb7cdaea8 Create EventListener class 2021-05-11 04:52:57 +02:00
Kieran Wallbanks
42933e58b0 Minor formatting and javadoc changes 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
ec5ecb49bf Update javadoc 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
01fe452783 Implement OpenToLAN system 2021-05-05 16:18:11 +01:00
Kieran Wallbanks
a15e3aef44 Make legacy server pings use the ServerListPingEvent 2021-05-05 16:18:11 +01:00
TheMode
4012b6d0bd Use a predicate instead of boolean function 2021-05-04 23:26:51 +02:00
TheMode
e45c60c225 Initial revamped event listening API 2021-05-04 00:46:18 +02:00
TheMode
b066b6029a
Merge pull request #223 from thiccaxe/master
Add events for STATUS packets.
2021-04-15 07:10:32 +02:00
TheMode
6ba336ee73 Added hand inside eat events 2021-04-13 22:59:40 +02:00
TheMode
8e9d7098e5 Allow custom transaction type, simplify inventory superclasses 2021-04-12 00:33:27 +02:00
thiccaxe
c451d46ce0 document ServerListPingEvent 2021-04-11 10:30:47 -07:00
thiccaxe
8a9abff98b Remove Duplicate Code; unlinking ResponseData & ServerListPingEvent
Removed code that would cause maintaining more difficult after an update in ResponseData, and additionally PlayerConnection

Updated demo to reflect changes.
2021-04-10 21:14:36 -07:00
thiccaxe
b086dc82ca Remove extra code in FakePlayerConnection, add refershServerInformation back 2021-04-08 18:20:23 -07:00
thiccaxe
94c4ec79e1 simplify data storage, fix annotations
Removed HandshakeData  - too excessive

Added abstract methods in PlayerConnection as replacement

in FakePlayerConnection setters do nothing and Getters return MinecraftServer defaults
2021-04-08 16:51:50 -07:00
thiccaxe
cad128a393 update demo to show example
may be cut down later as it is very excessive.
2021-04-08 14:41:22 -07:00
thiccaxe
cd27d1d6c7 ServerListPingEvent
An implementation of what could be done to make this event - not perfect in my opinion.
2021-04-08 14:19:32 -07:00
TheMode
4c495f401d Code cleanup 2021-04-07 18:35:19 +02:00
LeoDog896
5e4af20992 And handle event exceptions 2021-04-06 22:29:24 -04:00
TheMode
2606f2b291 Added PlayerChatEvent#getDefaultChatFormat 2021-04-07 02:47:19 +02:00
thiccaxe
159ff3f646 Remove reprecated code
Removed deprecated code,
Added missing code,
Optimized imports.
2021-04-05 09:57:18 -07:00
thiccaxe
02982c0ee2 Shortcut methods in StatusRequestEvent 2021-04-04 18:52:55 -07:00
thiccaxe
7c0fcadd4f Add HandshakeEvent 2021-04-04 16:26:58 -07:00
thiccaxe
cf4a8756ef StatusRequestEvent
Added basic event

notes:
 - minestom will only accept the 1.16.5 protocol version, as of now there is no way to get the protocol version from the event. Assume 1.16.5

- there is also no way to currently get the address the client used to ping the server, as that is sent in another packet and minestom does not currently pass that data through.

 - favicon appears to not be working
2021-04-04 15:43:19 -07:00
Kieran Wallbanks
522367dd78 Begin removing deprecated usages 2021-03-26 17:34:38 +00:00
themode
d6683932c8 Added PickupItemEvent#getItemEntity 2021-03-12 20:59:47 +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
de15c4b6c5 Rewriting projectiles 2021-03-01 12:59:16 +03:00
Kieran Wallbanks
a3f388a88b Add events for player sneaking and sprinting changes 2021-02-22 16:36:40 +00:00
themode
549eb6b6e1 Fix javadoc 2021-02-22 14:02:33 +01:00
Konstantin Shandurenko
dbd0e472c2 Added power param for projectiles shooting 2021-02-22 15:54:35 +03:00
Konstantin Shandurenko
3a251934ec Projectiles shooting 2021-02-22 09:45:19 +03:00
jglrxavpok
ee158c0dea Use Nullable string instead of Optional in MinestomRootClassLoader#findExtensionObjectOwner 2021-02-04 11:57:43 +01:00
jglrxavpok
a63e9462c2 All EventHandler remove extension callback when the extension unloads 2021-02-03 20:47:01 +01:00
jglrxavpok
c8e311855f Auto-unschedule and cancel tasks from extensions 2021-02-03 17:51:14 +01:00
jglrxavpok
4f39498ef5 Remove debug code no longer relevant 2021-02-03 17:12:20 +01:00
jglrxavpok
eadd4a2b39 Automatically unload GlobalEventHandler callbacks 2021-02-03 17:11:06 +01:00
themode
66817eb9c4 Fixed Team#removeMember 2021-01-29 00:02:43 +01:00
themode
edd880ceb6 Allow to update both the block state and custom ids using PlayerBlockBreakEvent#setResultCustomBlock 2021-01-28 22:53:02 +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
23e70208a8
Fix EntityDamageEvent not being cancellable 2021-01-10 14:18:16 +10:00
themode
7c5bb7126a Added PlayerBlockPlaceEvent#setBlockData 2021-01-07 16:12:56 +01:00
themode
deb8cab03a Remove unnecessary checks 2021-01-06 18:01:39 +01:00
themode
317432460e Entity cleanup 2021-01-03 00:23:41 +01:00
ThatCreeper
30be7b5b81 Add Potion Add and Remove events 2021-01-02 16:59:17 -06:00
Matt Worzala
46ac38d5b3
Change ColoredText usages to JsonMessage 2020-12-31 13:53:21 -05:00
themode
28c5e39f8b Pre login event is now async 2020-12-27 22:16:19 +01:00
themode
978a1f5135 PlayerChatEvent function should return a JsonMessage and not necessarily a RichMessage 2020-12-23 08:24:29 +01:00
themode
b5feb35619 Added PlayerDeathEvent to change the death message/text 2020-12-22 05:26:37 +01:00
themode
ffbde089f8 BlockPlacementRule cleanup 2020-12-20 03:24:29 +01:00
themode
5224eecdd1 Event unification (type-specific event, CancellableEvent is now an interface) 2020-12-16 03:21:59 +01:00
KrystilizeNevaDies
8a2e69f709 Change PlayerSpawnEvent too use player instead of entity 2020-12-14 12:52:51 +10:00
Felix Cravic
2f96a47270 Optimise GlobalEventHandler 2020-12-11 19:37:44 +01:00
Felix Cravic
ac8ba3ab10 Fixed ItemDropEvent and PickupItemEvent constructor + changed PlayerInit event registration to use the global event handler 2020-12-11 04:34:08 +01:00
Felix Cravic
54d3a6bace fixed GlobalEventHandler getter name 2020-12-09 22:36:15 +01:00
Felix Cravic
6e3df970fa Added GlobalEventHandler 2020-12-09 22:31:20 +01:00
Felix Cravic
30d257c847 Remove unnecessary #callEvent override in Entity 2020-12-09 22:18:11 +01:00
Felix Cravic
08f7b1c715 Event callback collections now use a set, and #add/removeCallback return a boolean to know if the action was successful 2020-12-09 22:05:11 +01:00
Felix Cravic
eca6a657c3 Execute InstanceTickEvent in Instance instead of InstanceContainer 2020-12-08 00:16:46 +01:00
KrystilizeNevaDies
061c1600e7 Annotation and type fix
Just clean up annotations on primatives and instance v InstanceContainer
2020-12-08 09:12:42 +10:00
KrystilizeNevaDies
e8e30b1328 Fix first tick call 2020-12-08 07:52:46 +10:00
KrystilizeNevaDies
6cc8946963 Add instance tick event 2020-12-08 07:30:14 +10:00
Felix Cravic
181f20289c Cleanup for the sound code, and comment for PlayerLoginEvent about not working player methods 2020-12-02 14:36:54 +01:00
themode
f30330c59b Added PlayerStartDiggingEvent warning 2020-11-18 13:22:23 +01:00
themode
ae8a182eb8 Read player skin from velocity 2020-11-14 22:13:01 +01:00
themode
1d1e82aeb3 Prevent infinite load screen when not teleporting the player on spawning 2020-11-14 21:45:30 +01:00
themode
463e1f047f Cleanup + added PlayerSettingsChangeEvent 2020-11-01 00:07:15 +01:00
themode
f328a9cb2b Added a few constructors to specify the instance directly 2020-10-31 01:38:57 +01:00
themode
872dccd7ce Small cleanup 2020-10-29 22:52:07 +01:00
themode
27e0b86cb5 Added annotations for all events 2020-10-24 16:33:13 +02:00
themode
2f21a7c233 More annotations. 2020-10-24 11:19:54 +02:00
themode
34e7bfe69d Reduces the number of ItemStack#clone calls in inventory clicks 2020-10-22 19:18:08 +02:00
themode
3cb880cf80 General cleanup 2020-10-22 12:55:53 +02:00
themode
47677766ca Improvement for the DamageType code 2020-10-22 12:21:50 +02:00
themode
b2e3d3e78d Use negative entity id for the custom breaking system 2020-10-19 11:56:26 +02:00
themode
660a67e53e English fix 2020-10-15 21:16:31 +02:00
themode
0e5831cdc3 Cleanup + typo fix 2020-10-13 12:49:29 +02:00
themode
cbe2a0b71e Comments 2020-10-12 02:56:30 +02:00
themode
5f7261cd6e Comments 2020-10-11 18:35:32 +02:00
themode
739c3f1d7d Allow non-custom block in PlayerStartDiggingEvent 2020-10-10 13:46:41 +02:00
themode
dd3345ff9a ColoredText comments + cleanup 2020-10-06 07:41:35 +02:00
themode
a757f4b97b Simplify EventHandler implementation 2020-10-06 04:06:59 +02:00
themode
3464d27ab1 Added entity in EntitySpawnEvent 2020-09-26 21:24:10 +02:00
themode
5620e9a8cf Cleanup 2020-09-24 01:50:25 +02:00
themode
403e0c897f Added EventHandler#getEventCallbacks 2020-09-20 20:11:46 +02:00
jglrxavpok
b6fc3ee978 Publish with Javadoc & Sources 2020-09-20 15:04:07 +02:00
themode
e2940c9aee Renamed CustomBlock#getBlockStateId to CustomBlock#getDefaultBlockStateId 2020-09-06 03:15:00 +02:00
themode
8b30caa8c8 Micro optimization + cleanup 2020-08-19 01:24:51 +02:00
Felix Cravic
67db1d6568 Replaced blockId by blockStateId 2020-08-09 09:55:30 +02:00
Felix Cravic
45fd0dc22a Comments 2020-08-07 09:14:50 +02:00
Felix Cravic
2ab7427b94 Added AdvancementTabEvent 2020-08-05 11:34:49 +02:00
Felix Cravic
baccc36ed7 Allow ask_server tab complete for CommandProcessor 2020-08-04 04:21:11 +02:00
razorrider7
a09b217962 Update EntityType To use Namespaced IDs 2020-08-03 18:48:46 -04:00
Felix Cravic
98c3419766 Cleanup 2020-07-27 02:28:03 +02:00
Felix Cravic
71b2988583 Added AnimationEvent comments + cleanup 2020-07-26 20:03:39 +02:00
Felix Cravic
4f788b9b8d Cleanup 2020-07-24 16:11:48 +02:00
Felix Cravic
5c1e6e7572 Cleanup 2020-07-23 07:36:49 +02:00
jglrxavpok
54c4134006 BlockFace added to PlayerBlockInteractEvent 2020-07-18 17:45:56 +02:00
Felix Cravic
d96e06dfe2 Added InstanceChunkLoadEvent and InstanceChunkUnloadEvent 2020-07-01 15:51:00 +02:00
jglrxavpok
2303b98024 Send tags to player on connection 2020-06-30 20:38:42 +02:00
Felix Cravic
19fc90e764 Fixed Held packet + replaced the short by a byte 2020-06-23 18:09:01 +02:00
Felix Cravic
b47efa35ca Added PlayerChangeHeldSlotEvent 2020-06-23 17:50:43 +02:00
Felix Cravic
f892213e8c Added a new Chat API 2020-06-22 23:25:00 +02:00
Felix Cravic
889b1fe095 Renamed PlayerInteractEvent to PlayerEntityInteractEvent 2020-06-21 23:44:20 +02:00
Felix Cravic
72234ac706 Added PlayerPreLoginEvent 2020-06-21 22:11:56 +02:00
Felix Cravic
2ee93bd7cb Fixed EntityItemMergeEvent constructor 2020-06-02 14:55:18 +02:00
Felix Cravic
bd08676525 Added EntityItemMergeEvent#setResult 2020-06-02 14:54:33 +02:00
Felix Cravic
45e8ba2f03 Added EventHandler#removeEventCallback 2020-06-01 17:11:43 +02:00
Felix Cravic
7e20278dd9 Fix deadlock with ItemEntity + added ItemEntity#getMergeUpdateOption to mitigate CPU usage increase 2020-06-01 00:51:31 +02:00
Felix Cravic
ea034701f8 Added PlayerSetItemStackEvent#setSlot + some checks 2020-05-31 21:37:40 +02:00
Felix Cravic
633d02222a Added PlayerAddItemStackEvent and PlayerSetItemStackEvent 2020-05-31 21:30:46 +02:00
Felix Cravic
c17aba4ac7 Added Player#setResourcePack + PlayerResourcePackStatusEvent 2020-05-31 19:53:59 +02:00
Felix Cravic
eed946e948 Cleanup 2020-05-31 15:52:56 +02:00
Felix Cravic
1bcd0c474f Added event comments 2020-05-30 22:32:12 +02:00
Felix Cravic
7ce6f7ada1 Added Player#setSkin and PlayerSkinInitEvent to modify it at initialization 2020-05-30 19:47:47 +02:00
Felix Cravic
1343a66681 Added player in inventory events + comments 2020-05-30 14:58:00 +02:00
Felix Cravic
068a0889c8 More PlayerBlockPlaceEvent methods + comments 2020-05-28 21:51:14 +02:00
Felix Cravic
5e91b75d78 Comments 2020-05-28 19:15:55 +02:00
Felix Cravic
dbf58f2234 Comments + more PlayerBlockBreakEvent information 2020-05-28 15:08:18 +02:00
Felix Cravic
ef261c1792 Added WorldBorder#isInside + physics now support world border 2020-05-27 01:04:39 +02:00
Felix Cravic
3be1173ab5 Small optimizations 2020-05-26 20:00:41 +02:00
Felix Cravic
fc751acb75 Added EntityArmorStand & Hologram 2020-05-26 00:07:35 +02:00
Felix Cravic
e26ee1380a Fixed vehicles + added PlayerStartFlyingEvent & PlayerStopFlyingEvent 2020-05-24 22:21:38 +02:00
Felix Cravic
97bd1ecdb1 Cleanup 2020-05-23 04:20:01 +02:00
Felix Cravic
c50030cd6b Allow for separate blocks in PlayerBlockBreakEvent 2020-05-17 15:52:49 +02:00
Felix Cravic
b97b75f13c Added a lot of comments 2020-05-15 18:03:28 +02:00
Felix Cravic
aeeb9f08a4 Added EntityVelocityEvent + minor refactoring 2020-05-14 18:57:44 +02:00
Felix Cravic
be0311a874 Added PlayerPreEatEvent for more customisation, separate the default eating time and the individual ones. Also a InventoryOpenEvent#setInventory to change the inventory to open 2020-05-12 18:40:04 +02:00
Felix Cravic
a1b427bf83 Added InventoryOpenEvent 2020-05-12 17:12:11 +02:00
Felix Cravic
37add239f8 Custom food animation delay + PlayerEatEvent 2020-05-12 14:12:17 +02:00
Felix Cravic
889e9c5e2b ItemEntity can now be merged/stacked together 2020-05-09 21:50:48 +02:00
Felix Cravic
17856c36cf Fixed crash at player disconnection 2020-05-09 20:00:59 +02:00
Felix Cravic
f7badc021b WIP entities in unloaded chunk + PlayerChunkLoadEvent 2020-05-09 18:24:14 +02:00
Felix Cravic
39f0053ded Added PlayerChunkUnloadEvent 2020-05-09 04:05:57 +02:00
jglrxavpok
8281f1c0fd Added isFirstSpawn() to PlayerSpawnEvent 2020-05-08 18:03:39 +02:00
Felix Cravic
3741b22484 Added EventHandler interface 2020-05-08 06:54:33 +02:00
jglrxavpok
0daae4d831 EntityTickEvent and tick counter in Entity 2020-05-07 16:00:52 +02:00
jglrxavpok
9d9c158af0 Added event callbacks to Instance, and organized events into packages 2020-05-07 15:46:21 +02:00
Felix Cravic
59214b3b96 All LivingEntity can now have equipments + cleanup 2020-05-06 22:35:32 +02:00
TheMode
ca7e220543
Merge pull request #5 from Draycia/master
Replace minecraft-text with kyori-text
2020-05-05 21:06:44 +02:00
Felix Cravic
5de6888b59 Added EntityFireEvent and EntitySpawnEvent 2020-05-05 21:04:05 +02:00
Draycia
5b97dde21f Merge remote-tracking branch 'upstream/master' 2020-05-03 23:55:44 -07:00
jglrxavpok
05acfdf59f New event for when an item is used on a block 2020-05-03 22:44:38 +02:00
Draycia
83bb14d5a0 Use kyori/text instead of minecraft-text 2020-05-03 04:59:53 -07:00
Felix Cravic
cd181929c6 Fix inventory click, proper separation between Inventory & PlayerInventory for events and conditions (+ InventoryPreClickEvent and InventoryClickEvent) 2020-05-02 18:45:34 +02:00
Felix Cravic
c2af4be2fa Can now define an inventory to open after closing another + added a bunch of inventory type 2020-04-29 17:27:58 +02:00
Felix Cravic
0782ee7fe5 Added the InventoryCloseEvent event 2020-04-29 12:11:13 +02:00
jglrxavpok
54111ece6a Convenience method to find horizontal Direction based on yaw, easier block properties usage and PlayerBlockPlaceEvent now references the player placing the block 2020-04-28 21:52:06 +02:00
jglrxavpok
85da9203b1 Custom blocks can block item interaction, prevents blocks being placed when opening containers 2020-04-28 18:12:06 +02:00
jglrxavpok
f8f649852b Allow PlayerBlockPlaceEvent callbacks to change the block placed.
Can be used to place custom blocks in replacement of normal ones.
2020-04-28 13:47:41 +02:00
Felix Cravic
48c4941813 We can now have multiple listeners 2020-04-28 01:20:11 +02:00
Felix Cravic
bf795c1442 Added EntityDamageEvent 2020-04-27 22:38:11 +02:00
Felix Cravic
2f6205b577 Added ItemUpdateStateEvent + batch file clean 2020-04-24 17:43:35 +02:00
Felix Cravic
7daac5e610 Package rename to net.minestom.server 2020-04-24 03:25:58 +02:00