Added DeluxeSellwands support

This commit is contained in:
Auxilor
2021-11-02 09:49:15 +00:00
parent 4757549f23
commit 38cd955e41
4 changed files with 30 additions and 0 deletions
@@ -3,6 +3,7 @@ package com.willfp.boosters.boosters.boosters
import com.willfp.boosters.BoostersPlugin
import com.willfp.boosters.activeBooster
import com.willfp.boosters.boosters.Booster
import dev.norska.dsw.api.DeluxeSellwandSellEvent
import net.brcdev.shopgui.event.ShopPreTransactionEvent
import net.brcdev.shopgui.shop.ShopManager
import org.bukkit.Bukkit
@@ -31,4 +32,17 @@ class Booster15SellMultiplier: Booster(
event.price *= 1.5
}
@EventHandler(priority = EventPriority.HIGH)
fun handle(event: DeluxeSellwandSellEvent) {
if (Bukkit.getServer().activeBooster != this) {
return
}
if (event.isCancelled) {
return
}
event.money *= 1.5
}
}
@@ -3,6 +3,7 @@ package com.willfp.boosters.boosters.boosters
import com.willfp.boosters.BoostersPlugin
import com.willfp.boosters.activeBooster
import com.willfp.boosters.boosters.Booster
import dev.norska.dsw.api.DeluxeSellwandSellEvent
import net.brcdev.shopgui.event.ShopPreTransactionEvent
import net.brcdev.shopgui.shop.ShopManager
import org.bukkit.Bukkit
@@ -31,4 +32,17 @@ class Booster2SellMultiplier: Booster(
event.price *= 2
}
@EventHandler(priority = EventPriority.HIGH)
fun handle(event: DeluxeSellwandSellEvent) {
if (Bukkit.getServer().activeBooster != this) {
return
}
if (event.isCancelled) {
return
}
event.money *= 2
}
}