Search in sources :

Example 1 with InventoryEventArgs

use of org.spongepowered.common.item.inventory.observer.InventoryEventArgs in project SpongeCommon by SpongePowered.

the class AbstractLens method addChild.

protected void addChild(Lens<TInventory, TStack> lens, InventoryProperty<?, ?>... properties) {
    checkNotNull(lens, "Attempted to register a null lens");
    this.children.add(lens, properties);
    this.availableSlots.addAll(lens.getSlots());
    if (lens instanceof ObservableLens) {
        ((ObservableLens<TInventory, TStack>) lens).addObserver(this);
    }
    this.raise(new InventoryEventArgs(Type.LENS_ADDED, this));
}
Also used : InventoryEventArgs(org.spongepowered.common.item.inventory.observer.InventoryEventArgs)

Aggregations

InventoryEventArgs (org.spongepowered.common.item.inventory.observer.InventoryEventArgs)1