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

huangapple go评论55阅读模式
英文:

How does the Event-API of "Spigot / Bukkit" work?

问题

我正在尝试理解Java中的面向对象编程是如何工作的。为此,我认为Spigot-API会是一个非常好的示例。

对于那些不了解Spigot的人:它是用于制作Minecraft插件的API。

我已经达到了一个点,我理解了很多东西,但现在我卡在了“事件监听器”上。Spigot中有一个事件API,可以在这里找到:https://www.spigotmc.org/wiki/using-the-event-api/

这个页面解释了如何使用监听器。但是,如何能够实现一个完整的接口而不必实现所有方法,并且使用*@Override*注释呢?

英文:

Iam trying to understand, how object-oriented programming in Java works. Herefor I thougth the Spigot-API would be a very nice example.

For everyone, who doesnt know spigot : Its an API for making minecraft plugins.

I reached the point, where I understood quite a few things, but now I´m stuck on "Eventlistener". There is an Event-API in Spigot for this : 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 ?

答案1

得分: 0

这是一个用于标记所有监听器的接口。

它不包含任何方法,因此没有需要覆盖的内容。

英文:

It's an interface to tag all listeners.

It doesn't contain any methods so there is nothing to override.

huangapple
  • 本文由 发表于 2020年8月27日 16:18:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/63611894.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定