mirror of
https://github.com/carm-outsource/TimeReward.git
synced 2024-09-19 19:25:49 +00:00
添加示例配置文件。
This commit is contained in:
parent
8f15e30d98
commit
ca5859e5bc
@ -0,0 +1,63 @@
|
||||
package cc.carm.plugin.timereward.data;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RewardContents {
|
||||
|
||||
public final @NotNull String id;
|
||||
|
||||
private final long time;
|
||||
private final @Nullable String name;
|
||||
private final @Nullable String permission;
|
||||
private final @NotNull List<String> commands;
|
||||
|
||||
|
||||
public RewardContents(@NotNull String id, long time,
|
||||
@Nullable String name, @Nullable String permission,
|
||||
@NotNull List<String> commands) {
|
||||
this.id = id;
|
||||
this.time = time;
|
||||
this.name = name;
|
||||
this.permission = permission;
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
public String getRewardID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public @Nullable String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public @Nullable String getPermission() {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public @NotNull List<String> getCommands() {
|
||||
return commands;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
RewardContents that = (RewardContents) o;
|
||||
return id.equals(that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -21,3 +21,27 @@ database:
|
||||
claimed: "tr_user_claimed" # 用于记录用户奖励领取情况的表
|
||||
time: "tr_user_times" # 用于记录用户在线时间的表
|
||||
|
||||
# 奖励相关配置
|
||||
rewards:
|
||||
|
||||
# 配置键名即奖励ID,支持英文、数字与下划线。
|
||||
# 确定后请不要更改,因为该键值用于存储玩家是否领取的数据
|
||||
# 如果更改,原先领取过该奖励的玩家将会自动再领取一次!
|
||||
"example":
|
||||
|
||||
# 奖励的显示名称,可以是任意字符串
|
||||
# 可以在commands 中使用 %(name) 来获取该奖励的名称
|
||||
# 也可以使用变量 %TimeReward_<奖励ID>_name% 来获取对应奖励的名称
|
||||
name: "&f[初级奖励] &e总在线时长 2小时"
|
||||
|
||||
# 该奖励自动领取需要的在线时长,单位为秒
|
||||
time: 7200
|
||||
|
||||
# 该奖励领取权限,可以不设置。
|
||||
# 若为空则所有人都可以领取;若不为空,则需要拥有该权限的玩家才能领取。
|
||||
permission: "servername.vip"
|
||||
|
||||
# 领取奖励时后台执行的指令
|
||||
# 支持PlaceholderAPI变量,指令中可以使用 %(name) 来获取该奖励的名称
|
||||
commands:
|
||||
- "say &f恭喜 &b%player_name% &f领取了奖励 &r%(name) &f! "
|
Loading…
Reference in New Issue
Block a user