Skip to content

Commit

Permalink
Add LWC magnet pull listener
Browse files Browse the repository at this point in the history
Needs Hidendra/LWC#942 (for LWC Entity Locking it needs megoesrawr/LWCEntityLocking#6) to be merged
  • Loading branch information
EpicEricEE committed Apr 14, 2016
1 parent 6d747f6 commit 9687e4a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/de/epiceric/shopchest/ShopChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import org.bukkit.plugin.java.JavaPlugin;
import com.griefcraft.lwc.LWC;
import com.griefcraft.lwc.LWCPlugin;
import com.griefcraft.scripting.JavaModule;
import com.griefcraft.scripting.event.LWCAccessEvent;
import com.griefcraft.scripting.event.LWCMagnetPullEvent;

import de.epiceric.shopchest.config.Config;
import de.epiceric.shopchest.event.InteractShop;
Expand Down Expand Up @@ -226,6 +229,20 @@ public int getValue() {
getServer().getPluginManager().registerEvents(new ItemCustomNameListener(), this);

if (getServer().getPluginManager().getPlugin("ClearLag") != null) getServer().getPluginManager().registerEvents(new RegenerateShopItemAfterRemove(), this);
if (getServer().getPluginManager().getPlugin("LWC") != null){

LWC.getInstance().getModuleLoader().registerModule(this, new JavaModule() {

@Override
public void onMagnetPull(LWCMagnetPullEvent event) {
if (event.getItem().hasMetadata("shopItem")) {
event.setCancelled(true);
}
}


});
}

}

Expand Down

0 comments on commit 9687e4a

Please sign in to comment.