Rebranded as EcoItems
This commit is contained in:
25
README.md
25
README.md
@@ -1,22 +1,22 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<img src="https://i.imgur.com/Zy0MpbE.png" alt="EcoWeapons logo" width="256">
|
||||
<img src="https://i.imgur.com/Zy0MpbE.png" alt="EcoItems logo" width="256">
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
<h4 align="center">Source code for EcoWeapons, a premium spigot plugin.</h4>
|
||||
<h4 align="center">Source code for EcoItems, a premium spigot plugin.</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://polymart.org/resource/1-16-1-17-ecoweapons.1241">
|
||||
<img alt="spigot" src="https://img.shields.io/badge/polymart-ecoweapons-ff0000?style=for-the-badge"/>
|
||||
<a href="https://polymart.org/resource/ecoitems.1241">
|
||||
<img alt="spigot" src="https://img.shields.io/badge/polymart-ecoitems-ff0000?style=for-the-badge"/>
|
||||
</a>
|
||||
<a href="https://bstats.org/plugin/bukkit/EcoWeapons" alt="bstats servers">
|
||||
<img src="https://img.shields.io/bstats/servers/12134?color=ff0000&style=for-the-badge"/>
|
||||
<a href="https://bstats.org/plugin/bukkit/EcoItems" alt="bstats servers">
|
||||
<img src="https://img.shields.io/bstats/servers/12205?color=ff0000&style=for-the-badge"/>
|
||||
</a>
|
||||
<a href="https://bstats.org/plugin/bukkit/EcoWeapons" alt="bstats players">
|
||||
<img src="https://img.shields.io/bstats/players/12134?color=ff0000&style=for-the-badge"/>
|
||||
<a href="https://bstats.org/plugin/bukkit/EcoItems" alt="bstats players">
|
||||
<img src="https://img.shields.io/bstats/players/12205?color=ff0000&style=for-the-badge"/>
|
||||
</a>
|
||||
<a href="https://ecoweapons.willfp.com/" alt="Docs (gitbook)">
|
||||
<a href="https://plugins.auxilor.io/ecoitems/" alt="Docs (gitbook)">
|
||||
<img src="https://img.shields.io/badge/docs-gitbook-ff0000?style=for-the-badge&logo=appveyor"/>
|
||||
</a>
|
||||
<a href="https://discord.gg/ZcwpSsE/" alt="Discord">
|
||||
@@ -25,13 +25,10 @@
|
||||
</p>
|
||||
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[](https://ecoweapons.willfp.com/)
|
||||
[]()
|
||||
[]()
|
||||
|
||||
## License
|
||||
*Click here to read [the entire license](https://github.com/Auxilor/EcoWeapons/blob/master/LICENSE.md).*
|
||||
*Click here to read [the entire license](https://github.com/Auxilor/EcoItems/blob/master/LICENSE.md).*
|
||||
|
||||
<h1 align="center">
|
||||
<br>
|
||||
|
||||
@@ -57,12 +57,12 @@ allprojects {
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate('com.willfp.libreforge', 'com.willfp.ecoweapons.libreforge')
|
||||
relocate('com.willfp.libreforge', 'com.willfp.ecoitems.libreforge')
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.15.0'
|
||||
implementation 'com.willfp:libreforge:2.6.2'
|
||||
compileOnly 'com.willfp:eco:6.17.1'
|
||||
implementation 'com.willfp:libreforge:2.7.0'
|
||||
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
package com.willfp.ecoweapons
|
||||
package com.willfp.ecoitems
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.integrations.IntegrationLoader
|
||||
import com.willfp.ecoweapons.commands.CommandEcoweapons
|
||||
import com.willfp.ecoweapons.config.EcoWeaponsYml
|
||||
import com.willfp.ecoweapons.display.WeaponsDisplay
|
||||
import com.willfp.ecoweapons.fuels.FuelHandler
|
||||
import com.willfp.ecoweapons.util.DiscoverRecipeListener
|
||||
import com.willfp.ecoweapons.weapons.WeaponListener
|
||||
import com.willfp.ecoweapons.weapons.WeaponModifierListener
|
||||
import com.willfp.ecoweapons.weapons.WeaponUtils
|
||||
import com.willfp.ecoweapons.weapons.toSingletonList
|
||||
import com.willfp.ecoitems.commands.CommandEcoItems
|
||||
import com.willfp.ecoitems.config.ItemsYml
|
||||
import com.willfp.ecoitems.display.ItemsDisplay
|
||||
import com.willfp.ecoitems.fuels.FuelHandler
|
||||
import com.willfp.ecoitems.util.DiscoverRecipeListener
|
||||
import com.willfp.ecoitems.items.ItemListener
|
||||
import com.willfp.ecoitems.items.ItemAttributeListener
|
||||
import com.willfp.ecoitems.items.ItemUtils
|
||||
import com.willfp.ecoitems.items.toSingletonList
|
||||
import com.willfp.libreforge.LibReforge
|
||||
import org.bukkit.event.Listener
|
||||
|
||||
class EcoWeaponsPlugin : EcoPlugin(1241, 12134, "&#ff0000", true) {
|
||||
class EcoItemsPlugin : EcoPlugin(1241, 12205, "&#ff0000", true) {
|
||||
/**
|
||||
* ecoweapons.yml.
|
||||
* items.yml.
|
||||
*/
|
||||
val ecoWeaponsYml: EcoWeaponsYml
|
||||
val itemsYml: ItemsYml
|
||||
|
||||
/**
|
||||
* Internal constructor called by bukkit on plugin load.
|
||||
*/
|
||||
init {
|
||||
instance = this
|
||||
ecoWeaponsYml = EcoWeaponsYml(this)
|
||||
itemsYml = ItemsYml(this)
|
||||
LibReforge.init(this)
|
||||
LibReforge.registerHolderProvider { WeaponUtils.getWeaponOnPlayer(it).toSingletonList() }
|
||||
LibReforge.registerHolderProvider { ItemUtils.getEcoItemOnPlayer(it).toSingletonList() }
|
||||
}
|
||||
|
||||
override fun handleEnable() {
|
||||
@@ -48,9 +48,9 @@ class EcoWeaponsPlugin : EcoPlugin(1241, 12134, "&#ff0000", true) {
|
||||
override fun loadListeners(): List<Listener> {
|
||||
return listOf(
|
||||
DiscoverRecipeListener(this),
|
||||
WeaponListener(this),
|
||||
ItemListener(this),
|
||||
FuelHandler(),
|
||||
WeaponModifierListener(this)
|
||||
ItemAttributeListener(this)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ class EcoWeaponsPlugin : EcoPlugin(1241, 12134, "&#ff0000", true) {
|
||||
|
||||
override fun loadPluginCommands(): List<PluginCommand> {
|
||||
return listOf(
|
||||
CommandEcoweapons(this)
|
||||
CommandEcoItems(this)
|
||||
)
|
||||
}
|
||||
|
||||
override fun createDisplayModule(): DisplayModule {
|
||||
return WeaponsDisplay(this)
|
||||
return ItemsDisplay(this)
|
||||
}
|
||||
|
||||
override fun getMinimumEcoVersion(): String {
|
||||
@@ -74,9 +74,9 @@ class EcoWeaponsPlugin : EcoPlugin(1241, 12134, "&#ff0000", true) {
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Instance of EcoWeapons.
|
||||
* Instance of EcoItems.
|
||||
*/
|
||||
@JvmStatic
|
||||
lateinit var instance: EcoWeaponsPlugin
|
||||
lateinit var instance: EcoItemsPlugin
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.willfp.ecoitems.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.CommandHandler
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandEcoItems(
|
||||
plugin: EcoPlugin
|
||||
) : PluginCommand(
|
||||
plugin,
|
||||
"ecoitems",
|
||||
"ecoitems.command.ecoitems",
|
||||
false) {
|
||||
init {
|
||||
addSubcommand(CommandReload(plugin))
|
||||
.addSubcommand(CommandGive(plugin))
|
||||
}
|
||||
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("invalid-command")
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.willfp.ecoitems.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.ecoitems.fuels.Fuels
|
||||
import com.willfp.ecoitems.items.EcoItems
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecoitems.command.give", false) {
|
||||
private val numbers = listOf(
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"10",
|
||||
"32",
|
||||
"64"
|
||||
)
|
||||
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||
return
|
||||
}
|
||||
if (args.size == 1) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-item"))
|
||||
return
|
||||
}
|
||||
val receiverName = args[0]
|
||||
val receiver = Bukkit.getPlayer(receiverName)
|
||||
if (receiver == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||
return
|
||||
}
|
||||
val itemID = args[1]
|
||||
var amount = 1
|
||||
val ecoItem = EcoItems.getByID(itemID.lowercase())
|
||||
val fuel = Fuels.getByID(itemID.lowercase())
|
||||
if (ecoItem == null && fuel == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-item"))
|
||||
return
|
||||
}
|
||||
var message = plugin.langYml.getMessage("give-success")
|
||||
message = message.replace("%item%", itemID).replace("%recipient%", receiver.name)
|
||||
sender.sendMessage(message)
|
||||
if (args.size == 3) {
|
||||
amount = args[2].toIntOrNull() ?: 1
|
||||
}
|
||||
val item: ItemStack = ecoItem?.itemStack ?: fuel?.itemStack!!
|
||||
item.amount = amount
|
||||
receiver.inventory.addItem(item)
|
||||
}
|
||||
|
||||
override fun tabComplete(sender: CommandSender, args: List<String>): List<String> {
|
||||
val completions = mutableListOf<String>()
|
||||
|
||||
if (args.isEmpty()) {
|
||||
return EcoItems.values().map { it.id }
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
StringUtil.copyPartialMatches(
|
||||
args[0],
|
||||
Bukkit.getOnlinePlayers().map { it.name },
|
||||
completions
|
||||
)
|
||||
return completions
|
||||
}
|
||||
|
||||
if (args.size == 2) {
|
||||
val itemNames = EcoItems.values().map { it.id } union Fuels.values().map { it.id }
|
||||
|
||||
StringUtil.copyPartialMatches(args[1], itemNames, completions)
|
||||
completions.sort()
|
||||
return completions
|
||||
}
|
||||
|
||||
if (args.size == 3) {
|
||||
StringUtil.copyPartialMatches(args[2], numbers, completions)
|
||||
return completions
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.willfp.ecoitems.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.eco.core.command.CommandHandler
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandReload(plugin: EcoPlugin) : Subcommand(plugin, "reload", "ecoitems.command.reload", false) {
|
||||
override fun onExecute(sender: CommandSender, args: List<String>) {
|
||||
plugin.reload()
|
||||
sender.sendMessage(plugin.langYml.getMessage("reloaded"))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.willfp.ecoitems.config
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.BaseConfig
|
||||
import com.willfp.eco.core.config.ConfigType
|
||||
|
||||
class ItemsYml(plugin: EcoPlugin) : BaseConfig("items", plugin, false, ConfigType.YAML)
|
||||
@@ -1,19 +1,19 @@
|
||||
package com.willfp.ecoweapons.display
|
||||
package com.willfp.ecoitems.display
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.display.DisplayModule
|
||||
import com.willfp.eco.core.display.DisplayPriority
|
||||
import com.willfp.ecoweapons.fuels.FuelUtils
|
||||
import com.willfp.ecoweapons.weapons.WeaponUtils
|
||||
import com.willfp.ecoitems.fuels.FuelUtils
|
||||
import com.willfp.ecoitems.items.ItemUtils
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
class WeaponsDisplay(plugin: EcoPlugin) : DisplayModule(plugin, DisplayPriority.LOWEST) {
|
||||
class ItemsDisplay(plugin: EcoPlugin) : DisplayModule(plugin, DisplayPriority.LOWEST) {
|
||||
override fun display(
|
||||
itemStack: ItemStack,
|
||||
vararg args: Any
|
||||
) {
|
||||
val meta = itemStack.itemMeta ?: return
|
||||
val weapon = WeaponUtils.getWeaponFromItem(meta)
|
||||
val ecoItem = ItemUtils.getEcoItem(meta)
|
||||
val fuel = FuelUtils.getFuelFromItem(meta)
|
||||
|
||||
if (fuel != null) {
|
||||
@@ -29,17 +29,17 @@ class WeaponsDisplay(plugin: EcoPlugin) : DisplayModule(plugin, DisplayPriority.
|
||||
itemStack.itemMeta = meta
|
||||
}
|
||||
|
||||
if (weapon != null) {
|
||||
val weaponMeta = weapon.itemStack.itemMeta ?: return
|
||||
val lore: MutableList<String> = weaponMeta.lore?.toMutableList() ?: return
|
||||
if (ecoItem != null) {
|
||||
val ecoItemMeta = ecoItem.itemStack.itemMeta ?: return
|
||||
val lore: MutableList<String> = ecoItemMeta.lore?.toMutableList() ?: return
|
||||
|
||||
if (meta.hasLore()) {
|
||||
lore.addAll(meta.lore ?: return)
|
||||
}
|
||||
|
||||
meta.lore = lore
|
||||
meta.setDisplayName(weaponMeta.displayName)
|
||||
meta.addItemFlags(*weaponMeta.itemFlags.toTypedArray())
|
||||
meta.setDisplayName(ecoItemMeta.displayName)
|
||||
meta.addItemFlags(*ecoItemMeta.itemFlags.toTypedArray())
|
||||
itemStack.itemMeta = meta
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.fuels
|
||||
package com.willfp.ecoitems.fuels
|
||||
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
import com.willfp.libreforge.ConfigViolation
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.fuels
|
||||
package com.willfp.ecoitems.fuels
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
@@ -59,6 +59,6 @@ class Fuel(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Weapon{$id}"
|
||||
return "Fuel{$id}"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.ecoweapons.fuels
|
||||
package com.willfp.ecoitems.fuels
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.ecoweapons.weapons.Weapon
|
||||
import com.willfp.ecoitems.items.EcoItem
|
||||
import com.willfp.libreforge.events.EffectActivateEvent
|
||||
import com.willfp.libreforge.updateEffects
|
||||
import org.bukkit.Material
|
||||
@@ -11,25 +11,25 @@ import org.bukkit.event.Listener
|
||||
|
||||
class FuelHandler : Listener {
|
||||
@EventHandler
|
||||
fun onUseWeapon(event: EffectActivateEvent) {
|
||||
val weapon = event.holder as? Weapon ?: return
|
||||
if (weapon.fuels.isEmpty()) {
|
||||
fun onUseItem(event: EffectActivateEvent) {
|
||||
val item = event.holder as? EcoItem ?: return
|
||||
if (item.fuels.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
queue[event.player] = weapon
|
||||
queue[event.player] = item
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val queue = mutableMapOf<Player, Weapon>()
|
||||
private val queue = mutableMapOf<Player, EcoItem>()
|
||||
|
||||
private fun consumeFuel() {
|
||||
for ((player, weapon) in queue.toMap()) {
|
||||
fuelIter@ for (fuel in weapon.fuels) {
|
||||
for ((player, item) in queue.toMap()) {
|
||||
fuelIter@ for (fuel in item.fuels) {
|
||||
for (i in player.inventory.contents.indices) {
|
||||
val itemStack = player.inventory.getItem(i) ?: continue
|
||||
|
||||
if (weapon.fuels.contains(FuelUtils.getFuelFromItem(itemStack))) {
|
||||
if (item.fuels.contains(FuelUtils.getFuelFromItem(itemStack))) {
|
||||
if (itemStack.amount == 1) {
|
||||
itemStack.type = Material.AIR
|
||||
} else {
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.willfp.ecoweapons.fuels
|
||||
package com.willfp.ecoitems.fuels
|
||||
|
||||
import com.willfp.ecoweapons.EcoWeaponsPlugin.Companion.instance
|
||||
import com.willfp.ecoweapons.weapons.Weapon
|
||||
import com.willfp.ecoitems.EcoItemsPlugin.Companion.instance
|
||||
import com.willfp.ecoitems.items.EcoItem
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.inventory.meta.ItemMeta
|
||||
@@ -9,15 +9,15 @@ import org.bukkit.persistence.PersistentDataType
|
||||
|
||||
object FuelUtils {
|
||||
/**
|
||||
* Instance of EcoWeapons.
|
||||
* Instance of EcoItems.
|
||||
*/
|
||||
private val PLUGIN = instance
|
||||
|
||||
/**
|
||||
* Get fuel weapon from an item.
|
||||
* Get fuel from an item.
|
||||
*
|
||||
* @param itemStack The itemStack to check.
|
||||
* @return The weapon, or null if no weapon is found.
|
||||
* @return The fuel, or null if no fuel is found.
|
||||
*/
|
||||
fun getFuelFromItem(itemStack: ItemStack?): Fuel? {
|
||||
itemStack ?: return null
|
||||
@@ -26,10 +26,10 @@ object FuelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fuel weapon on an item.
|
||||
* Get fuel on an item.
|
||||
*
|
||||
* @param meta The itemStack to check.
|
||||
* @return The weapon, or null if no weapon is found.
|
||||
* @return The fuel, or null if no fuel is found.
|
||||
*/
|
||||
fun getFuelFromItem(meta: ItemMeta): Fuel? {
|
||||
val container = meta.persistentDataContainer
|
||||
@@ -41,17 +41,17 @@ object FuelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* If player has fuel for a weapon.
|
||||
* If player has fuel for an item.
|
||||
*
|
||||
* @param player The player to check.
|
||||
* @param weapon The weapon.
|
||||
* @param item The item.
|
||||
* @return If the player has fuel for it.
|
||||
*/
|
||||
fun hasFuelFor(player: Player, weapon: Weapon): Boolean {
|
||||
if (weapon.fuels.isEmpty()) {
|
||||
fun hasFuelFor(player: Player, item: EcoItem): Boolean {
|
||||
if (item.fuels.isEmpty()) {
|
||||
return true
|
||||
}
|
||||
for (fuel in weapon.fuels) {
|
||||
for (fuel in item.fuels) {
|
||||
if (hasFuel(player, fuel)) {
|
||||
return true
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.willfp.ecoweapons.fuels
|
||||
package com.willfp.ecoitems.fuels
|
||||
|
||||
import com.google.common.collect.BiMap
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.ecoweapons.EcoWeaponsPlugin
|
||||
import com.willfp.ecoitems.EcoItemsPlugin
|
||||
|
||||
object Fuels {
|
||||
/**
|
||||
@@ -38,21 +38,21 @@ object Fuels {
|
||||
/**
|
||||
* Update all [Fuel]s.
|
||||
*
|
||||
* @param plugin Instance of EcoWeapons.
|
||||
* @param plugin Instance of EcoItems.
|
||||
*/
|
||||
@ConfigUpdater
|
||||
@JvmStatic
|
||||
fun update(plugin: EcoWeaponsPlugin) {
|
||||
fun update(plugin: EcoItemsPlugin) {
|
||||
for (fuel in values()) {
|
||||
removeFuel(fuel)
|
||||
}
|
||||
for (setConfig in plugin.ecoWeaponsYml.getSubsections("fuels")) {
|
||||
for (setConfig in plugin.itemsYml.getSubsections("fuels")) {
|
||||
addNewFuel(Fuel(setConfig, plugin))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new [Fuel] to EcoWeapons.
|
||||
* Add new [Fuel] to EcoItems.
|
||||
*
|
||||
* @param fuel The [Fuel] to add.
|
||||
*/
|
||||
@@ -63,9 +63,9 @@ object Fuels {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove [Fuel] from EcoWeapons.
|
||||
* Remove [Fuel] from EcoItems.
|
||||
*
|
||||
* @param weapon The [Fuel] to remove.
|
||||
* @param fuel The [Fuel] to remove.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun removeFuel(fuel: Fuel) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.weapons
|
||||
package com.willfp.ecoitems.items
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.interfaces.Config
|
||||
@@ -7,7 +7,7 @@ import com.willfp.eco.core.items.CustomItem
|
||||
import com.willfp.eco.core.items.Items
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder
|
||||
import com.willfp.eco.core.recipe.Recipes
|
||||
import com.willfp.ecoweapons.fuels.Fuels
|
||||
import com.willfp.ecoitems.fuels.Fuels
|
||||
import com.willfp.libreforge.Holder
|
||||
import com.willfp.libreforge.conditions.Conditions
|
||||
import com.willfp.libreforge.effects.Effects
|
||||
@@ -15,18 +15,18 @@ import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
import java.util.Objects
|
||||
|
||||
class Weapon(
|
||||
class EcoItem(
|
||||
private val config: Config,
|
||||
private val plugin: EcoPlugin
|
||||
) : Holder {
|
||||
val id = config.getString("id")
|
||||
|
||||
override val effects = config.getSubsections("effects").mapNotNull {
|
||||
Effects.compile(it, "Weapon ID $id")
|
||||
Effects.compile(it, "Item ID $id")
|
||||
}.toSet()
|
||||
|
||||
override val conditions = config.getSubsections("conditions").mapNotNull {
|
||||
Conditions.compile(it, "Weapon ID $id")
|
||||
Conditions.compile(it, "Item ID $id")
|
||||
}.toSet()
|
||||
|
||||
val itemStack: ItemStack = run {
|
||||
@@ -36,16 +36,16 @@ class Weapon(
|
||||
addLoreLines(
|
||||
itemConfig.getFormattedStrings("lore").map { "${Display.PREFIX}$it" })
|
||||
writeMetaKey(
|
||||
this@Weapon.plugin.namespacedKeyFactory.create("weapon"),
|
||||
this@EcoItem.plugin.namespacedKeyFactory.create("item"),
|
||||
PersistentDataType.STRING,
|
||||
this@Weapon.id
|
||||
this@EcoItem.id
|
||||
)
|
||||
}.build()
|
||||
}
|
||||
|
||||
val customItem = CustomItem(
|
||||
plugin.namespacedKeyFactory.create(id),
|
||||
{ test -> WeaponUtils.getWeaponFromItem(test) == this },
|
||||
{ test -> ItemUtils.getEcoItem(test) == this },
|
||||
itemStack
|
||||
).apply { register() }
|
||||
|
||||
@@ -65,7 +65,7 @@ class Weapon(
|
||||
val baseAttackSpeed = config.getDouble("baseAttackSpeed")
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is Weapon) {
|
||||
if (other !is EcoItem) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -77,6 +77,6 @@ class Weapon(
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Weapon{$id}"
|
||||
return "EcoItem{$id}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.willfp.ecoitems.items
|
||||
|
||||
import com.google.common.collect.BiMap
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.ecoitems.EcoItemsPlugin
|
||||
import com.willfp.ecoitems.fuels.ConditionHasFuel
|
||||
|
||||
object EcoItems {
|
||||
/**
|
||||
* Registered items.
|
||||
*/
|
||||
private val BY_ID: BiMap<String, EcoItem> = HashBiMap.create()
|
||||
|
||||
val CONDITION_HAS_FUEL = ConditionHasFuel()
|
||||
|
||||
/**
|
||||
* Get all registered [EcoItem]s.
|
||||
*
|
||||
* @return A list of all [EcoItem]s.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun values(): List<EcoItem> {
|
||||
return ImmutableList.copyOf(BY_ID.values)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get [EcoItem] matching id.
|
||||
*
|
||||
* @param name The id to search for.
|
||||
* @return The matching [EcoItem], or null if not found.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getByID(name: String): EcoItem? {
|
||||
return BY_ID[name]
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all [EcoItem]s.
|
||||
*
|
||||
* @param plugin Instance of EcoItems.
|
||||
*/
|
||||
@ConfigUpdater
|
||||
@JvmStatic
|
||||
fun update(plugin: EcoItemsPlugin) {
|
||||
for (item in values()) {
|
||||
removeItem(item)
|
||||
}
|
||||
for (setConfig in plugin.itemsYml.getSubsections("items")) {
|
||||
addNewItem(EcoItem(setConfig, plugin))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new [EcoItem] to EcoItems.
|
||||
*
|
||||
* @param item The [EcoItem] to add.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun addNewItem(item: EcoItem) {
|
||||
BY_ID.remove(item.id)
|
||||
BY_ID[item.id] = item
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove [EcoItem] from EcoItems.
|
||||
*
|
||||
* @param item The [EcoItem] to remove.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun removeItem(item: EcoItem) {
|
||||
BY_ID.remove(item.id)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.weapons
|
||||
package com.willfp.ecoitems.items
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bukkit.attribute.Attribute
|
||||
@@ -9,7 +9,7 @@ import org.bukkit.event.Listener
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent
|
||||
import java.util.UUID
|
||||
|
||||
class WeaponModifierListener(private val plugin: EcoPlugin) : Listener {
|
||||
class ItemAttributeListener(private val plugin: EcoPlugin) : Listener {
|
||||
@EventHandler
|
||||
fun handle(event: PlayerItemHeldEvent) {
|
||||
if (event.isCancelled) {
|
||||
@@ -21,11 +21,29 @@ class WeaponModifierListener(private val plugin: EcoPlugin) : Listener {
|
||||
}
|
||||
|
||||
private fun apply(player: Player) {
|
||||
val weapon = WeaponUtils.getWeaponOnPlayer(player)
|
||||
val item = ItemUtils.getEcoItemOnPlayer(player)
|
||||
|
||||
val damageInst = player.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE) ?: return
|
||||
val speedInst = player.getAttribute(Attribute.GENERIC_ATTACK_SPEED) ?: return
|
||||
|
||||
damageInst.removeModifier(
|
||||
AttributeModifier(
|
||||
UUID.nameUUIDFromBytes("ecoitems_ad".toByteArray()),
|
||||
"EcoItems Damage",
|
||||
1.0, // Irrelevant
|
||||
AttributeModifier.Operation.ADD_NUMBER
|
||||
)
|
||||
)
|
||||
speedInst.removeModifier(
|
||||
AttributeModifier(
|
||||
UUID.nameUUIDFromBytes("ecoitems_as".toByteArray()),
|
||||
"EcoItems Speed",
|
||||
1.0, // Irrelevant
|
||||
AttributeModifier.Operation.ADD_NUMBER
|
||||
)
|
||||
)
|
||||
|
||||
// Legacy
|
||||
damageInst.removeModifier(
|
||||
AttributeModifier(
|
||||
UUID.nameUUIDFromBytes("ecoweapons_ad".toByteArray()),
|
||||
@@ -43,21 +61,21 @@ class WeaponModifierListener(private val plugin: EcoPlugin) : Listener {
|
||||
)
|
||||
)
|
||||
|
||||
if (weapon != null) {
|
||||
if (item != null) {
|
||||
damageInst.addModifier(
|
||||
AttributeModifier(
|
||||
UUID.nameUUIDFromBytes("ecoweapons_ad".toByteArray()),
|
||||
"EcoWeapons Damage",
|
||||
weapon.baseDamage - player.inventory.itemInMainHand.type.getBaseDamage(),
|
||||
UUID.nameUUIDFromBytes("ecoitems_ad".toByteArray()),
|
||||
"EcoItems Damage",
|
||||
item.baseDamage - player.inventory.itemInMainHand.type.getBaseDamage(),
|
||||
AttributeModifier.Operation.ADD_NUMBER
|
||||
)
|
||||
)
|
||||
|
||||
speedInst.addModifier(
|
||||
AttributeModifier(
|
||||
UUID.nameUUIDFromBytes("ecoweapons_as".toByteArray()),
|
||||
"EcoWeapons Speed",
|
||||
weapon.baseAttackSpeed - player.inventory.itemInMainHand.type.getBaseAttackSpeed(),
|
||||
UUID.nameUUIDFromBytes("ecoitems_as".toByteArray()),
|
||||
"EcoItems Speed",
|
||||
item.baseAttackSpeed - player.inventory.itemInMainHand.type.getBaseAttackSpeed(),
|
||||
AttributeModifier.Operation.ADD_NUMBER
|
||||
)
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.weapons
|
||||
package com.willfp.ecoitems.items
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.libreforge.updateEffects
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent
|
||||
|
||||
class WeaponListener(
|
||||
class ItemListener(
|
||||
private val plugin: EcoPlugin
|
||||
): Listener {
|
||||
@EventHandler
|
||||
@@ -1,53 +1,70 @@
|
||||
package com.willfp.ecoweapons.weapons
|
||||
package com.willfp.ecoitems.items
|
||||
|
||||
import com.willfp.ecoweapons.EcoWeaponsPlugin.Companion.instance
|
||||
import com.willfp.ecoitems.EcoItemsPlugin.Companion.instance
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.inventory.meta.ItemMeta
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
|
||||
object WeaponUtils {
|
||||
object ItemUtils {
|
||||
/**
|
||||
* Instance of EcoWeapons.
|
||||
* Instance of EcoItems.
|
||||
*/
|
||||
private val PLUGIN = instance
|
||||
|
||||
/**
|
||||
* Get weapon from an item.
|
||||
* Get EcoItem from an item.
|
||||
*
|
||||
* @param itemStack The itemStack to check.
|
||||
* @return The weapon, or null if no weapon is found.
|
||||
* @return The EcoItem, or null if no EcoItem is found.
|
||||
*/
|
||||
fun getWeaponFromItem(itemStack: ItemStack?): Weapon? {
|
||||
fun getEcoItem(itemStack: ItemStack?): EcoItem? {
|
||||
itemStack ?: return null
|
||||
val meta = itemStack.itemMeta ?: return null
|
||||
return getWeaponFromItem(meta)
|
||||
val item = getEcoItem(meta)
|
||||
itemStack.itemMeta = meta
|
||||
return item
|
||||
}
|
||||
|
||||
/**
|
||||
* Get weapon on an item.
|
||||
* Get EcoItem from an item.
|
||||
*
|
||||
* @param meta The itemStack to check.
|
||||
* @return The weapon, or null if no weapon is found.
|
||||
* @return The EcoItem, or null if no EcoItem is found.
|
||||
*/
|
||||
fun getWeaponFromItem(meta: ItemMeta): Weapon? {
|
||||
fun getEcoItem(meta: ItemMeta): EcoItem? {
|
||||
val container = meta.persistentDataContainer
|
||||
val weaponName = container.get(
|
||||
val legacy = container.get(
|
||||
PLUGIN.namespacedKeyFactory.create("weapon"),
|
||||
PersistentDataType.STRING
|
||||
)
|
||||
|
||||
if (legacy != null) {
|
||||
container.set(
|
||||
PLUGIN.namespacedKeyFactory.create("item"),
|
||||
PersistentDataType.STRING,
|
||||
legacy
|
||||
)
|
||||
container.remove(PLUGIN.namespacedKeyFactory.create("weapon"))
|
||||
}
|
||||
|
||||
val id = container.get(
|
||||
PLUGIN.namespacedKeyFactory.create("item"),
|
||||
PersistentDataType.STRING
|
||||
) ?: return null
|
||||
return Weapons.getByID(weaponName)
|
||||
|
||||
return EcoItems.getByID(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get weapon on a player.
|
||||
* Get EcoItem on a player.
|
||||
*
|
||||
* @param player The player to check.
|
||||
* @return The weapon, or null if no weapon is found.
|
||||
* @return The EcoItem, or null if no EcoItem is found.
|
||||
*/
|
||||
fun getWeaponOnPlayer(player: Player): Weapon? {
|
||||
return getWeaponFromItem(player.inventory.itemInMainHand)
|
||||
fun getEcoItemOnPlayer(player: Player): EcoItem? {
|
||||
return getEcoItem(player.inventory.itemInMainHand)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoweapons.util
|
||||
package com.willfp.ecoitems.util
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import org.bukkit.Bukkit
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.willfp.ecoweapons.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.CommandHandler
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
|
||||
class CommandEcoweapons(
|
||||
plugin: EcoPlugin
|
||||
) : PluginCommand(
|
||||
plugin,
|
||||
"ecoweapons",
|
||||
"ecoweapons.command.ecoweapons",
|
||||
false) {
|
||||
init {
|
||||
addSubcommand(CommandReload(plugin))
|
||||
.addSubcommand(CommandGive(plugin))
|
||||
}
|
||||
override fun getHandler(): CommandHandler {
|
||||
return CommandHandler { sender, _ ->
|
||||
sender.sendMessage(
|
||||
plugin.langYml.getMessage("invalid-command")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.willfp.ecoweapons.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.CommandHandler
|
||||
import com.willfp.eco.core.command.TabCompleteHandler
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.ecoweapons.fuels.Fuels
|
||||
import com.willfp.ecoweapons.weapons.Weapons
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandGive(plugin: EcoPlugin) : Subcommand(plugin, "give", "ecoweapons.command.give", false) {
|
||||
private val numbers = listOf(
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"10",
|
||||
"32",
|
||||
"64"
|
||||
)
|
||||
|
||||
override fun getHandler(): CommandHandler {
|
||||
return CommandHandler { sender, args ->
|
||||
if (args.isEmpty()) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-player"))
|
||||
return@CommandHandler
|
||||
}
|
||||
if (args.size == 1) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("needs-item"))
|
||||
return@CommandHandler
|
||||
}
|
||||
val receiverName = args[0]
|
||||
val receiver = Bukkit.getPlayer(receiverName)
|
||||
if (receiver == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
|
||||
return@CommandHandler
|
||||
}
|
||||
val itemID = args[1]
|
||||
var amount = 1
|
||||
val weapon = Weapons.getByID(itemID.lowercase())
|
||||
val fuel = Fuels.getByID(itemID.lowercase())
|
||||
if (weapon == null && fuel == null) {
|
||||
sender.sendMessage(plugin.langYml.getMessage("invalid-item"))
|
||||
return@CommandHandler
|
||||
}
|
||||
var message = plugin.langYml.getMessage("give-success")
|
||||
message = message.replace("%item%", itemID).replace("%recipient%", receiver.name)
|
||||
sender.sendMessage(message)
|
||||
if (args.size == 3) {
|
||||
amount = args[2].toIntOrNull() ?: 1
|
||||
}
|
||||
val item: ItemStack = weapon?.itemStack ?: fuel?.itemStack!!
|
||||
item.amount = amount
|
||||
receiver.inventory.addItem(item)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTabCompleter(): TabCompleteHandler {
|
||||
return TabCompleteHandler { _, args ->
|
||||
val completions = mutableListOf<String>()
|
||||
|
||||
if (args.isEmpty()) {
|
||||
return@TabCompleteHandler Weapons.values().map { it.id }
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
StringUtil.copyPartialMatches(
|
||||
args[0],
|
||||
Bukkit.getOnlinePlayers().map { it.name },
|
||||
completions
|
||||
)
|
||||
return@TabCompleteHandler completions
|
||||
}
|
||||
|
||||
if (args.size == 2) {
|
||||
val itemNames = Weapons.values().map { it.id } union Fuels.values().map { it.id }
|
||||
|
||||
StringUtil.copyPartialMatches(args[1], itemNames, completions)
|
||||
completions.sort()
|
||||
return@TabCompleteHandler completions
|
||||
}
|
||||
|
||||
if (args.size == 3) {
|
||||
StringUtil.copyPartialMatches(args[2], numbers, completions)
|
||||
return@TabCompleteHandler completions
|
||||
}
|
||||
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.willfp.ecoweapons.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.Subcommand
|
||||
import com.willfp.eco.core.command.CommandHandler
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandReload(plugin: EcoPlugin) : Subcommand(plugin, "reload", "ecoweapons.command.reload", false) {
|
||||
override fun getHandler(): CommandHandler {
|
||||
return CommandHandler { sender: CommandSender, _: List<String?>? ->
|
||||
plugin.reload()
|
||||
sender.sendMessage(plugin.langYml.getMessage("reloaded"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.willfp.ecoweapons.config
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.config.json.JSONStaticBaseConfig
|
||||
import com.willfp.eco.core.config.yaml.YamlBaseConfig
|
||||
|
||||
class EcoWeaponsYml(plugin: EcoPlugin) : YamlBaseConfig("ecoweapons", false, plugin)
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.willfp.ecoweapons.weapons
|
||||
|
||||
import com.google.common.collect.BiMap
|
||||
import com.google.common.collect.HashBiMap
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater
|
||||
import com.willfp.ecoweapons.EcoWeaponsPlugin
|
||||
import com.willfp.ecoweapons.fuels.ConditionHasFuel
|
||||
|
||||
object Weapons {
|
||||
/**
|
||||
* Registered weapons.
|
||||
*/
|
||||
private val BY_ID: BiMap<String, Weapon> = HashBiMap.create()
|
||||
|
||||
val CONDITION_HAS_FUEL = ConditionHasFuel()
|
||||
|
||||
/**
|
||||
* Get all registered [Weapon]s.
|
||||
*
|
||||
* @return A list of all [Weapon]s.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun values(): List<Weapon> {
|
||||
return ImmutableList.copyOf(BY_ID.values)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get [Weapon] matching id.
|
||||
*
|
||||
* @param name The id to search for.
|
||||
* @return The matching [Weapon], or null if not found.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getByID(name: String): Weapon? {
|
||||
return BY_ID[name]
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all [Weapon]s.
|
||||
*
|
||||
* @param plugin Instance of EcoWeapons.
|
||||
*/
|
||||
@ConfigUpdater
|
||||
@JvmStatic
|
||||
fun update(plugin: EcoWeaponsPlugin) {
|
||||
for (weapon in values()) {
|
||||
removeWeapon(weapon)
|
||||
}
|
||||
for (setConfig in plugin.ecoWeaponsYml.getSubsections("weapons")) {
|
||||
addNewWeapon(Weapon(setConfig, plugin))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new [Weapon] to EcoWeapons.
|
||||
*
|
||||
* @param weapon The [Weapon] to add.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun addNewWeapon(weapon: Weapon) {
|
||||
BY_ID.remove(weapon.id)
|
||||
BY_ID[weapon.id] = weapon
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove [Weapon] from EcoWeapons.
|
||||
*
|
||||
* @param weapon The [Weapon] to remove.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun removeWeapon(weapon: Weapon) {
|
||||
BY_ID.remove(weapon.id)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# EcoWeapons
|
||||
# EcoItems
|
||||
# by Auxilor
|
||||
#
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
weapons:
|
||||
items:
|
||||
- id: rogue_zweihander
|
||||
baseDamage: 7
|
||||
baseAttackSpeed: 1.2
|
||||
@@ -1,9 +1,9 @@
|
||||
messages:
|
||||
prefix: "&#ff0000&lEcoWeapons&r &8» &r"
|
||||
prefix: "&#ff0000&lEcoItems&r &8» &r"
|
||||
no-permission: "&cYou don't have permission to do this!"
|
||||
not-player: "&cThis command must be run by a player"
|
||||
invalid-command: "&cUnknown subcommand!"
|
||||
reloaded: "Reloaded! (Restart if you're removed weapons!)"
|
||||
reloaded: "Reloaded! (Restart if you're removed items!)"
|
||||
needs-player: "&cYou must specify a player"
|
||||
invalid-player: "&cInvalid player!"
|
||||
needs-item: "&cYou must specify an item!"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: EcoWeapons
|
||||
name: EcoItems
|
||||
version: ${projectVersion}
|
||||
main: com.willfp.ecoweapons.EcoWeaponsPlugin
|
||||
main: com.willfp.ecoitems.EcoItemsPlugin
|
||||
api-version: 1.16
|
||||
authors: [ Auxilor ]
|
||||
website: willfp.com
|
||||
@@ -15,31 +15,30 @@ libraries:
|
||||
- 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
|
||||
|
||||
commands:
|
||||
ecoweapons:
|
||||
ecoitems:
|
||||
description: Base Command
|
||||
permission: ecoweapons.command.ecoweapons
|
||||
permission: ecoitems.command.ecoitems
|
||||
|
||||
permissions:
|
||||
ecoweapons.*:
|
||||
description: All ecoweapons permissions
|
||||
ecoitems.*:
|
||||
description: All ecoitems permissions
|
||||
default: op
|
||||
children:
|
||||
ecoweapons.command.*: true
|
||||
ecoweapons.noflydisable: true
|
||||
ecoweapons.command.*:
|
||||
ecoitems.command.*: true
|
||||
ecoitems.command.*:
|
||||
description: All commands
|
||||
default: op
|
||||
children:
|
||||
ecoweapons.command.reload: true
|
||||
ecoweapons.command.ecoweapons: true
|
||||
ecoweapons.command.give: true
|
||||
ecoitems.command.reload: true
|
||||
ecoitems.command.ecoitems: true
|
||||
ecoitems.command.give: true
|
||||
|
||||
ecoweapons.command.reload:
|
||||
ecoitems.command.reload:
|
||||
description: Allows reloading the config
|
||||
default: op
|
||||
ecoweapons.command.give:
|
||||
description: Allows the use of /ecoweapons give
|
||||
ecoitems.command.give:
|
||||
description: Allows the use of /ecoitems give
|
||||
default: op
|
||||
ecoweapons.command.ecoweapons:
|
||||
description: Allows the user of /ecoweapons.
|
||||
ecoitems.command.ecoitems:
|
||||
description: Allows the user of /ecoitems.
|
||||
default: true
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = 2.6.0
|
||||
plugin-name = EcoWeapons
|
||||
version = 3.0.0
|
||||
plugin-name = EcoItems
|
||||
@@ -1,4 +1,4 @@
|
||||
rootProject.name = 'EcoWeapons'
|
||||
rootProject.name = 'EcoItems'
|
||||
|
||||
// Core
|
||||
include ':eco-core'
|
||||
|
||||
Reference in New Issue
Block a user