Merge pull request #12 from Legit4K/patch-2

Add /bot give command
This commit is contained in:
Chris
2021-08-25 00:25:55 -05:00
committed by GitHub
7 changed files with 133 additions and 44 deletions

View File

@@ -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.

58
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: Bug Report
description: Report an issue
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: What version of this plugin is your server running? 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 these conditions.
options:
- label: My issue does not match any existing issues on this repo
required: true

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -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!

View File

@@ -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.

View File

@@ -0,0 +1,41 @@
name: Feature Request
description: Suggest a Feature or Improvement
title: "[Suggestion]: "
labels: [enhancement]
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

View File

@@ -1,6 +1,11 @@
# TerminatorPlus [v3.0-BETA] # 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 ### Download

View File

@@ -15,6 +15,8 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@@ -112,6 +114,24 @@ public class BotCommand extends CommandInstance {
manager.createBots((Player) sender, args.get(1), skin, n); manager.createBots((Player) sender, args.get(1), skin, n);
} }
@Command(
name = "give",
desc = "Gives specified item to all bots.",
usage = "<item>"
)
public void give(CommandSender sender, List<String> args) {
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( @Command(
name = "info", name = "info",
desc = "Information about loaded bots.", desc = "Information about loaded bots.",