update
This commit is contained in:
parent
9e15bdced5
commit
9891a7188d
|
|
@ -10,6 +10,8 @@ taboolib {
|
||||||
install("common-5")
|
install("common-5")
|
||||||
install("module-database")
|
install("module-database")
|
||||||
install("module-chat")
|
install("module-chat")
|
||||||
|
install("module-ui")
|
||||||
|
install("module-ui-receptacle")
|
||||||
install("module-configuration")
|
install("module-configuration")
|
||||||
install("expansion-player-database")
|
install("expansion-player-database")
|
||||||
install("platform-bukkit")
|
install("platform-bukkit")
|
||||||
|
|
@ -23,7 +25,8 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("ink.ptms:nms-all:1.0.0")
|
compileOnly("ink.ptms:nms-all:1.0.0")
|
||||||
compileOnly("ink.ptms.core:v11200:11200-minimize")
|
compileOnly("ink.ptms.core:v11802:11802-minimize:mapped")
|
||||||
|
compileOnly("ink.ptms.core:v11802:11802-minimize:universal")
|
||||||
compileOnly(kotlin("stdlib"))
|
compileOnly(kotlin("stdlib"))
|
||||||
compileOnly(fileTree("libs"))
|
compileOnly(fileTree("libs"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package work.microhand.sanseyooyea.sansefish
|
package work.microhand.sanseyooyea.sansefish
|
||||||
|
|
||||||
|
import org.bukkit.NamespacedKey
|
||||||
import taboolib.common.platform.Plugin
|
import taboolib.common.platform.Plugin
|
||||||
import taboolib.common.platform.function.info
|
import taboolib.common.platform.function.info
|
||||||
import taboolib.module.configuration.Config
|
import taboolib.module.configuration.Config
|
||||||
import taboolib.module.configuration.Configuration
|
import taboolib.module.configuration.Configuration
|
||||||
import work.microhand.sanseyooyea.sansefish.command.fishCmd
|
import taboolib.platform.BukkitPlugin
|
||||||
|
import work.microhand.sanseyooyea.sansefish.command.setBaitCmd
|
||||||
import work.microhand.sanseyooyea.sansefish.command.registerCommand
|
import work.microhand.sanseyooyea.sansefish.command.registerCommand
|
||||||
import work.microhand.sanseyooyea.sansefish.reward.RewardHandler
|
import work.microhand.sanseyooyea.sansefish.command.StorageCommand
|
||||||
import work.microhand.sanseyooyea.sansefish.storage.StorageCommand
|
|
||||||
|
|
||||||
object SanseFish : Plugin() {
|
object SanseFish : Plugin() {
|
||||||
|
|
||||||
|
|
@ -15,13 +16,16 @@ object SanseFish : Plugin() {
|
||||||
lateinit var conf: Configuration
|
lateinit var conf: Configuration
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
val baitKey = NamespacedKey(BukkitPlugin.getInstance(), "bait")
|
||||||
|
val maxLuckKey = NamespacedKey(BukkitPlugin.getInstance(), "max_luck")
|
||||||
|
|
||||||
override fun onEnable() {
|
override fun onEnable() {
|
||||||
info("§a| §7正在加载钓鱼插件(SanseFish)..")
|
info("§a| §7正在加载钓鱼插件(SanseFish)..")
|
||||||
info("§a| §7作者QQ: 1187586838")
|
info("§a| §7作者QQ: 1187586838")
|
||||||
registerCommand()
|
registerCommand()
|
||||||
StorageCommand.registerCommand()
|
StorageCommand.registerCommand()
|
||||||
fishCmd()
|
setBaitCmd()
|
||||||
RewardHandler
|
|
||||||
info("§a| §7插件加载完成.")
|
info("§a| §7插件加载完成.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import taboolib.common.platform.command.command
|
||||||
import taboolib.library.xseries.setItemStack
|
import taboolib.library.xseries.setItemStack
|
||||||
import taboolib.platform.util.giveItem
|
import taboolib.platform.util.giveItem
|
||||||
import work.microhand.sanseyooyea.sansefish.SanseFish
|
import work.microhand.sanseyooyea.sansefish.SanseFish
|
||||||
|
import work.microhand.sanseyooyea.sansefish.manager.BaitManager
|
||||||
import work.microhand.sanseyooyea.sansefish.manager.RodManager
|
import work.microhand.sanseyooyea.sansefish.manager.RodManager
|
||||||
|
|
||||||
fun registerCommand() = command("giveRod", permission = "sansefish.giverod") {
|
fun registerCommand() = command("giveRod", permission = "sansefish.giverod") {
|
||||||
|
|
@ -22,10 +23,14 @@ fun registerCommand() = command("giveRod", permission = "sansefish.giverod") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fishCmd() = command("setBait", permission = "sansefish.setbait") {
|
fun setBaitCmd() = command("setBait", permission = "sansefish.setbait") {
|
||||||
execute<Player> { sender, _, _ ->
|
dynamic {
|
||||||
sender.sendMessage("§a| §7您手中物品已设置为鱼饵.")
|
execute<Player> { sender, _, arg ->
|
||||||
SanseFish.conf.setItemStack("target-rod.bait", sender.inventory.itemInMainHand.clone().apply { amount = 1 })
|
val bait = BaitManager.baits[arg]?: return@execute sender.sendMessage("§a| §7未找到该鱼饵")
|
||||||
SanseFish.conf.saveToFile()
|
sender.sendMessage("§a| §7您手中物品已设置为鱼饵.")
|
||||||
|
|
||||||
|
SanseFish.conf.setItemStack("target-rod.bait", sender.inventory.itemInMainHand.clone().apply { amount = 1 })
|
||||||
|
SanseFish.conf.saveToFile()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.storage
|
package work.microhand.sanseyooyea.sansefish.command
|
||||||
|
|
||||||
import org.bukkit.Bukkit
|
import org.bukkit.Bukkit
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
|
|
@ -62,7 +62,7 @@ object StorageCommand {
|
||||||
execute<Player> { sender, ctx, arg ->
|
execute<Player> { sender, ctx, arg ->
|
||||||
val target = Bukkit.getPlayerExact(ctx.argument(-1))
|
val target = Bukkit.getPlayerExact(ctx.argument(-1))
|
||||||
val item = itemStorage.getItemStack(arg)?: return@execute sender.sendMessage("§c| §7该物品不存在.")
|
val item = itemStorage.getItemStack(arg)?: return@execute sender.sendMessage("§c| §7该物品不存在.")
|
||||||
target.giveItem(item)
|
target!!.giveItem(item)
|
||||||
sender.sendMessage("§a| §7已将物品 §a${arg} §7给予 §a${target.name}")
|
sender.sendMessage("§a| §7已将物品 §a${arg} §7给予 §a${target.name}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.listener
|
package work.microhand.sanseyooyea.sansefish.listener
|
||||||
|
|
||||||
import org.bukkit.Material
|
import org.bukkit.Material
|
||||||
|
import org.bukkit.event.block.Action
|
||||||
import org.bukkit.event.player.PlayerFishEvent
|
import org.bukkit.event.player.PlayerFishEvent
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
|
import org.bukkit.persistence.PersistentDataType
|
||||||
import taboolib.common.platform.event.SubscribeEvent
|
import taboolib.common.platform.event.SubscribeEvent
|
||||||
import taboolib.library.xseries.getItemStack
|
|
||||||
import taboolib.platform.util.hasItem
|
|
||||||
import work.microhand.sanseyooyea.sansefish.SanseFish
|
import work.microhand.sanseyooyea.sansefish.SanseFish
|
||||||
import work.microhand.sanseyooyea.sansefish.manager.RodManager
|
import work.microhand.sanseyooyea.sansefish.manager.RodManager
|
||||||
import work.microhand.sanseyooyea.sansefish.reward.RewardHandler
|
import work.microhand.sanseyooyea.sansefish.ui.BaitUI
|
||||||
|
|
||||||
object FishListener {
|
object FishListener {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
@ -25,30 +26,36 @@ object FishListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
var offHand = false
|
var offHand = false
|
||||||
val rod = RodManager.parseRod(player.inventory.itemInMainHand) ?: RodManager.parseRod(player.inventory.itemInOffHand).also {
|
val rod =
|
||||||
offHand = true
|
RodManager.parseRod(player.inventory.itemInMainHand) ?: RodManager.parseRod(player.inventory.itemInOffHand)
|
||||||
} ?: throw IllegalStateException("???你咋钓鱼的")
|
.also {
|
||||||
|
offHand = true
|
||||||
|
} ?: throw IllegalStateException("???你咋钓鱼的")
|
||||||
|
val rodItem = if (offHand) player.inventory.itemInOffHand else player.inventory.itemInMainHand
|
||||||
|
|
||||||
|
if (fishEvent.state == PlayerFishEvent.State.FISHING) {
|
||||||
|
if (!rodItem.itemMeta!!.persistentDataContainer.has(SanseFish.baitKey, PersistentDataType.STRING)) return
|
||||||
|
}
|
||||||
|
|
||||||
if (fishEvent.state != PlayerFishEvent.State.BITE) rod.durability--
|
if (fishEvent.state != PlayerFishEvent.State.BITE) rod.durability--
|
||||||
|
|
||||||
if (fishEvent.state == PlayerFishEvent.State.CAUGHT_FISH) {
|
if (fishEvent.state == PlayerFishEvent.State.CAUGHT_FISH) {
|
||||||
fishEvent.expToDrop = 0
|
rod.handleFished(fishEvent)
|
||||||
rod.luck++
|
|
||||||
fishEvent.caught.remove()
|
|
||||||
if (!player.inventory.hasItem(1) {
|
|
||||||
it.clone().apply { amount = 1 } == SanseFish.conf.getItemStack("target-rod.bait")
|
|
||||||
}) {
|
|
||||||
player.sendMessage("§c| §7您没有足够的鱼饵.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
player.inventory.removeItem(SanseFish.conf.getItemStack("target-rod.bait"))
|
|
||||||
RewardHandler.doReward(player, rod)
|
|
||||||
}
|
}
|
||||||
val resultItem = if (rod.durability <= 0) {
|
val resultItem = if (rod.durability <= 0) {
|
||||||
player.sendMessage("§c| §7您的鱼竿已损坏")
|
player.sendMessage("§c| §7您的鱼竿已损坏")
|
||||||
ItemStack(Material.AIR)
|
ItemStack(Material.AIR)
|
||||||
} else rod.updateFishingRod(if (offHand) player.inventory.itemInOffHand else player.inventory.itemInMainHand)
|
} else rod.updateFishingRod()
|
||||||
|
|
||||||
if (offHand) player.inventory.itemInOffHand = resultItem else player.inventory.itemInMainHand = resultItem
|
if (offHand) player.inventory.setItemInOffHand(resultItem) else player.inventory.setItemInMainHand(resultItem)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
fun useBait(event: PlayerInteractEvent) {
|
||||||
|
if (event.action != Action.LEFT_CLICK_AIR && event.action != Action.LEFT_CLICK_BLOCK) return
|
||||||
|
if (!event.hasItem()) return
|
||||||
|
if (event.item!!.type != Material.FISHING_ROD) return
|
||||||
|
RodManager.parseRod(event.item!!) ?: return
|
||||||
|
BaitUI(event.player).open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,21 +1,44 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.manager
|
package work.microhand.sanseyooyea.sansefish.manager
|
||||||
|
|
||||||
|
import org.bukkit.inventory.ItemStack
|
||||||
import taboolib.common.platform.function.getDataFolder
|
import taboolib.common.platform.function.getDataFolder
|
||||||
|
import taboolib.library.xseries.getItemStack
|
||||||
import taboolib.module.configuration.Configuration
|
import taboolib.module.configuration.Configuration
|
||||||
|
import work.microhand.sanseyooyea.sansefish.command.StorageCommand
|
||||||
import work.microhand.sanseyooyea.sansefish.misc.Bait
|
import work.microhand.sanseyooyea.sansefish.misc.Bait
|
||||||
|
import work.microhand.sanseyooyea.sansefish.misc.BaitReward
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.lang.IllegalArgumentException
|
||||||
|
|
||||||
object BaitManager {
|
object BaitManager {
|
||||||
val baits = HashMap<String, Bait>()
|
val baits = HashMap<String, Bait>()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun parseBait(item: ItemStack): Bait? {
|
||||||
|
baits.forEach { (_, bait) ->
|
||||||
|
if (bait.item.isSimilar(item)) {
|
||||||
|
return bait
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun init() {
|
||||||
// load baits.
|
// load baits.
|
||||||
File(getDataFolder(), "baits").listFiles()?.forEach { file ->
|
File(getDataFolder(), "baits").listFiles()?.forEach { file ->
|
||||||
val config = Configuration.loadFromFile(file)
|
val config = Configuration.loadFromFile(file)
|
||||||
val durability = config.getInt("max-durability")
|
val key = config.getString("item")!!
|
||||||
val luck = config.getInt("luck-def")
|
val item = StorageCommand.itemStorage.getItemStack(key)?: throw IllegalArgumentException("物品 $key 不存在.")
|
||||||
val lore = config.getString("lore")!!
|
val rewards = BaitReward(config)
|
||||||
baits[file.nameWithoutExtension] = Bait(file.nameWithoutExtension,)
|
baits[file.nameWithoutExtension] = Bait(file.nameWithoutExtension, item, rewards, config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun reload() {
|
||||||
|
baits.clear()
|
||||||
|
init()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -38,6 +38,6 @@ object RodManager {
|
||||||
val durability = builder.lore.findLast { it.startsWith("§e耐久: §7") }?.replace("§e耐久: §7", "")?.toInt()
|
val durability = builder.lore.findLast { it.startsWith("§e耐久: §7") }?.replace("§e耐久: §7", "")?.toInt()
|
||||||
?: SanseFish.conf.getInt("target-rod.max-durability")
|
?: SanseFish.conf.getInt("target-rod.max-durability")
|
||||||
val luck = builder.lore.findLast { it.startsWith("§d幸运值: §7") }?.replace("§d幸运值: §7", "")?.toInt() ?: 0
|
val luck = builder.lore.findLast { it.startsWith("§d幸运值: §7") }?.replace("§d幸运值: §7", "")?.toInt() ?: 0
|
||||||
return FishingRodInstance(type!!, durability, luck)
|
return FishingRodInstance(type!!, item, durability, luck)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.misc
|
package work.microhand.sanseyooyea.sansefish.misc
|
||||||
|
|
||||||
data class Bait(val type: String, ) {
|
import org.bukkit.inventory.ItemStack
|
||||||
}
|
import taboolib.module.configuration.Configuration
|
||||||
|
|
||||||
|
data class Bait(val type: String, val item: ItemStack, val rewards: BaitReward, val config: Configuration)
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.reward
|
package work.microhand.sanseyooyea.sansefish.misc
|
||||||
|
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import work.microhand.sanseyooyea.sansefish.SanseFish
|
import taboolib.library.configuration.ConfigurationSection
|
||||||
import work.microhand.sanseyooyea.sansefish.misc.FishingRodInstance
|
|
||||||
|
|
||||||
object RewardHandler {
|
class BaitReward(config: ConfigurationSection) {
|
||||||
private val rewardList = ArrayList<Reward>()
|
private val rewardList = ArrayList<Reward>()
|
||||||
|
|
||||||
// load Rewards
|
// load Rewards
|
||||||
|
|
@ -20,7 +19,7 @@ object RewardHandler {
|
||||||
config["de-luck"] as Int
|
config["de-luck"] as Int
|
||||||
)
|
)
|
||||||
|
|
||||||
rewardList.addAll(SanseFish.conf.getList("rewards")!!.map { parseReward(it as Map<String, Any>) })
|
rewardList.addAll(config.getList("rewards")!!.map { parseReward(it as Map<String, Any>) })
|
||||||
}
|
}
|
||||||
|
|
||||||
fun doReward(player: Player, rod: FishingRodInstance) {
|
fun doReward(player: Player, rod: FishingRodInstance) {
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.misc
|
package work.microhand.sanseyooyea.sansefish.misc
|
||||||
|
|
||||||
import org.bukkit.Material
|
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
import work.microhand.sanseyooyea.sansefish.misc.FishingRodInstance
|
|
||||||
|
|
||||||
data class FishRod(val type: String, val lore: String, val maxDurability: Int, val defaultLuck: Int) {
|
data class FishRod(val type: String, val lore: String, val maxDurability: Int, val defaultLuck: Int) {
|
||||||
fun buildFishingRod(): ItemStack = FishingRodInstance(this).updateFishingRod(ItemStack(Material.FISHING_ROD))
|
fun buildFishingRod(): ItemStack = FishingRodInstance(this).updateFishingRod()
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,20 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.misc
|
package work.microhand.sanseyooyea.sansefish.misc
|
||||||
|
|
||||||
|
import org.bukkit.Material
|
||||||
|
import org.bukkit.event.player.PlayerFishEvent
|
||||||
import org.bukkit.inventory.ItemStack
|
import org.bukkit.inventory.ItemStack
|
||||||
|
import org.bukkit.persistence.PersistentDataType
|
||||||
import taboolib.platform.util.buildItem
|
import taboolib.platform.util.buildItem
|
||||||
import work.microhand.sanseyooyea.sansefish.SanseFish
|
import work.microhand.sanseyooyea.sansefish.SanseFish
|
||||||
|
import work.microhand.sanseyooyea.sansefish.manager.BaitManager
|
||||||
|
|
||||||
data class FishingRodInstance(
|
data class FishingRodInstance(
|
||||||
val type: FishRod,
|
val type: FishRod,
|
||||||
|
val item: ItemStack = ItemStack(Material.FISHING_ROD),
|
||||||
var durability: Int = type.maxDurability,
|
var durability: Int = type.maxDurability,
|
||||||
var luck: Int = type.defaultLuck,
|
var luck: Int = type.defaultLuck,
|
||||||
) {
|
) {
|
||||||
fun updateFishingRod(legacy: ItemStack): ItemStack = buildItem(legacy) {
|
fun updateFishingRod(): ItemStack = buildItem(item) {
|
||||||
lore.clear()
|
lore.clear()
|
||||||
lore.addAll(listOf("", "", "§8神奇的鱼竿"))
|
lore.addAll(listOf("", "", "§8神奇的鱼竿"))
|
||||||
lore[0] = "§e耐久: §7$durability"
|
lore[0] = "§e耐久: §7$durability"
|
||||||
|
|
@ -17,4 +22,13 @@ data class FishingRodInstance(
|
||||||
val durabilityPercentage = (durability.toDouble() / SanseFish.conf.getInt("target-rod.max-durability", 100))
|
val durabilityPercentage = (durability.toDouble() / SanseFish.conf.getInt("target-rod.max-durability", 100))
|
||||||
damage = (64 * (1 - durabilityPercentage)).toInt()
|
damage = (64 * (1 - durabilityPercentage)).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun handleFished(fishEvent: PlayerFishEvent) {
|
||||||
|
fishEvent.expToDrop = 0
|
||||||
|
luck++
|
||||||
|
fishEvent.caught!!.remove()
|
||||||
|
fishEvent.player.inventory.itemInMainHand
|
||||||
|
val bait = BaitManager.baits[item.itemMeta!!.persistentDataContainer[SanseFish.baitKey, PersistentDataType.STRING]?: return]!!
|
||||||
|
bait.rewards.doReward(fishEvent.player, this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package work.microhand.sanseyooyea.sansefish.reward
|
package work.microhand.sanseyooyea.sansefish.misc
|
||||||
|
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import taboolib.common.platform.function.console
|
import taboolib.common.platform.function.console
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package work.microhand.sanseyooyea.sansefish.ui
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player
|
||||||
|
import org.bukkit.inventory.PlayerInventory
|
||||||
|
import org.bukkit.persistence.PersistentDataType
|
||||||
|
import taboolib.common.platform.function.console
|
||||||
|
import taboolib.module.ui.buildMenu
|
||||||
|
import taboolib.module.ui.type.Basic
|
||||||
|
import taboolib.module.ui.type.Linked
|
||||||
|
import work.microhand.sanseyooyea.sansefish.SanseFish
|
||||||
|
import work.microhand.sanseyooyea.sansefish.manager.BaitManager
|
||||||
|
import work.microhand.sanseyooyea.sansefish.misc.Bait
|
||||||
|
|
||||||
|
class BaitUI(private val player: Player) {
|
||||||
|
private val baits = HashMap<Bait, Int>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
player.inventory.forEach {
|
||||||
|
val bait = BaitManager.parseBait(it) ?: return@forEach
|
||||||
|
baits[bait] = baits.getOrDefault(bait, 0) + it.amount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun open() {
|
||||||
|
val menu = buildMenu<Linked<Bait>> {
|
||||||
|
rows(6)
|
||||||
|
baits.onEachIndexed { index, (bait, count) ->
|
||||||
|
val item = bait.item.clone()
|
||||||
|
item.amount = if (count >= 64) 64 else count
|
||||||
|
set(index, item) {
|
||||||
|
isCancelled = true
|
||||||
|
player.inventory.removeItem(bait.item)
|
||||||
|
player.inventory.itemInMainHand.itemMeta!!.persistentDataContainer[SanseFish.baitKey, PersistentDataType.STRING] = bait.type
|
||||||
|
player.sendMessage("§a| §7成功安装鱼饵")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player.openInventory(menu)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
item: null
|
||||||
|
|
||||||
|
rewards:
|
||||||
|
- items:
|
||||||
|
- "物品1"
|
||||||
|
- "物品2"
|
||||||
|
commands:
|
||||||
|
- "mm i give xxx" #钓到鱼时执行命令, %player% 为玩家
|
||||||
|
- "broadcast 玩家 %player% 钓到了好东西!"
|
||||||
|
chance: 0.2 #以小数形式存储
|
||||||
|
multiple: 0.01 # 重复出现概率
|
||||||
|
isGuarantees: false # 是否为保底物品
|
||||||
|
luck: 0 #不受幸运值限制
|
||||||
|
de-luck: 0 # 霉运物品扣除幸运值
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
lore: "&7指定钓竿"
|
lore: "&7指定钓竿"
|
||||||
max-durability: 100
|
max-durability: 100
|
||||||
luck-def: 0
|
luck-def: 0
|
||||||
|
compatible-bait:
|
||||||
|
- ""
|
||||||
Loading…
Reference in New Issue