Search in sources :

Example 1 with ItemInteractBlockingListener

use of com.skelril.skree.content.itemrestriction.ItemInteractBlockingListener in project Skree by Skelril.

the class ItemRestrictionSystem method init.

@NModuleTrigger(trigger = "SERVER_STARTED")
public void init() {
    try {
        ItemRestrictionConfig config = ConfigLoader.loadConfig("item_restriction.json", ItemRestrictionConfig.class);
        Set<String> blockedItems = config.getBlockedItems();
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ItemCraftBlockingListener(blockedItems));
        Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new ItemInteractBlockingListener(blockedItems));
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ItemInteractBlockingListener(com.skelril.skree.content.itemrestriction.ItemInteractBlockingListener) IOException(java.io.IOException) ItemCraftBlockingListener(com.skelril.skree.content.itemrestriction.ItemCraftBlockingListener) NModuleTrigger(com.skelril.nitro.module.NModuleTrigger)

Aggregations

NModuleTrigger (com.skelril.nitro.module.NModuleTrigger)1 ItemCraftBlockingListener (com.skelril.skree.content.itemrestriction.ItemCraftBlockingListener)1 ItemInteractBlockingListener (com.skelril.skree.content.itemrestriction.ItemInteractBlockingListener)1 IOException (java.io.IOException)1