From 1b6d57377e9286b8c091cdd11811f663c618d9ba Mon Sep 17 00:00:00 2001 From: Yanbing Zhao Date: Thu, 23 Aug 2018 02:52:12 +0800 Subject: [PATCH] Let the event implementation inherit AbstractEvent to make sponge happy --- .../VirtualChestInventoryDispatcher.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/com/github/ustc_zzzz/virtualchest/inventory/VirtualChestInventoryDispatcher.java b/src/com/github/ustc_zzzz/virtualchest/inventory/VirtualChestInventoryDispatcher.java index 7658c2d..990fede 100644 --- a/src/com/github/ustc_zzzz/virtualchest/inventory/VirtualChestInventoryDispatcher.java +++ b/src/com/github/ustc_zzzz/virtualchest/inventory/VirtualChestInventoryDispatcher.java @@ -17,6 +17,7 @@ import org.spongepowered.api.asset.AssetManager; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.event.cause.Cause; +import org.spongepowered.api.event.impl.AbstractEvent; import org.spongepowered.api.item.inventory.Container; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.util.Tuple; @@ -183,26 +184,7 @@ private boolean isInventoryOpening(Player player, String id, Tuple newInventories) @@ -239,4 +221,25 @@ private Map scanDir(File file) } return newInventories; } + + private class LoadEvent extends AbstractEvent implements VirtualChest.LoadEvent + { + @Override + public void unregister(String identifier) + { + inventories.remove(identifier); + } + + @Override + public void register(String identifier, VirtualChest chest) + { + inventories.put(identifier, chest); + } + + @Override + public Cause getCause() + { + return SpongeUnimplemented.createCause(plugin); + } + } }