From fbb1f012e24e7967e2b3d14486a0ca0b9b3c0310 Mon Sep 17 00:00:00 2001 From: iczero Date: Sun, 10 Nov 2019 10:15:52 -0500 Subject: [PATCH] Add item and amount properties to DepositEvent (#1025) --- core/src/io/anuke/mindustry/game/EventType.java | 6 +++++- core/src/io/anuke/mindustry/input/InputHandler.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/io/anuke/mindustry/game/EventType.java b/core/src/io/anuke/mindustry/game/EventType.java index 43f5010e30..567a4a706f 100644 --- a/core/src/io/anuke/mindustry/game/EventType.java +++ b/core/src/io/anuke/mindustry/game/EventType.java @@ -135,10 +135,14 @@ public class EventType{ public static class DepositEvent{ public final Tile tile; public final Player player; + public final Item item; + public final int amount; - public DepositEvent(Tile tile, Player player){ + public DepositEvent(Tile tile, Player player, Item item, int amount){ this.tile = tile; this.player = player; + this.item = item; + this.amount = amount; } } diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index d5aea01231..ca104342c1 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -111,7 +111,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ int[] remaining = {accepted, accepted}; Block block = tile.block(); - Core.app.post(() -> Events.fire(new DepositEvent(tile, player))); + Core.app.post(() -> Events.fire(new DepositEvent(tile, player, item, accepted))); for(int i = 0; i < sent; i++){ boolean end = i == sent - 1;