Overhauled ShopSellEvent API
This commit is contained in:
@@ -2,6 +2,7 @@ package com.willfp.eco.internal.spigot.integrations.shop
|
||||
|
||||
import com.willfp.eco.core.integrations.shop.ShopIntegration
|
||||
import com.willfp.eco.core.integrations.shop.ShopSellEvent
|
||||
import com.willfp.eco.core.price.impl.PriceEconomy
|
||||
import dev.norska.dsw.api.DeluxeSellwandSellEvent
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.event.EventHandler
|
||||
@@ -19,9 +20,9 @@ class ShopDeluxeSellwands : ShopIntegration {
|
||||
return
|
||||
}
|
||||
|
||||
val ecoEvent = ShopSellEvent(event.player, event.money, null)
|
||||
val ecoEvent = ShopSellEvent(event.player, PriceEconomy(event.money), null)
|
||||
Bukkit.getPluginManager().callEvent(ecoEvent)
|
||||
event.money = ecoEvent.price
|
||||
event.money = ecoEvent.value.getValue(event.player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ class ShopEconomyShopGUI : ShopIntegration {
|
||||
return
|
||||
}
|
||||
|
||||
val ecoEvent = ShopSellEvent(event.player, event.price, event.itemStack)
|
||||
val ecoEvent = ShopSellEvent(event.player, PriceEconomy(event.price), event.itemStack)
|
||||
Bukkit.getPluginManager().callEvent(ecoEvent)
|
||||
event.price = ecoEvent.price
|
||||
event.price = ecoEvent.value.getValue(event.player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ class ShopShopGuiPlus : ShopIntegration {
|
||||
return
|
||||
}
|
||||
|
||||
val ecoEvent = ShopSellEvent(event.player, event.price, event.shopItem.item)
|
||||
val ecoEvent = ShopSellEvent(event.player, PriceEconomy(event.price), event.shopItem.item)
|
||||
Bukkit.getPluginManager().callEvent(ecoEvent)
|
||||
event.price = ecoEvent.price
|
||||
event.price = ecoEvent.value.getValue(event.player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.willfp.eco.internal.spigot.integrations.shop
|
||||
|
||||
import com.willfp.eco.core.integrations.shop.ShopIntegration
|
||||
import com.willfp.eco.core.integrations.shop.ShopSellEvent
|
||||
import com.willfp.eco.core.price.impl.PriceEconomy
|
||||
import fr.maxlego08.shop.api.events.ZShopSellEvent
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.event.EventHandler
|
||||
@@ -19,9 +20,9 @@ class ShopZShop : ShopIntegration {
|
||||
return
|
||||
}
|
||||
|
||||
val ecoEvent = ShopSellEvent(event.player, event.price, event.button.itemStack)
|
||||
val ecoEvent = ShopSellEvent(event.player, PriceEconomy(event.price), event.button.itemStack)
|
||||
Bukkit.getPluginManager().callEvent(ecoEvent)
|
||||
event.price = ecoEvent.price
|
||||
event.price = ecoEvent.value.getValue(event.player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user