User Tools

Site Tools


tutorial:events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:events [2020/02/17 18:36]
jamieswhiteshirt Fix indentation
tutorial:events [2020/03/29 15:46] (current)
jamieswhiteshirt event -> listener. Highly misleading name, the listener is not an event
Line 20: Line 20:
     Event<​SheepShearCallback>​ EVENT = EventFactory.createArrayBacked(SheepShearCallback.class,​     Event<​SheepShearCallback>​ EVENT = EventFactory.createArrayBacked(SheepShearCallback.class,​
         (listeners) -> (player, sheep) -> {         (listeners) -> (player, sheep) -> {
-            for (SheepShearCallback ​event : listeners) { +            for (SheepShearCallback ​listener ​: listeners) { 
-                ActionResult result = event.interact(player,​ sheep);+                ActionResult result = listener.interact(player,​ sheep);
                 if(result != ActionResult.PASS) {                 if(result != ActionResult.PASS) {
                     return result;                     return result;
tutorial/events.1581964565.txt.gz · Last modified: 2020/02/17 18:36 by jamieswhiteshirt