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); + } + } }