mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-26 04:25:13 +01:00
Merge pull request #85 from BentoBoxWorld/master
Merge Last Minute Changes into develop branch
This commit is contained in:
commit
4eb7a03d08
47
.github/ISSUE_TEMPLATE/bug_report.md
vendored
47
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,33 +1,34 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: "Bug \U0001F4A5"
|
||||||
|
assignees: BONNe
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Description**
|
### Description
|
||||||
A clear and concise description of what the bug is.
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
|
||||||
**Steps to reproduce the behavior:**
|
#### Steps to reproduce the behavior:
|
||||||
1. Go to '...'
|
<!-- A clear steps how problem can be replicated: -->
|
||||||
2. Click on '....'
|
<!-- 1. Edit challenge -->
|
||||||
3. Scroll down to '....'
|
<!-- 2. Try to complete challenge -->
|
||||||
4. See error
|
<!-- 3. Error: -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
|
||||||
**Expected behavior**
|
#### Server / BentoBox information:
|
||||||
A clear and concise description of what you expected to happen.
|
<!-- Please provide information from `/bentobox version` -->
|
||||||
|
<!-- Please provide information about database type for BentoBox plugin -->
|
||||||
|
<!-- Please provide information about other plugins `/pl` -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
|
||||||
**Screenshots**
|
#### Screenshots / Server log
|
||||||
If applicable, add screenshots to help explain your problem.
|
<!-- Any screenshots or videos that could help to diagnostic issue -->
|
||||||
|
<!-- Server log could help to diagnostic issue a lot faster -->
|
||||||
|
<!-- Please add links or images below this line. -->
|
||||||
|
|
||||||
**Server Information:**
|
#### Expected behavior / Additional context
|
||||||
|
<!-- Add any other context about the problem here. -->
|
||||||
[Please complete the following information:]
|
<!-- Please type below this line. -->
|
||||||
- Database being used (YAML, JSON, MySQL, MongoDB): []
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Java Version: [e.g. Java 8]
|
|
||||||
- BentoBox version: [e.g. 1.7.2.21]
|
|
||||||
- Addons installed? [Do '/bentobox version' and copy/paste from the console]
|
|
||||||
- Other plugins? [Do '/plugins' and copy/paste from the console]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
|
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,17 +1,25 @@
|
|||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: Enhancement ✨
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
### Description
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
#### Is your feature request related to a problem?
|
||||||
|
<!-- A clear and concise description of the problem you're encountering, if any. -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
#### Describe the solution you'd like us to implement.
|
||||||
A clear and concise description of what you want to happen.
|
<!-- A clear and concise description of what you want us to do to resolve your problem. -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
#### Describe alternatives you've considered.
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
<!-- Please type below this line -->
|
||||||
|
|
||||||
**Additional context**
|
#### Additional context
|
||||||
Add any other context or screenshots about the feature request here.
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
<!-- Please type below this line. -->
|
||||||
|
8
pom.xml
8
pom.xml
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>challenges</artifactId>
|
<artifactId>challenges</artifactId>
|
||||||
<version>0.5.0-SNAPSHOT</version>
|
<version>0.5.0</version>
|
||||||
|
|
||||||
<name>Challenges</name>
|
<name>Challenges</name>
|
||||||
<description>Challenges is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like ASkyBlock or AcidIsland.</description>
|
<description>Challenges is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock, AcidIsland or CaveBlock.</description>
|
||||||
<url>https://github.com/BentoBoxWorld/Challenges</url>
|
<url>https://github.com/BentoBoxWorld/Challenges</url>
|
||||||
<inceptionYear>2018</inceptionYear>
|
<inceptionYear>2018</inceptionYear>
|
||||||
|
|
||||||
@ -100,13 +100,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>bentobox</artifactId>
|
<artifactId>bentobox</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.2.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>level</artifactId>
|
<artifactId>level</artifactId>
|
||||||
<version>0.3.0-SNAPSHOT</version>
|
<version>1.2.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -1077,4 +1077,39 @@ public class ChallengesManager
|
|||||||
this.levelDatabase.deleteObject(challengeLevel);
|
this.levelDatabase.deleteObject(challengeLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
// Section: Fix world duplication issue.
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This allows to fix player data issue when world name is duplicated.
|
||||||
|
* @deprecated Will be removed in 0.7.0 release.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public void fixCorruptedPlayerData()
|
||||||
|
{
|
||||||
|
this.playersDatabase.loadObjects().forEach(playerData -> {
|
||||||
|
Map<String, Integer> completed = playerData.getChallengeStatus();
|
||||||
|
Map<String, Long> timeStamps = playerData.getChallengesTimestamp();
|
||||||
|
|
||||||
|
new ArrayList<>(completed.keySet()).forEach(challenge -> {
|
||||||
|
String correctName = challenge.replaceFirst("(\\w+)(?=(\\1))", "");
|
||||||
|
if (!correctName.isEmpty() && !correctName.equals(challenge))
|
||||||
|
{
|
||||||
|
completed.put(correctName, completed.get(challenge));
|
||||||
|
timeStamps.put(correctName, timeStamps.get(challenge));
|
||||||
|
|
||||||
|
completed.remove(challenge);
|
||||||
|
timeStamps.remove(challenge);
|
||||||
|
this.addon.log("ChallengeString was modified " + challenge + " was changed to " + correctName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.playerCacheData.put(UUID.fromString(playerData.getUniqueId()), playerData);
|
||||||
|
this.savePlayer(UUID.fromString(playerData.getUniqueId()));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
@ -12,6 +12,7 @@ import world.bentobox.bentobox.api.user.User;
|
|||||||
import world.bentobox.bentobox.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
import world.bentobox.challenges.ChallengesAddon;
|
import world.bentobox.challenges.ChallengesAddon;
|
||||||
import world.bentobox.challenges.panel.CommonGUI;
|
import world.bentobox.challenges.panel.CommonGUI;
|
||||||
|
import world.bentobox.challenges.panel.util.ConfirmationGUI;
|
||||||
import world.bentobox.challenges.utils.GuiUtils;
|
import world.bentobox.challenges.utils.GuiUtils;
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ public class AdminGUI extends CommonGUI
|
|||||||
DELETE_LEVEL,
|
DELETE_LEVEL,
|
||||||
IMPORT_CHALLENGES,
|
IMPORT_CHALLENGES,
|
||||||
BACKWARD_CHALLENGES,
|
BACKWARD_CHALLENGES,
|
||||||
|
BACKWARD_PLAYER_DATA,
|
||||||
EDIT_SETTINGS
|
EDIT_SETTINGS
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,6 +113,7 @@ public class AdminGUI extends CommonGUI
|
|||||||
// Import Challenges
|
// Import Challenges
|
||||||
panelBuilder.item(15, this.createButton(Button.IMPORT_CHALLENGES));
|
panelBuilder.item(15, this.createButton(Button.IMPORT_CHALLENGES));
|
||||||
panelBuilder.item(24, this.createButton(Button.BACKWARD_CHALLENGES));
|
panelBuilder.item(24, this.createButton(Button.BACKWARD_CHALLENGES));
|
||||||
|
panelBuilder.item(33, this.createButton(Button.BACKWARD_PLAYER_DATA));
|
||||||
|
|
||||||
// Edit Addon Settings
|
// Edit Addon Settings
|
||||||
panelBuilder.item(16, this.createButton(Button.EDIT_SETTINGS));
|
panelBuilder.item(16, this.createButton(Button.EDIT_SETTINGS));
|
||||||
@ -388,6 +391,30 @@ public class AdminGUI extends CommonGUI
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case BACKWARD_PLAYER_DATA:
|
||||||
|
{
|
||||||
|
permissionSuffix = IMPORT;
|
||||||
|
|
||||||
|
name = this.user.getTranslation("challenges.gui.buttons.admin.backward-player");
|
||||||
|
description = this.user.getTranslation("challenges.gui.descriptions.admin.backward-player");
|
||||||
|
icon = new ItemStack(Material.HOPPER);
|
||||||
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
|
|
||||||
|
new ConfirmationGUI(this.user, status -> {
|
||||||
|
if (status)
|
||||||
|
{
|
||||||
|
this.addon.getChallengesManager().fixCorruptedPlayerData();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.build();
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
glow = false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case EDIT_SETTINGS:
|
case EDIT_SETTINGS:
|
||||||
{
|
{
|
||||||
permissionSuffix = SETTINGS;
|
permissionSuffix = SETTINGS;
|
||||||
|
@ -88,8 +88,8 @@ public class ConfirmationGUI
|
|||||||
private PanelItem getButton(boolean returnValue)
|
private PanelItem getButton(boolean returnValue)
|
||||||
{
|
{
|
||||||
return new PanelItemBuilder().
|
return new PanelItemBuilder().
|
||||||
name(this.user.getTranslation("challenges.gui.admin.buttons." + (returnValue ? "accept" : "cancel"))).
|
name(this.user.getTranslation("challenges.gui.buttons.admin." + (returnValue ? "accept" : "cancel"))).
|
||||||
icon(returnValue ? Material.GRAY_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE).
|
icon(returnValue ? Material.GREEN_STAINED_GLASS_PANE : Material.RED_STAINED_GLASS_PANE).
|
||||||
clickHandler((panel, user1, clickType, i) -> {
|
clickHandler((panel, user1, clickType, i) -> {
|
||||||
this.consumer.accept(returnValue);
|
this.consumer.accept(returnValue);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
name: Challenges
|
name: Challenges
|
||||||
main: world.bentobox.challenges.ChallengesAddon
|
main: world.bentobox.challenges.ChallengesAddon
|
||||||
version: ${version}
|
version: ${version}
|
||||||
|
repository: 'BentoBoxWorld/Challenges'
|
||||||
|
|
||||||
authors: tastybento
|
authors: tastybento
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ challenges:
|
|||||||
delete-level: 'Remove level'
|
delete-level: 'Remove level'
|
||||||
import: 'Import ASkyblock Challenges'
|
import: 'Import ASkyblock Challenges'
|
||||||
backward: 'Import 0.3.0 Challenges'
|
backward: 'Import 0.3.0 Challenges'
|
||||||
|
backward-player: 'Fix 0.3.0 PlayerData'
|
||||||
settings: 'Edit Settings'
|
settings: 'Edit Settings'
|
||||||
properties: 'Properties'
|
properties: 'Properties'
|
||||||
requirements: 'Requirements'
|
requirements: 'Requirements'
|
||||||
@ -157,6 +158,7 @@ challenges:
|
|||||||
delete-challenge: 'Allows remove any Challenge.'
|
delete-challenge: 'Allows remove any Challenge.'
|
||||||
delete-level: 'Allows remove any Level.'
|
delete-level: 'Allows remove any Level.'
|
||||||
backward: 'Allows to import challenges from 0.3.0 and below addon version.'
|
backward: 'Allows to import challenges from 0.3.0 and below addon version.'
|
||||||
|
backward-player: 'Allows to fix corrupted PlayerData from 0.3.0 version.|&2USE ONLY IF NECESSARY|&2MAY NOT WORK IN ALL SITUATIONS'
|
||||||
settings: 'Allows to change addon settings.'
|
settings: 'Allows to change addon settings.'
|
||||||
properties: 'Allows to change general properties'
|
properties: 'Allows to change general properties'
|
||||||
requirements: 'Allows to manage requirements'
|
requirements: 'Allows to manage requirements'
|
||||||
@ -305,4 +307,4 @@ challenges:
|
|||||||
import-no-file: '&cCould not find challenges.yml file to import!'
|
import-no-file: '&cCould not find challenges.yml file to import!'
|
||||||
no-load: '&cError: Could not load challenges.yml. [message]'
|
no-load: '&cError: Could not load challenges.yml. [message]'
|
||||||
load-error: '&cError: Cannot load [value].'
|
load-error: '&cError: Cannot load [value].'
|
||||||
version: 5
|
version: 6
|
@ -1,93 +0,0 @@
|
|||||||
###########################################################################################
|
|
||||||
# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
|
|
||||||
# the one at http://yaml-online-parser.appspot.com #
|
|
||||||
###########################################################################################
|
|
||||||
|
|
||||||
challenges:
|
|
||||||
completed-times: "已完成 [donetimes] 次,共能完成 [maxtimes] 次"
|
|
||||||
max-reached: "达到上限 [donetimes] 次,共能完成 [maxtimes] 次"
|
|
||||||
challenge:
|
|
||||||
format: "[description]"
|
|
||||||
parameters: "[Level]"
|
|
||||||
description: "打开挑战菜单"
|
|
||||||
complete: "&B已完成"
|
|
||||||
exp-reward: "&6经验奖励:[reward]"
|
|
||||||
first-time-rewards: "&6初次完成奖励"
|
|
||||||
gui-title: "&a挑战"
|
|
||||||
incomplete: "未完成"
|
|
||||||
item-take-warning: "&c当您完成这个挑战时,所|&c有必需品都会被取走!"
|
|
||||||
items-closeby: "&c所有必需品必须在您的岛|&c上,并且要离您很近!"
|
|
||||||
level: "&F等级:[level]"
|
|
||||||
max-reached: "达到上限 [donetimes] 次,共能完成 [maxtimes] 次"
|
|
||||||
money-reward: "&6金钱奖励:$[reward]"
|
|
||||||
name: "挑战名"
|
|
||||||
name-has-completed: "[name] 已经完成了挑战 [challenge]!"
|
|
||||||
navigation: "点击查看 [level] 的挑战!"
|
|
||||||
repeatable: "本挑战可以被重复完成 [maxtimes] 次"
|
|
||||||
not-repeatable: "本挑战不能被重复完成!"
|
|
||||||
repeat-rewards: "&6重复奖励"
|
|
||||||
rewards: "&F奖励"
|
|
||||||
to-complete: "还需要完成 [challengesToDo] 次 [thisLevel] 挑战来解锁这个等级!"
|
|
||||||
you-completed: "您完成了挑战 [challenge]!"
|
|
||||||
you-repeated: "您再次完成了挑战 [challenge] !"
|
|
||||||
completechallenge:
|
|
||||||
challange-completed: "挑战:[challengename] 已经被 [name] 完成"
|
|
||||||
error:
|
|
||||||
could-not-save: "&c无法保存挑战!"
|
|
||||||
island-level: "&c您的岛屿必须达到 [number] 级才能完成挑战!"
|
|
||||||
items-not-there: "&c所有必需品必须在您的岛上,并且要离您很近!"
|
|
||||||
no-items-clicked: "&c您没有点选任何东西。正在取消。"
|
|
||||||
not-close-enough: "&c您必须站在距离所需物品 [number] 个方块内。"
|
|
||||||
not-enough-items: "&c您没有足够的 [items] 来完成挑战!"
|
|
||||||
not-on-island: "&c您必须在您的岛上才能这么做!"
|
|
||||||
reward-problem: "&c给予奖励发生错误。请联系管理员检查日志!"
|
|
||||||
you-still-need: "&c您仍需要 [amount] × [item]"
|
|
||||||
help:
|
|
||||||
command: "/challenges:&f显示挑战"
|
|
||||||
config-reloaded: "已从文件重新加载配置。"
|
|
||||||
reset-all-challenges: "重置玩家的所有挑战"
|
|
||||||
reset-challenge: "标记一个挑战为未完成"
|
|
||||||
reset-challenge-for-all: "全局为每位玩家重置(可选重复)一个挑战"
|
|
||||||
resetallchallenges:
|
|
||||||
success: "[name] 已经重置了所有的挑战。"
|
|
||||||
resetchallenge:
|
|
||||||
challenge-reset: "挑战:[challengename] 已经被 [name] 重置"
|
|
||||||
error-challenge-does-not-exist: "挑战不存在或尚未被完成"
|
|
||||||
admin:
|
|
||||||
parameters: ""
|
|
||||||
description: "挑战管理员"
|
|
||||||
import:
|
|
||||||
parameters: "[overwrite]"
|
|
||||||
description: "从 challenges.yml 导入挑战"
|
|
||||||
no-file: "&c无法找到用来导入的文件 challenges.yml!"
|
|
||||||
no-load: "&c错误:无法加载 challenges.yml。[message]"
|
|
||||||
no-levels: "警告:challenges.yml 中没有等级定义"
|
|
||||||
levels: "正在导入等级:[levels]"
|
|
||||||
number: "已导入 [number] 个挑战"
|
|
||||||
skipping: "'[challenge]' 已经存在 - 正在跳过"
|
|
||||||
overwriting: "正在覆盖 '[challenge]'"
|
|
||||||
imported: "已导入 '[challenge]'"
|
|
||||||
complete:
|
|
||||||
description: "标记挑战为已完成"
|
|
||||||
parameters: "<player> <unique challenge name>"
|
|
||||||
unknown-challenge: "&c未知挑战"
|
|
||||||
create:
|
|
||||||
description: "&6构建:"
|
|
||||||
description-item-color: "&B"
|
|
||||||
inventory:
|
|
||||||
parameters: "[challenge name]"
|
|
||||||
description: "创建一个来自物品栏的挑战"
|
|
||||||
surrounding:
|
|
||||||
parameters: "[challenge name]"
|
|
||||||
description: "创建一个来自周围环境的挑战"
|
|
||||||
hit-things: "左键敲击物体来将其加入必需品列表。右键完成。"
|
|
||||||
error:
|
|
||||||
no-name: "您必须输入挑战名"
|
|
||||||
challenge-created: "已创建 [challenge]!"
|
|
||||||
you-added: "您向挑战中添加了一个 [thing]"
|
|
||||||
seticon:
|
|
||||||
error:
|
|
||||||
no-such-challenge: "&c没有此挑战名"
|
|
||||||
description: "将挑战图标设置为当前手中物品"
|
|
||||||
parameters: "[challenge name]"
|
|
||||||
gui-title: "&a挑战管理员"
|
|
Loading…
Reference in New Issue
Block a user