简体   繁体   English

“Spigot / Bukkit”的Event-API是如何工作的?

[英]How does the Event-API of “Spigot / Bukkit” work?

Iam trying to understand, how object-oriented programming in Java works.我试图了解 Java 中的面向对象编程是如何工作的。 Herefor I thougth the Spigot-API would be a very nice example.因此,我认为 Spigot-API 将是一个很好的例子。

For everyone, who doesnt know spigot : Its an API for making minecraft plugins.对于每个不知道 spigot 的人:它是一个用于制作 minecraft 插件的 API。

I reached the point, where I understood quite a few things, but now I´m stuck on "Eventlistener".我到了这一点,在那里我理解了很多东西,但现在我被困在“Eventlistener”上。 There is an Event-API in Spigot for this : https://www.spigotmc.org/wiki/using-the-event-api/ Spigot 中有一个事件 API: https : //www.spigotmc.org/wiki/using-the-event-api/

This page explains how to use listeners.本页介绍了如何使用侦听器。 But how is it possible, to implement an whole Interface without all methods and not to use the @Override annotation ?但是怎么可能,实现了整个界面没有所有的方法和使用@Override注释?

It's an interface to tag all listeners.它是一个标记所有侦听器的接口。

It doesn't contain any methods so there is nothing to override.它不包含任何方法,所以没有什么可以覆盖的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM