mirror of
https://github.com/Auxilor/EcoJobs.git
synced 2025-12-20 15:39:26 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31980faf05 | ||
|
|
91645c13ac | ||
|
|
420279fefa | ||
|
|
e5d4cfb4ac | ||
|
|
ee3a4110ee | ||
|
|
c8ae5bd4be | ||
|
|
83ee1c2c1e | ||
|
|
f79cb8192a | ||
|
|
7d8f79a81b | ||
|
|
3571d7ddf3 | ||
|
|
ed33219f97 | ||
|
|
78cef09786 | ||
|
|
2a72f7d6ce | ||
|
|
762a871354 | ||
|
|
b101e23a86 | ||
|
|
07e1cb7797 | ||
|
|
409a84aea8 | ||
|
|
886b2e0c06 | ||
|
|
0ff5dcf670 | ||
|
|
1b93969d3b | ||
|
|
af5f5cfba6 | ||
|
|
2c726fd9ac | ||
|
|
8dbe453bc5 | ||
|
|
768d2218d0 | ||
|
|
e212762951 | ||
|
|
c5d7e07d49 | ||
|
|
88d118cdd7 |
@@ -47,8 +47,8 @@ allprojects {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'com.willfp:eco:6.45.0'
|
||||
implementation 'com.willfp:libreforge:3.120.0'
|
||||
compileOnly 'com.willfp:eco:6.46.0'
|
||||
implementation 'com.willfp:libreforge:3.129.0'
|
||||
implementation 'com.willfp:ecomponent:1.0.0'
|
||||
implementation 'org.joml:joml:1.10.4'
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.willfp.ecojobs.api.event
|
||||
|
||||
import com.willfp.ecojobs.jobs.Job
|
||||
|
||||
interface JobEvent {
|
||||
val job: Job
|
||||
}
|
||||
@@ -8,10 +8,10 @@ import org.bukkit.event.Cancellable
|
||||
|
||||
class PlayerJobExpGainEvent(
|
||||
who: Player,
|
||||
val job: Job,
|
||||
override val job: Job,
|
||||
var amount: Double,
|
||||
val isMultiply: Boolean
|
||||
) : PlayerEvent(who), Cancellable {
|
||||
) : PlayerEvent(who), Cancellable, JobEvent {
|
||||
private var cancelled = false
|
||||
|
||||
override fun setCancelled(cancel: Boolean) {
|
||||
|
||||
@@ -8,9 +8,9 @@ import org.bukkit.event.HandlerList
|
||||
|
||||
class PlayerJobJoinEvent(
|
||||
val player: OfflinePlayer,
|
||||
val job: Job,
|
||||
override val job: Job,
|
||||
val oldJob: Job?
|
||||
) : Event(), Cancellable {
|
||||
) : Event(), Cancellable, JobEvent {
|
||||
private var cancelled = false
|
||||
|
||||
override fun isCancelled() = this.cancelled
|
||||
|
||||
@@ -8,8 +8,8 @@ import org.bukkit.event.HandlerList
|
||||
|
||||
class PlayerJobLeaveEvent(
|
||||
val player: OfflinePlayer,
|
||||
val job: Job
|
||||
) : Event(), Cancellable {
|
||||
override val job: Job
|
||||
) : Event(), Cancellable, JobEvent {
|
||||
private var cancelled = false
|
||||
|
||||
override fun isCancelled() = this.cancelled
|
||||
|
||||
@@ -7,9 +7,9 @@ import org.bukkit.event.HandlerList
|
||||
|
||||
class PlayerJobLevelUpEvent(
|
||||
who: Player,
|
||||
val job: Job,
|
||||
override val job: Job,
|
||||
val level: Int
|
||||
) : PlayerEvent(who) {
|
||||
) : PlayerEvent(who), JobEvent {
|
||||
override fun getHandlers(): HandlerList {
|
||||
return handlerList
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.willfp.ecojobs.commands
|
||||
|
||||
import com.willfp.eco.core.EcoPlugin
|
||||
import com.willfp.eco.core.command.impl.PluginCommand
|
||||
import com.willfp.ecojobs.jobs.Jobs
|
||||
import com.willfp.ecojobs.jobs.JobsGUI
|
||||
import org.bukkit.command.CommandSender
|
||||
import com.willfp.ecojobs.jobs.hasJob
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.util.StringUtil
|
||||
|
||||
class CommandJobs(plugin: EcoPlugin) : PluginCommand(plugin, "jobs", "ecojobs.command.jobs", true) {
|
||||
init {
|
||||
@@ -12,8 +14,44 @@ class CommandJobs(plugin: EcoPlugin) : PluginCommand(plugin, "jobs", "ecojobs.co
|
||||
.addSubcommand(CommandLeave(plugin))
|
||||
}
|
||||
|
||||
override fun onExecute(player: CommandSender, args: List<String>) {
|
||||
player as Player
|
||||
override fun onExecute(player: Player, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
JobsGUI.open(player)
|
||||
return
|
||||
}
|
||||
|
||||
val id = args[0].lowercase()
|
||||
val job = Jobs.getByID(id)
|
||||
|
||||
if (job == null) {
|
||||
player.sendMessage(plugin.langYml.getMessage("invalid-job"))
|
||||
return
|
||||
}
|
||||
|
||||
if (!player.hasJob(job)) {
|
||||
player.sendMessage(plugin.langYml.getMessage("dont-have-job"))
|
||||
return
|
||||
}
|
||||
|
||||
job.levelGUI.open(player)
|
||||
}
|
||||
|
||||
override fun tabComplete(player: Player, args: List<String>): List<String> {
|
||||
val completions = mutableListOf<String>()
|
||||
|
||||
if (args.isEmpty()) {
|
||||
return Jobs.values().filter { player.hasJob(it) }.map { it.id }
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
StringUtil.copyPartialMatches(
|
||||
args[0],
|
||||
Jobs.values().filter { player.hasJob(it) }.map { it.id },
|
||||
completions
|
||||
)
|
||||
return completions
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ class CommandJoin(plugin: EcoPlugin) : Subcommand(plugin, "join", "ecojobs.comma
|
||||
|
||||
val completions = mutableListOf<String>()
|
||||
if (args.isEmpty()) {
|
||||
// Currently, this case is not ever reached
|
||||
return Jobs.values().filter { sender.hasJob(it) }.map { it.id }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: "&#FB8810Lumberjack"
|
||||
description: "&8&oLevel up by chopping wood"
|
||||
name: "&#FD9113Lumberjack"
|
||||
description: "&7&oLevel up by chopping wood"
|
||||
|
||||
unlocked-by-default: true
|
||||
|
||||
@@ -74,56 +74,57 @@ level-xp-requirements:
|
||||
xp-gain-methods:
|
||||
- trigger: mine_block
|
||||
multiplier: 0.5
|
||||
conditions: [ ]
|
||||
filters:
|
||||
items:
|
||||
- "*oak_log"
|
||||
- "*spruce_log"
|
||||
- "*birch_log"
|
||||
- "*jungle_log"
|
||||
- "*acacia_log"
|
||||
- "*dark_oak_log"
|
||||
- "*mangrove_log"
|
||||
- "*crimson_stem"
|
||||
- "*warped_stem"
|
||||
blocks:
|
||||
- oak_log
|
||||
- spruce_log
|
||||
- birch_log
|
||||
- jungle_log
|
||||
- acacia_log
|
||||
- dark_oak_log
|
||||
- mangrove_log
|
||||
- crimson_stem
|
||||
- warped_stem
|
||||
player_placed: false
|
||||
conditions: [ ]
|
||||
|
||||
level-placeholders:
|
||||
- id: "money"
|
||||
value: "%level% * 0.4"
|
||||
value: "%level% * 3.0"
|
||||
|
||||
effects-description:
|
||||
1:
|
||||
- "&8» &8Earn &a$%money%&8 for each log chopped."
|
||||
- "&8» &7Earn &a$%money%&7 for each log chopped."
|
||||
|
||||
rewards-description:
|
||||
1:
|
||||
- "&8» &8Earn &a$%money%&8 for each log chopped."
|
||||
- "&8» &7Earn &a$%money%&7 for each log chopped."
|
||||
|
||||
level-up-messages:
|
||||
1:
|
||||
- "&8» &8Earn &a$%money%&8 for each log chopped."
|
||||
- "&8» &7Earn &a$%money%&7 for each log chopped."
|
||||
|
||||
level-commands: [ ]
|
||||
|
||||
effects:
|
||||
- id: give_money
|
||||
args:
|
||||
every: "ceil(10 - %level% / 10)"
|
||||
amount: "0.4 * %level%"
|
||||
filters:
|
||||
items:
|
||||
- "*oak_log"
|
||||
- "*spruce_log"
|
||||
- "*birch_log"
|
||||
- "*jungle_log"
|
||||
- "*acacia_log"
|
||||
- "*dark_oak_log"
|
||||
- "*mangrove_log"
|
||||
- "*crimson_stem"
|
||||
- "*warped_stem"
|
||||
amount: "%level% * 3.0"
|
||||
triggers:
|
||||
- mine_block
|
||||
filters:
|
||||
blocks:
|
||||
- oak_log
|
||||
- spruce_log
|
||||
- birch_log
|
||||
- jungle_log
|
||||
- acacia_log
|
||||
- dark_oak_log
|
||||
- mangrove_log
|
||||
- crimson_stem
|
||||
- warped_stem
|
||||
player_placed: false
|
||||
|
||||
conditions: [ ]
|
||||
|
||||
icon: player_head texture:basehead-eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2E2MjA3MDJmODBiZDJjMjI0MmUyZjEzMWMzZjlhMjU5NDAyYjdmYTg5NzRjODZjZjM0NTBmZjczZTc3MDU5NSJ9fX0=
|
||||
icon: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjk4NWEwNWQyYTMzOWExYzFiZDdlMmE3OWFlMDAyNWI5YTEwZTg0ZGI5OWFkZjQzNThkNmViZTgzNThhZDJkOCJ9fX0=
|
||||
|
||||
@@ -35,6 +35,7 @@ messages:
|
||||
job-already-joined: "&cYou already have this job!"
|
||||
leave-current-job: "&cYou must leave your current job before joining a new one!"
|
||||
cant-leave-job: "&cYou can't leave the %job%&f job!"
|
||||
dont-have-job: "&cYou don't have this job unlocked!"
|
||||
|
||||
menu:
|
||||
title: "Jobs"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#libreforge-updater
|
||||
#Thu Nov 17 08:37:53 GMT 2022
|
||||
version=1.26.0
|
||||
#Thu Feb 09 14:11:37 GMT 2023
|
||||
version=1.36.0
|
||||
plugin-name=EcoJobs
|
||||
|
||||
Reference in New Issue
Block a user