Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RELEASE #37

Draft
wants to merge 160 commits into
base: stable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
c45b79b
➕ Added Account saving/loading framework for version 0.9.
MaFeLP Apr 21, 2021
d7d6672
📗 Added Javadoc for the newly implemented Accounts System.
MaFeLP Apr 21, 2021
b2a2b12
📗 Added Javadoc for the newly implemented Accounts System.
MaFeLP Apr 21, 2021
5905c5c
➕ Added loading of accounts to the startup routine.
MaFeLP Apr 22, 2021
aa546f7
➕ Started the linking of accounts, as requested in #33
MaFeLP Apr 22, 2021
bc7b071
➕ Added a DiscordLinker class that handles linking from Discord to Mi…
MaFeLP Apr 22, 2021
0487be8
➕ Added account linking, as requested in #33
MaFeLP Apr 22, 2021
9a770a3
➕ Added account saving to the accounts.json file.
MaFeLP Apr 22, 2021
33b4909
📗 Updated Javadoc to represent the newest Linking features.
MaFeLP Apr 22, 2021
5617859
📗 Added more commentary to better understand the code.
MaFeLP Apr 24, 2021
aa063f0
➕ Created AccountCommand framework for the minecraft command "account"
MaFeLP Apr 24, 2021
71dd182
➕ Created Account command in minecraft. Subcommands are: link, name, …
MaFeLP Apr 24, 2021
7029b7f
➡️Moved username creation on account creation from discord username t…
MaFeLP Apr 24, 2021
08aff87
➕ Added changeable usernames in the account command.
MaFeLP Apr 24, 2021
8f154fd
➕ Added subcommand 'get' to the accounts command, to get the username…
MaFeLP Apr 24, 2021
10673d1
📗 Added additional commentary.
MaFeLP Apr 24, 2021
bdc7d68
➕ Added new subcommand 'account remove <player name>' to allow accoun…
MaFeLP Apr 26, 2021
e6c5354
➕ Added new subcommand 'account save' to allow account administrators…
MaFeLP Apr 26, 2021
5f26c06
➕ Added new subcommand 'account reload' to allow account administrato…
MaFeLP Apr 26, 2021
4998242
➕ Added new subcommand 'account list' to allow allow users to list al…
MaFeLP Apr 26, 2021
d1ea0d2
🐞 Fixed a bug, where the account creation would not add the @ in fron…
MaFeLP Apr 26, 2021
09b17f5
➕ Added new method to get an Account by its username, starting with '@'.
MaFeLP Apr 26, 2021
518700e
➕ Added pinging of Accounts:
MaFeLP Apr 26, 2021
4c50971
➕ Added new toggle, so you can change, if the footer of a message sho…
MaFeLP Apr 26, 2021
8655270
➕ Added new toggle: Command messages can now be deleted by the bot.
MaFeLP Apr 26, 2021
42f8bda
📗 Updated JavaDoc
MaFeLP Apr 26, 2021
d4cfbc5
🐞 Fixed a bug, where only the last word of the message would be broad…
MaFeLP Apr 26, 2021
8de9b5e
➕ Added link freeing after an account has been linked.
MaFeLP Apr 26, 2021
a57f477
➕ Added unlinking of accounts from the minecraft side of things.
MaFeLP Apr 26, 2021
9785bb6
➕ Added unlinking of accounts on the discord side of things.
MaFeLP Apr 26, 2021
4e965ac
🐞 Fixed typo
MaFeLP May 3, 2021
d258b8a
🐞 Fixed bug, where no embed would be sent in a private channel.
MaFeLP May 3, 2021
6c6bcfe
➕ Added more debug and info statements into the console output.
MaFeLP May 4, 2021
f5fb39d
➕ Added showing of activities in the discord interface.
MaFeLP May 8, 2021
849265b
▶ Started adding whisper commands.
MaFeLP May 8, 2021
88f71d8
🐞 Fixed a bug, where the message would not be deleted on wrong usage.
MaFeLP May 8, 2021
918029a
➕ Added whispering from discord to minecraft.
MaFeLP May 12, 2021
689a385
➕ Added whispering from minecraft to discord.
MaFeLP May 13, 2021
bb8e2f0
📗 Added Javadoc to the unlink command.
MaFeLP May 13, 2021
52a81f9
🐞 Fixed an IntelliJ error with the annotations dependency.
MaFeLP May 13, 2021
fc4592d
➕ Added character and length check to the account name changing.
MaFeLP May 13, 2021
6c3b21b
➕ Added name availability check.
MaFeLP May 13, 2021
9fad5c0
➕ Added a check on the player join, where all account usernames would…
MaFeLP May 13, 2021
37414ee
🐞 Fixed a bug, where whispering would result in nothing. The cause wa…
MaFeLP May 14, 2021
c88cd93
➕ Added a success message when whispering from minecraft to discord.
MaFeLP May 14, 2021
062f699
➕ Added a Prefix for the whispered messages from discord to minecraft.
MaFeLP May 14, 2021
4d61883
🖌️ Visual Bug fix on how the private messages are being logged.
MaFeLP May 14, 2021
2d5342e
🐞 Fixed a bug, where the user would get a message, that his name is i…
MaFeLP May 14, 2021
bef1e30
🐞 Fixed a bug, where the noAccountEmbed would not be sent to the chan…
MaFeLP May 14, 2021
848cb87
🖌️ Visual Bug fix in the welcome message.
MaFeLP May 14, 2021
135e7a6
➕ Added the showing of the discord profile picture, if the user has a…
MaFeLP May 14, 2021
1646f07
➕ Added CommandListener: If enabled, sends a message to the discord c…
MaFeLP Jun 17, 2021
b912884
🔄 Updated README to represent the latest changes.
MaFeLP Jun 17, 2021
8a72a53
🔄 Updated the default configuration to have the new settings in it.
MaFeLP Jun 17, 2021
d38e6fd
➕ Added CHANGELOG for version 0.9
MaFeLP Jun 17, 2021
c27f943
📗 Added Javadoc to the CommandLister and associated methods/fields/en…
MaFeLP Jun 17, 2021
4c4aa1c
🆙 Bumped Default Java Version to 16
MaFeLP Jun 18, 2021
9a4c718
🏁 Added three more To-Do targets
MaFeLP Jun 18, 2021
287f6c3
➕ Added missing default entries to the configuration.
MaFeLP Jun 18, 2021
3f88858
➕ Added that only one account could be registered with each minecraft…
MaFeLP Jun 18, 2021
83c5394
🆙 Bumped Javacord to version 3.3.2
MaFeLP Jul 14, 2021
0c4fa94
➕ Added MainSlashCommandListener to handle all slash command interact…
MaFeLP Jul 14, 2021
310bb3e
➡️ Migrated .link to /link on discord.
MaFeLP Jul 14, 2021
64e94ec
🐞 Fixed a bug in the command parser, when empty strings are being pas…
MaFeLP Jul 14, 2021
d29504c
➡️ Migrated .unlink to the global slash command /unlink.
MaFeLP Jul 14, 2021
deeb756
➡️ Migrated .mcmsg and .whisper to discord slash commands: /mcmsg and…
MaFeLP Jul 14, 2021
54bd56f
🐞 Fixed a bug, where the bot would send an empty message to the minec…
MaFeLP Jul 14, 2021
538c3be
➕ Added slash commands on server info message
MaFeLP Jul 16, 2021
66b2d0e
➕ Migrated the CreateChannelListener to slash commands
MaFeLP Jul 16, 2021
d8a6ba4
➡️ Moved the permission TODO
MaFeLP Jul 16, 2021
c221566
➡️ Migrated the ChannelAdmin to use slash commands
MaFeLP Jul 16, 2021
bef8d18
🚫 Disabled channel creation in the setup command
MaFeLP Jul 16, 2021
124f022
🔍 Added argument checks
MaFeLP Jul 21, 2021
a3db0a4
➡️ Migrated /create role to a slash command.
MaFeLP Jul 21, 2021
7d89f91
➕ Added admin permission check for type User
MaFeLP Jul 21, 2021
93455b4
➡️ Migrated RoleAdmin to respond correctly to slash commands
MaFeLP Jul 21, 2021
42918ee
➡️ Migrated .setup to a slash command
MaFeLP Jul 21, 2021
effd1f7
➕ Added /setup to the registering method.
MaFeLP Jul 21, 2021
d727b2a
🐞 Fixed bug in slash commands
MaFeLP Jul 21, 2021
f02baac
🏎 Optimised slash command creation
MaFeLP Jul 22, 2021
820c972
➕ Added Saving of newly created roles
MaFeLP Jul 22, 2021
cd8de07
🐞 Fixed a bug in slash command /setup
MaFeLP Jul 22, 2021
412aced
🐞 Fixed a bug when creating roles
MaFeLP Jul 22, 2021
2747a92
➕ Added slash command permissions
MaFeLP Jul 22, 2021
e4532df
🐞 Fixed slash commands bug
MaFeLP Jul 24, 2021
fa68dbc
📗 Added Javadoc to LinkListener#sendLinkToken
MaFeLP Jul 24, 2021
ad1e1d7
📗 Added Javadoc to DiscordMain#registerSlashCommands
MaFeLP Jul 24, 2021
6cef280
📗 Added Javadoc to MainSlashCommandListener#onSlashCommandCreate
MaFeLP Jul 24, 2021
8287ccc
➕ Added information message about slash commands
MaFeLP Jul 24, 2021
3031aa0
🆙 Bumped build version to 0.10.0-beta
MaFeLP Jul 24, 2021
2f970e7
🆙 Updated CHANGELOG.md
MaFeLP Jul 24, 2021
92a6870
🆙 Updated README.md
MaFeLP Jul 24, 2021
7eea4f1
➡️ Refactored WhisperTabCompleter
MaFeLP Jul 25, 2021
9d659f9
➡️ Refactored the result sorting method
MaFeLP Jul 25, 2021
0752c87
📗 Added Javadoc to the ResultSorter
MaFeLP Jul 25, 2021
beb51fc
📗 Added Javadoc to the WhisperTabCompleter
MaFeLP Jul 25, 2021
cf5d86f
➕ Added getAllMinecraftAccountNames
MaFeLP Jul 25, 2021
fc949c9
➕ Added AccountTabCompleter
MaFeLP Jul 25, 2021
e755490
➕ Added ConfigTabCompleter
MaFeLP Jul 25, 2021
cf78ed8
➕ Added LinkTabCompleter
MaFeLP Jul 25, 2021
140e675
➕ Added TokenTabCompleter
MaFeLP Jul 25, 2021
4238d82
➕ Added UnlinkTabCompleter
MaFeLP Jul 25, 2021
ffc5207
🆙 Bumped build version to 0.11.0-beta
MaFeLP Jul 25, 2021
4fb8deb
➕ Added changes since last release.
MaFeLP Jul 25, 2021
812ae86
🆙 Updated README.md
MaFeLP Jul 25, 2021
a14d0e0
🆙 Updated README.md
MaFeLP Jul 25, 2021
9aab9d2
Syncronisation pull (#35)
MaFeLP Aug 4, 2021
5cc428f
Syncronisation pull (#36)
MaFeLP Aug 4, 2021
8a52291
🆙 Bumped dependency org.jetbrains.annotations to 21.0.1
MaFeLP Aug 10, 2021
7454285
➕ Added minecraft help command
MaFeLP Aug 10, 2021
a776279
✅ Enabled command /help
MaFeLP Aug 10, 2021
dd10e4e
🖌️ Visual bug fixes in help command
MaFeLP Aug 10, 2021
018ab28
🟢 Prepared for different command help pages
MaFeLP Aug 10, 2021
0a344ac
➡️ Refactored Help#sendNormalHelpMessage into Help#normalHelpMessage
MaFeLP Aug 10, 2021
c4edb02
➕ Added help for the help command
MaFeLP Aug 10, 2021
5bcd93c
➕ Added help for the config command
MaFeLP Aug 10, 2021
2667281
➕ Added help for the help command
MaFeLP Aug 10, 2021
2492070
➕ Added help for the link command
MaFeLP Aug 10, 2021
8ba5568
➕ Added help for the link command
MaFeLP Aug 10, 2021
03f0c1b
➕ Added help for the unlink command
MaFeLP Aug 10, 2021
9246446
➕ Added help for the token command
MaFeLP Aug 10, 2021
bf9a5a5
➕ Added help for the whisper command
MaFeLP Aug 10, 2021
a4d65af
➕ Added tab completion for the help command.
MaFeLP Aug 10, 2021
0be642e
🖌️ Visual bug fixes in some help pages
MaFeLP Aug 10, 2021
a66be28
🖌️ Visual bug fixes in default help page
MaFeLP Aug 10, 2021
e4b3bfe
🆙 Updated README.md
MaFeLP Aug 10, 2021
f911be9
➕ Added Help command
MaFeLP Sep 10, 2021
ebc0009
🖌️ Changed Help Embed Color
MaFeLP Sep 10, 2021
92602e1
➕ Added a help slash command
MaFeLP Jan 19, 2022
a888ae7
➕ Added Events configuration
MaFeLP Jan 19, 2022
294b7cc
🐞 Fixed /help slash command not showing up
MaFeLP Jan 19, 2022
f848a08
➕ Added discord slash command /help
MaFeLP Jan 19, 2022
80cf2d0
⇥ Refactored the Minecraft Listeners
MaFeLP Jan 19, 2022
fa204b9
➕ Added Advancement, Death, Leave and Join Listeners
MaFeLP Jan 19, 2022
7539188
Bumped required Java version to 17
MaFeLP Jan 20, 2022
191acd9
Added Java info version to the README
MaFeLP Jan 20, 2022
9682dd5
Maven(deps): Bump maven-compiler-plugin from 3.8.1 to 3.9.0
dependabot[bot] Jan 13, 2022
36f47ad
Maven(deps): Bump annotations from RELEASE to 23.0.0
dependabot[bot] Dec 10, 2021
e8188a2
🆙 Bumped Project Version number to 0.12.0-beta
MaFeLP Jan 20, 2022
a362c50
🆙 Updated the Changelog
MaFeLP Jan 20, 2022
7e42061
🐞 Fixed bug where not all Listeners are registered
MaFeLP Jan 26, 2022
f1f457b
🐞 Fixed advancements not displaying correctly
MaFeLP Jan 27, 2022
0e0fee4
🆙 Bumped plugin version to 0.12.1-beta
MaFeLP Jan 27, 2022
4124c8e
🐞 Fixed Plugin throwing an error on unknown achievement
MaFeLP Jan 27, 2022
15772ef
➕ Added packaging script for easier release
MaFeLP Jan 27, 2022
dd3fc10
Maven(deps): Bump javacord from 3.3.2 to 3.4.0
dependabot[bot] Jan 27, 2022
1445f01
🆙 Updated deprecated methods to non-deprecated ones
MaFeLP Feb 8, 2022
bcd9c25
➕ Added account slash command to discord
MaFeLP Feb 8, 2022
fedca95
🐞 Minor Bug fixes
MaFeLP Feb 18, 2022
d7e0e49
Maven(deps): Bump maven-compiler-plugin from 3.9.0 to 3.10.0
dependabot[bot] Feb 15, 2022
7ba2418
➕ Added Admin Account commands
MaFeLP Feb 18, 2022
08dec9c
🐞 Fixes bot not recognizing User mentionables
MaFeLP Feb 18, 2022
2c50a3e
➕ Added config slash command logic
MaFeLP Feb 18, 2022
c16bdcc
➕ Added error embeds to the config slash command
MaFeLP Feb 19, 2022
e519f5d
➕ Added the slash command to the list of slash commands
MaFeLP Feb 19, 2022
63e34be
🐞 Fixed cancel button not working
MaFeLP Feb 19, 2022
bae183f
🐞 Fixed commands not recognizing path and value options
MaFeLP Feb 19, 2022
bf5b1d9
➕ Added /config save and /config reload Slash commands
MaFeLP Feb 19, 2022
7e81210
🆙 Updated Version to 0.13.0-beta
MaFeLP Feb 20, 2022
6c4410c
🆙 Updated CHANGELOG.md
MaFeLP Feb 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 58 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
# Changelog
## Account and config command
➕ Added discord `/account` command<br>
➕ Added discord `/config` command for administrators

---

## Help Command & Event Listeners
➕ Added a help command for discord with nice buttons<br>
➕ Added Event Listeners for the events:

- Server starts/stops (plugin is loaded/unloaded)
- Player joins/leaves the Server
- Player gets an advancement
- Player dies

---

## Tab Completions
### v0.11.0-beta
➕ Added Tab Completion to all Minecraft commands

---

## Slash Commands Update
### v0.10.0
➕ Added Slash Commands!<br>
↳ Now use discord commands by using a slash (/) instead of the old discordCommandPrefix Entry in the config file <br><br>

**⚠️ Information about slash commands⚠️**<br>
- It can take **up to** an hour until the slash commands are registered
- This is a caching limitation put in place by discord.
- If you do not see any slash commands after this hour, please see your console log for a link!
- You **CAN NOT** use normal message commands like `.setup` anymore. Use `/setup` instead, if you are the discord server **owner** and/or the bot owner.
<br>
🚫 Removed the old discord commands, that could be used in messages.

---

## BIG Account update
### v0.9.0
➕ Added Accounts! <br>
↳ Place an account Tag in your minecraft message, and it will be replaced with a discord ping (if the user has a linked account)! <br>
↳ Added a new minecraft command `/link`: Link your minecraft and discord accounts! <br>
↳ Added a new minecraft command `/unlink`: Unlink your minecraft and discord accounts! <br>
↳ Added a new minecraft command `/account`: Manage your accounts! <br>
↳ Added a new minecraft command `/whisper`: Whisper to a friend on discord! <br>
↳ Added a new minecraft command `/dcmsg`: Whisper to a friend on discord! <br>
↳ Added a new discord command `<prefix>link`: Link your discord to your minecraft! <br>
↳ Added a new discord command `<prefix>whisper`: Whisper your message to a minecraft player! <br>
↳ Added a new discord command `<prefix>mcmsg`: Whisper your message to a minecraft player! <br>
➕ Added some more toggles: <br>
↳ The bot **can** send message with server commands and player commands to all the channels. <br>
↳ Toggle, if the footer should be displayed. <br>
↳ Toggle, if discord command messages should be deleted b the bot. <br>

---

## Small bug fixes
### v0.8.4-beta
➕ Added Error message, when then bot does not have the required permissions, to create Channels or/and roles (See issue [29](https://github.com/MaFeLP/MCDC/issues/29)). <br>
Expand Down Expand Up @@ -157,7 +214,7 @@
## v0.3.1-beta
### 🏁 Commenting update!
➕ Added building instructions with Java 8 <br>
➕ Added full Javadoc documentation in [doc](./doc) <br>
➕ Added full Javadoc documentation in [doc](https://mafelp.github.io/MCDC/doc/development/index.html) <br>
➕ Added full commentary to the full code base<br>
➕ Added [RoleAdmin.java](./src/main/java/com/github/mafelp/discord/RoleAdmin.java) to prepare for Role management in coming builds

Expand Down
64 changes: 57 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
![Java Version](https://img.shields.io/badge/Java%20Version-17-blue)

# MCDC
A [Minecraft](https://www.minecraft.net) plugin for [paper servers](https://papermc.io).

## Functions
## Features
The bot can currently do all the checked items, unchecked will be implemented in the future.
- [X] Display discord messages in the minecraft chat
- [X] Discord messages can be sent to the bot via direct message
- [X] Discord messages can be sent to any server channel the bot is present on
- [X] Display minecraft messages in a discord chat
- [X] managing a "#mincraft-server" channel on a specific discord server
- [ ] this includes that only members with a role can see this channel and write in it
<br><br>
- [ ] whisper between a discord user and a minecraft user
- [ ] linking between a discord and a minecraft account
<div class="alert alert-danger" role="alert">Remember that this plugin is currently in its beta phase!<br>
All the functionalities will be added in the future!</div>
- [X] this includes that only members with a role can see this channel and write in it
- [X] whisper between a discord user and a minecraft user
- [X] linking between a discord and a minecraft account
- [X] Toggle-able: Sending minecraft commands to the discord chats.
- [X] Slash Commands: use slash commands in the discord chat.
- [X] Tab completion in Minecraft
<br><br>
- [ ] A message in a channel that displays all online Members.
- [ ] Migrate more slash commands to discord
- [ ] `/account`
- [ ] `/config`
- [ ] Add a new command: `/help`
- [X] `/help` in minecraft
- [ ] `/help` in discord

## Installation
1. Download the latest [release](https://github.com/MaFeLP/MCDC/releases/) and put it into `<your server directory>/plugins`.
Expand Down Expand Up @@ -60,12 +70,52 @@ apiToken: 'Your API Token goes here!'
# Allowed values: any String
discordCommandPrefix: '.'

# Selects if messages that are commands should be deleted after execution.
# Allowed values: <true|false>
deleteDiscordCommandMessages: false

# Discord Channel IDs to broadcast messages to.
channelIDs:
- 1234

# Enables accounts and linking.
# Allowed values <true|false>
enableLinking: true

# Allow players to list all the accounts.
# Allowed values <true|false>
allowListAllAccounts: true

# Decides, if the config value 'serverName' should be displayed in the footer of discord messages.
# Allowed values <true|false>
showFooterInMessages: true

# The value that should be displayed below the name
activity:
# If the bot should have an activity.
enabled: true
# The type of the message, aka. the first word:
# can be set to custom, competing, listening, watching, streaming or playing
type: listening
# The text that should be displayed.
message: "your messages 👀"

# If the bot should send a message to the listening channels, if a command was executed by ...
sendCommandToDiscord:
# ... a player.
player: false
# ... the server.
server: false

# Permission section for setting permission levels
permission:
# The permissions on linking and editing accounts.
accountEdit:
# The OP level needed to remove accounts of players.
level: 3
# A list of UUIDs of Players who have a wildcard to use this command.
allowedUserUUIDs:
- a unique ID

# Permission for minecraft command /config
configEdit:
Expand Down
141 changes: 141 additions & 0 deletions bash-scripts/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/usr/bin/env bash

if [ -z "$2" ]
then
cat <<EOF
Packaging Script for MCDC

Options:
--------

Arguments:
----------
1. Path to Minecraft folder (example: "$HOME/.minecraft")
2. Version to package (example: "0.12.0-beta")

Example:
--------
bash-scripts/package.sh "$HOME/.minecraft" "0.12.0-beta"
EOF
exit 1
fi

echo ":: Building plugin with maven..."
mvn clean package verify

echo ":: Creating packaging directories"
mkdir -pv /tmp/package/plugins/mcdc
echo "==> Directory '/tmp/package/plugins/mcdc' and parents has been created!"
echo ":: Copying files"
cp -v defaultConfiguration.yml /tmp/package/plugins/mcdc/config.yml
cp -v LICENSE /tmp/package/plugins/mcdc/LICENSE
cp -v "target/mcdc-$2.jar" /tmp/package/plugins/

# Create the config file for the advancements
(
echo ":: Generating advancements.json file"
echo "==> Using Minecraft directory $1"
echo "==> Using Minecraft version 1.18"
echo "==> Using language: en_gb"
cd "$1/assets/" || exit 1
HASH=$(jq -r '.objects."minecraft/lang/en_gb.json".hash' < "indexes/1.18.json")
DIRECTORY=$(echo "$HASH" | cut -c '-2')
echo "==> Hash for file is: $HASH"
echo "==> Directory of Hash file is: $DIRECTORY"
echo "==> Extracting all advancements from the file..."
echo -n "{" > /tmp/advancements.json
grep ' "advancements.' < "objects/$DIRECTORY/$HASH" | sed -e 's/ "advancements./"/g' | tr '\n' ' ' | tr '\n' ' ' >> /tmp/advancements.json
echo "}" >> /tmp/advancements.json
sed -i 's/, }/}/g' /tmp/advancements.json
jq > "/tmp/advancements_new.json" < "/tmp/advancements.json"
mv "/tmp/advancements_new.json" "/tmp/package/plugins/mcdc/advancements.json"
echo "==> Advancement configuration created at '/tmp/package/plugins/mcdc/advancements.json'"
)

# Create the packages
(
cd /tmp/package/ || exit 1
echo ":: Creating packages"
echo "==> Creating zip package"
zip -r -9 "mcdc-$2-package.zip" plugins
echo "==> Creating tar.gz package"
tar czfv "mcdc-$2-package.tar.gz" plugins
echo ":: Creating checksums"
cat > "ReleaseMessage.md" <<EOF
## What's Changed
- 🐞
- ➡️
- ➕

## Which files do I have to download?
It depends. If you want it easy, download either \`mcdc-$2-package.tar.gz\` (for Linux and MacOS
or \`mcdc-$2-package.zip\` (for Windows). Unzip this file into your server directory.
If you want to install everything manually, download the files needed. The jar is the plugin, the config contains
default values and in the \`advancements.json\` there are default translationf or Minecraft\'s advancements.

## Installation
See [GitHub Pages](https://mafelp.github.io/MCDC/installation)

## Configuration
See [GitHub Pages](https://mafelp.github.io/MCDC/configuration)

## Commands
- Minecraft
- \`/link\`
- \`/token\`
- \`/config\`
- \`/account\`
- \`/unlink\`
- \`/whisper\`
- \`/dcmsg\`
- Discord
- \`/help\`
- \`/createChannel\`
- \`/createRole\`
- \`/link\`
- \`/setup\`
- \`/unlink\`
- \`/whisper\`
- \`/mcmsg\`

<!--TODO Add old tag-->
## Changes
- See the included Changelog
- **Full Changelog**: https://github.com/MaFeLP/MCDC/compare/vX.XX.X-beta...v$2

## Checksums:
<details>
<summary>Click to expand</summary>

- mcdc-$2-package.tar.gz
- MD5: \`$(md5sum "mcdc-$2-package.tar.gz" | cut -d ' ' -f1)\`
- SHA1: \`$(sha1sum "mcdc-$2-package.tar.gz" | cut -d ' ' -f1)\`
- SHA256: \`$(sha256sum "mcdc-$2-package.tar.gz" | cut -d ' ' -f1)\`
- SHA512: \`$(sha512sum "mcdc-$2-package.tar.gz" | cut -d ' ' -f1)\`
- mcdc-$2-package.zip
- MD5: \`$(md5sum "mcdc-$2-package.zip" | cut -d ' ' -f1)\`
- SHA1: \`$(sha1sum "mcdc-$2-package.zip" | cut -d ' ' -f1)\`
- SHA256: \`$(sha256sum "mcdc-$2-package.zip" | cut -d ' ' -f1)\`
- SHA512: \`$(sha512sum "mcdc-$2-package.zip" | cut -d ' ' -f1)\`
- mcdc-$2.jar
- MD5: \`$(md5sum "plugins/mcdc-$2.jar" | cut -d ' ' -f1)\`
- SHA1: \`$(sha1sum "plugins/mcdc-$2.jar" | cut -d ' ' -f1)\`
- SHA256: \`$(sha256sum "plugins/mcdc-$2.jar" | cut -d ' ' -f1)\`
- SHA512: \`$(sha512sum "plugins/mcdc-$2.jar" | cut -d ' ' -f1)\`

</details>
EOF
if [ -z "$EDITOR" ]
then
nano "ReleaseMessage.md"
else
"$EDITOR" "ReleaseMessage.md"
fi
echo "Done!"
)

gh release view "$2"
echo ":: Uploading assets to GitHub"
gh release upload "v$2" "/tmp/package/plugins/mcdc/advancements.json" "/tmp/package/plugins/mcdc/config.yml" "/tmp/package/plugins/mcdc/LICENSE" "/tmp/package/plugins/mcdc-$2.jar" "/tmp/package/mcdc-0.12.0-beta-package.tar.gz" "/tmp/package/mcdc-0.12.0-beta-package.zip"
echo "Printing final Release Message:"
cat "/tmp/package/ReleaseMessage.md"
52 changes: 52 additions & 0 deletions defaultConfiguration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,65 @@ apiToken: 'Your API Token goes here!'
# Allowed values: any String
discordCommandPrefix: '.'

# Selects if messages that are commands should be deleted after execution.
# Allowed values: <true|false>
deleteDiscordCommandMessages: false

# Discord Channel IDs to broadcast messages to.
channelIDs:
- 1234

# Discord Role IDs that hav permission to use slash commands
roleIDs:
- 1234

# Enables accounts and linking.
# Allowed values <true|false>
enableLinking: true

# Allow players to list all the accounts.
# Allowed values <true|false>
allowListAllAccounts: true

# Decides, if the config value 'serverName' should be displayed in the footer of discord messages.
# Allowed values <true|false>
showFooterInMessages: true

# The value that should be displayed below the name
activity:
# If the bot should have an activity.
enabled: true
# The type of the message, aka. the first word:
# can be set to custom, competing, listening, watching, streaming or playing
type: listening
# The text that should be displayed.
message: "your messages 👀"

# If the bot should send a message to the listening channels, if a command was executed by ...
sendCommandToDiscord:
# ... a player.
player: false
# ... the server.
server: false

# Server events that will trigger a message in discord
events:
- JoinEvent # When a player joins the Server
- LeaveEvent # When a player leaves the Server
- PlayerAdvancementEvent # When a player gets a new Advancement
- PlayerDeathEvent # When a Player dies
- ServerStartupEvent # When the minecraft server starts
- ServerShutdownEvent # When the minecraft server stops

# Permission section for setting permission levels
permission:
# The permissions on linking and editing accounts.
accountEdit:
# The OP level needed to remove accounts of players.
level: 3
# A list of UUIDs of Players who have a wildcard to use this command.
allowedUserUUIDs:
- a unique ID

# Permission for minecraft command /config
configEdit:
Expand Down
Loading