Added support for 1.16.

This commit is contained in:
Brianna 2020-06-28 18:16:23 -05:00
parent 21ab081415
commit c4cbc3f8fa
8 changed files with 8 additions and 63 deletions

View File

@ -99,7 +99,7 @@ public class EpicHoppers extends SongodaPlugin {
// Register commands
this.commandManager = new CommandManager(this);
this.commandManager.addCommand(new CommandEpicHoppers(this))
this.commandManager.addMainCommand("eh")
.addSubCommands(
new CommandBoost(this),
new CommandGive(this),

View File

@ -79,7 +79,7 @@ public class CommandBoost extends AbstractCommand {
@Override
public String getSyntax() {
return "/eh boost <player> <amount> [duration]";
return "boost <player> <amount> [duration]";
}
@Override

View File

@ -1,54 +0,0 @@
package com.songoda.epichoppers.commands;
import com.songoda.core.commands.AbstractCommand;
import com.songoda.epichoppers.EpicHoppers;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import java.util.List;
public class CommandEpicHoppers extends AbstractCommand {
final EpicHoppers instance;
public CommandEpicHoppers(EpicHoppers instance) {
super(false, "EpicHoppers");
this.instance = instance;
}
@Override
protected AbstractCommand.ReturnType runCommand(CommandSender sender, String... args) {
sender.sendMessage("");
instance.getLocale().newMessage("&7Version " + instance.getDescription().getVersion()
+ " Created with <3 by &5&l&oSongoda").sendPrefixedMessage(sender);
for (AbstractCommand command : instance.getCommandManager().getAllCommands()) {
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription()));
}
}
sender.sendMessage("");
return ReturnType.SUCCESS;
}
@Override
protected List<String> onTab(CommandSender sender, String... args) {
return null;
}
@Override
public String getPermissionNode() {
return null;
}
@Override
public String getSyntax() {
return "/EpicHoppers";
}
@Override
public String getDescription() {
return "Displays this page.";
}
}

View File

@ -74,7 +74,7 @@ public class CommandGive extends AbstractCommand {
@Override
public String getSyntax() {
return "/eh give [player] [level]";
return "give [player] [level]";
}
@Override

View File

@ -34,7 +34,7 @@ public class CommandReload extends AbstractCommand {
@Override
public String getSyntax() {
return "/eh reload";
return "reload";
}
@Override

View File

@ -19,7 +19,6 @@ public class CommandSettings extends AbstractCommand {
@Override
protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player) sender;
instance.getGuiManager().showGUI((Player) sender, new PluginConfigGui(instance));
return ReturnType.SUCCESS;
}
@ -36,7 +35,7 @@ public class CommandSettings extends AbstractCommand {
@Override
public String getSyntax() {
return "/eh settings";
return "settings";
}
@Override

View File

@ -182,7 +182,7 @@ public class ModuleSuction extends Module {
meta.setDisplayName(locale.getMessage("interface.hopper.suctiontitle").getMessage());
List<String> lore = new ArrayList<>();
String[] parts = locale.getMessage("interface.hopper.suctionlore")
.processPlaceholder("status", isEnabled(hopper) ? locale.getMessage("general.word.enabled").getMessage() : locale.getMessage("general.word.disabled"))
.processPlaceholder("status", isEnabled(hopper) ? locale.getMessage("general.word.enabled").getMessage() : locale.getMessage("general.word.disabled").getMessage())
.processPlaceholder("radius", getRadius(hopper)).getMessage().split("\\|");
for (String line : parts) {
lore.add(Methods.formatText(line));

View File

@ -6,8 +6,8 @@ version: maven-version-number
author: Songoda
api-version: 1.13
commands:
epichoppers:
eh:
description: View information on this plugin.
default: true
aliases: [eh]
aliases: [EpicHoppers]
usage: /eh