Added scyther integration and BigDecimal economy support
This commit is contained in:
@@ -47,6 +47,7 @@ dependencies {
|
||||
compileOnly 'com.wolfyscript.wolfyutilities:wolfyutilities:3.16.0.0'
|
||||
compileOnly 'com.github.decentsoftware-eu:decentholograms:2.1.2'
|
||||
compileOnly 'com.github.Gypopo:EconomyShopGUI-API:1.1.0'
|
||||
compileOnly 'com.github.N0RSKA:ScytherAPI:55a'
|
||||
|
||||
// MythicMobs
|
||||
compileOnly 'io.lumine:Mythic:5.0.1'
|
||||
|
||||
@@ -101,6 +101,7 @@ import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsHeadDa
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsItemsAdder
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsMythicMobs
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsOraxen
|
||||
import com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsScyther
|
||||
import com.willfp.eco.internal.spigot.integrations.customrecipes.CustomRecipeCustomCrafting
|
||||
import com.willfp.eco.internal.spigot.integrations.economy.EconomyVault
|
||||
import com.willfp.eco.internal.spigot.integrations.hologram.HologramCMI
|
||||
@@ -313,6 +314,7 @@ abstract class EcoSpigotPlugin : EcoPlugin() {
|
||||
CraftingRecipeListener.registerValidator(CustomRecipeCustomCrafting())
|
||||
},
|
||||
IntegrationLoader("MythicMobs") { CustomItemsManager.register(CustomItemsMythicMobs(this)) },
|
||||
IntegrationLoader("Scyther") { CustomItemsManager.register(CustomItemsScyther()) },
|
||||
|
||||
// Shop
|
||||
IntegrationLoader("ShopGUIPlus") { ShopManager.register(ShopShopGuiPlus()) },
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.willfp.eco.internal.spigot.integrations.customitems
|
||||
|
||||
import com.willfp.eco.core.integrations.customitems.CustomItemsIntegration
|
||||
import com.willfp.eco.core.items.CustomItem
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.TestableItem
|
||||
import com.willfp.eco.core.items.provider.ItemProvider
|
||||
import com.willfp.eco.util.NamespacedKeyUtils
|
||||
import dev.norska.scyther.Scyther
|
||||
import dev.norska.scyther.api.ScytherAPI
|
||||
import org.bukkit.Material
|
||||
|
||||
class CustomItemsScyther : CustomItemsIntegration {
|
||||
override fun registerProvider() {
|
||||
Items.registerItemProvider(ScytherProvider())
|
||||
}
|
||||
|
||||
override fun getPluginName(): String {
|
||||
return "Scyther"
|
||||
}
|
||||
|
||||
private class ScytherProvider : ItemProvider("scyther") {
|
||||
override fun provideForKey(key: String): TestableItem? {
|
||||
val material = Material.matchMaterial(key.uppercase()) ?: Material.WOODEN_HOE
|
||||
|
||||
val hoe = ScytherAPI.createHarvesterHoe(
|
||||
Scyther.getInstance(),
|
||||
material,
|
||||
0,
|
||||
null,
|
||||
1,
|
||||
Int.MAX_VALUE,
|
||||
null,
|
||||
null
|
||||
)
|
||||
|
||||
val namespacedKey = NamespacedKeyUtils.create("scyther", key)
|
||||
|
||||
return CustomItem(
|
||||
namespacedKey,
|
||||
{
|
||||
ScytherAPI.isHarvesterItem(it) && it.type == material
|
||||
},
|
||||
hoe
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,4 +46,5 @@ softdepend:
|
||||
- RPGHorses
|
||||
- EconomyShopGUI
|
||||
- zShop
|
||||
- DeluxeSellwands
|
||||
- DeluxeSellwands
|
||||
- Scyther
|
||||
Reference in New Issue
Block a user