From 4aef55875b2473064c1bc48c845a3498f8a41f0b Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:21:14 +0100 Subject: [PATCH 01/13] Create Bug Report Form --- .github/ISSUE_TEMPLATE/bug_report.yaml | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..a54bd78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,58 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: [Bug] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Describe the bug. + placeholder: Tell us what went wrong! + validations: + required: true + - type: input + id: plugin-version + attributes: + label: Plugin Version + description: Run the `/terminatorplus` command on your server. + placeholder: 3.0-BETA + validations: + required: true + - type: input + id: server-version + attributes: + label: Server Version + description: What software version is your server running? + placeholder: Spigot 1.16.5 + validations: + required: true + - type: textarea + id: log + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + validations: + required: false + - type: textarea + id: context + attributes: + label: Additional Context + description: Add any other useful information regarding your issue + placeholder: This only happens if and when... + validations: + required: false + - type: checkboxes + id: conditions + attributes: + label: Checklist + description: By submitting this issue, you have checked the following: + options: + - label: My issue does not match any existing issues on this repo + required: true From 80df94cd3c372728ec2d74b4e51f6102d25eb255 Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:27:01 +0100 Subject: [PATCH 02/13] fix Bug Report Form YAML doesn't like the use of mapping values in this area --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index a54bd78..3c1d173 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -52,7 +52,7 @@ body: id: conditions attributes: label: Checklist - description: By submitting this issue, you have checked the following: + description: By submitting this issue, you have checked the following options: - label: My issue does not match any existing issues on this repo required: true From 8c32d0898ef62f20642135572a25e65af8116ff7 Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:30:34 +0100 Subject: [PATCH 03/13] Improve grammar --- .github/ISSUE_TEMPLATE/bug_report.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 3c1d173..1e5a157 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -20,7 +20,7 @@ body: id: plugin-version attributes: label: Plugin Version - description: Run the `/terminatorplus` command on your server. + description: What version of this plugin is your server running? Run the `/terminatorplus` command on your server. placeholder: 3.0-BETA validations: required: true @@ -44,7 +44,7 @@ body: id: context attributes: label: Additional Context - description: Add any other useful information regarding your issue + description: Add any other useful information regarding your issue. placeholder: This only happens if and when... validations: required: false @@ -52,7 +52,7 @@ body: id: conditions attributes: label: Checklist - description: By submitting this issue, you have checked the following + description: By submitting this issue, you have checked these conditions. options: - label: My issue does not match any existing issues on this repo required: true From f07bef954426ebbf3b110f7ee2191363e37c072e Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:32:24 +0100 Subject: [PATCH 04/13] Remove Bug Report Template --- .github/ISSUE_TEMPLATE/bug_report.md | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 0b3a4b4..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG] " -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**TerminatorPlus Version** -Use the `/terminatorplus` command in-game to find the version of your plugin. - -**Server Version** -Minecraft Server Version, eg: Spigot 1.16.5. - -**Additional context** -Add any other context about the problem here. From c9acf92e7dd5032e1139da9eac2a76cde64cc55b Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:32:45 +0100 Subject: [PATCH 05/13] Remove Feature Request Template --- .github/ISSUE_TEMPLATE/feature_request.md | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 55746fa..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[SUGGESTION] " -labels: '' -assignees: '' - ---- - -**Describe the feature you'd like added** -A clear and concise description of what you want added or changed. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. From de0e0e45f7fe9672e1e653795403abacd95709ed Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:44:53 +0100 Subject: [PATCH 06/13] Create Feature Request Form --- .github/ISSUE_TEMPLATE/feature_request.yaml | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..62832db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,41 @@ +name: Feature Request +description: Suggest a Feature or Improvement +title: "[Suggestion]: " +labels: [Suggestion] +assignees: [] +body: + - type: markdown + attributes: + value: | + Thanks for contributing ideas! + - type: textarea + id: feature_suggestion + attributes: + label: Feature Request + description: Describe the feature or suggest an improvement. + placeholder: Add the ability to... + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternative Options + description: Describe any alternatives you've considered. + placeholder: I tried to do this instead... + validations: + required: false + - type: textarea + id: context + attributes: + label: Additional Context + description: Add any other useful information regarding your suggestion. + validations: + required: false + - type: checkboxes + id: conditions + attributes: + label: Checklist + description: By submitting this request, you have checked these conditions. + options: + - label: My suggestion does not match any existing suggestions on this repo + required: true From 678a922a8ac297b124fed387efd79c6b7a35ff5f Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:47:05 +0100 Subject: [PATCH 07/13] Fix issue label --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 1e5a157..fa1bed6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,7 @@ name: Bug Report description: File a bug report title: "[Bug]: " -labels: [Bug] +labels: [bug] assignees: [] body: - type: markdown From e2329b66a6f42b17f9091f565dd5c44edcf0e43e Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:47:34 +0100 Subject: [PATCH 08/13] Fix enhancement label --- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 62832db..5f51244 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,7 +1,7 @@ name: Feature Request description: Suggest a Feature or Improvement title: "[Suggestion]: " -labels: [Suggestion] +labels: [enhancement] assignees: [] body: - type: markdown From 14492b225d2c9e8721aed40f9b550c418d5d221d Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:49:17 +0100 Subject: [PATCH 09/13] Improve Bug Report Form Description --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index fa1bed6..a2bc7ca 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,5 +1,5 @@ name: Bug Report -description: File a bug report +description: Report an issue title: "[Bug]: " labels: [bug] assignees: [] From 8519fcd4969d5bb83ba533adf0b478c44e19f4c7 Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:53:02 +0100 Subject: [PATCH 10/13] Create Issue Config --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..9fa595d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Community Support + url: https://discord.gg/horsenuggets + about: Please ask and answer questions here. + - name: Project Channel + url: https://youtube.com/HorseNuggets + about: Subscribe to the horse himself! From 6ca60f705b936ee9b9660ee4e173a9b728726127 Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Tue, 24 Aug 2021 15:46:44 +0100 Subject: [PATCH 11/13] Stylize the readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cuz why not 👀 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d4befb0..b9f2d1b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # TerminatorPlus [v3.0-BETA] -TerminatorPlus is a Spigot plugin that allows the creation of server-side player bots. Unlike many NPC plugins that already exist, this project has an emphasis on making the bots as human-like as possible. +![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=java&logoColor=white) +![GitHub](https://img.shields.io/github/languages/code-size/HorseNuggets/TerminatorPlus?color=cyan&label=Size&labelColor=000000&logo=GitHub&style=for-the-badge) +![GitHub](https://img.shields.io/github/license/HorseNuggets/TerminatorPlus?color=violet&logo=GitHub&labelColor=000000&style=for-the-badge) +![Discord](https://img.shields.io/discord/357333217340162069?color=5865F2&label=Discord&logo=Discord&labelColor=23272a&style=for-the-badge) + +**TerminatorPlus** is a Spigot plugin that allows the creation of server-side player bots. Unlike many NPC plugins that already exist, this project has an emphasis on making the bots as human-like as possible. ### Download From 425658b3087d28d9a1260328413f00a5440708d1 Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Wed, 25 Aug 2021 02:49:31 +0100 Subject: [PATCH 12/13] Update BotCommand.java --- .../tplus/command/commands/BotCommand.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java b/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java index 95b1774..44a4d89 100644 --- a/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java +++ b/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java @@ -15,6 +15,8 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.command.CommandSender; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.util.Vector; @@ -112,6 +114,18 @@ public class BotCommand extends CommandInstance { manager.createBots((Player) sender, args.get(1), skin, n); } + @Command( + name = "give", + desc = "Gives specified item to all bots.", + usage = "" + ) + public void give(CommandSender sender, List args) { + String item = args.get(0); + ItemStack itemToGive = new ItemStack(Material.matchMaterial(item)); + TerminatorPlus.getInstance().getManager().fetch().forEach(b -> b.setDefaultItem(itemToGive)); + sender.sendMessage(ChatColor.GREEN + "Successfully gave all bots a " + item); + } + @Command( name = "info", desc = "Information about loaded bots.", From 4ed1e3914c8f34ad2b32bf3ccc3c45a2e2a6d50b Mon Sep 17 00:00:00 2001 From: Legit4K <44619264+Legit4K@users.noreply.github.com> Date: Wed, 25 Aug 2021 03:55:30 +0100 Subject: [PATCH 13/13] Add null safety While this does account for null item validation, the CommandInstance overrides all errors on the commands that throw an IllegalAccessException --- .../tplus/command/commands/BotCommand.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java b/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java index 44a4d89..aba7605 100644 --- a/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java +++ b/src/main/java/net/nuggetmc/tplus/command/commands/BotCommand.java @@ -120,10 +120,16 @@ public class BotCommand extends CommandInstance { usage = "" ) public void give(CommandSender sender, List args) { - String item = args.get(0); - ItemStack itemToGive = new ItemStack(Material.matchMaterial(item)); - TerminatorPlus.getInstance().getManager().fetch().forEach(b -> b.setDefaultItem(itemToGive)); - sender.sendMessage(ChatColor.GREEN + "Successfully gave all bots a " + item); + String i = args.get(0); + Material item = Material.matchMaterial(i); + ItemStack itemToGive = new ItemStack(item); + + if (item == null) { + sender.sendMessage(ChatColor.RED + "Failed to give all bots a " + ChatColor.YELLOW + item); + } else { + TerminatorPlus.getInstance().getManager().fetch().forEach(b -> b.setDefaultItem(itemToGive)); + sender.sendMessage(ChatColor.GREEN + "Successfully gave all bots a " + ChatColor.BLUE + item); + } } @Command(