mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-26 12:35:37 +01:00
Merge branch 'development'
This commit is contained in:
commit
d402b8af4b
4
pom.xml
4
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>EpicHeads</artifactId>
|
<artifactId>EpicHeads</artifactId>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<version>3.2.10</version>
|
<version>3.2.11</version>
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>clean install</defaultGoal>
|
<defaultGoal>clean install</defaultGoal>
|
||||||
<finalName>EpicHeads-${project.version}</finalName>
|
<finalName>EpicHeads-${project.version}</finalName>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.15</version>
|
<version>1.16.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -60,7 +60,7 @@ public class CommandAdd extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads add <url> <name> <category>";
|
return "add <url> <name> <category>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -50,7 +50,7 @@ public class CommandBase64 extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads base64";
|
return "base64";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -98,7 +98,7 @@ public class CommandGive extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads give <player/all> <global/local> <head_id>";
|
return "give <player/all> <global/local> <head_id>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,7 +56,7 @@ public class CommandGiveToken extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads givetoken <player> <amount>";
|
return "givetoken <player> <amount>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.songoda.epicheads.commands;
|
package com.songoda.epicheads.commands;
|
||||||
|
|
||||||
|
import com.songoda.core.chat.ChatMessage;
|
||||||
import com.songoda.core.commands.AbstractCommand;
|
import com.songoda.core.commands.AbstractCommand;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
import com.songoda.epicheads.utils.Methods;
|
import com.songoda.epicheads.utils.Methods;
|
||||||
@ -20,15 +21,16 @@ public class CommandHelp extends AbstractCommand {
|
|||||||
@Override
|
@Override
|
||||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
instance.getLocale().newMessage("&7Version " + instance.getDescription().getVersion()
|
new ChatMessage().fromText(String.format("#ff8080&l%s &8» &7Version %s Created with <3 by #ec4e74&l&oS#fa5b65&l&oo#ff6c55&l&on#ff7f44&l&og#ff9432&l&oo#ffaa1e&l&od#f4c009&l&oa",
|
||||||
+ " Created with <3 by &5&l&oSongoda").sendPrefixedMessage(sender);
|
instance.getDescription().getName(), instance.getDescription().getVersion()))
|
||||||
|
.sendTo(sender);
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage(Methods.formatText("&7Welcome to EpicHeads! To get started try using the /heads command to access the heads panel."));
|
sender.sendMessage(Methods.formatText("&7Welcome to EpicHeads! To get started try using the command /heads to access the heads panel."));
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage(Methods.formatText("&6Commands:"));
|
sender.sendMessage(Methods.formatText("&6Commands:"));
|
||||||
for (AbstractCommand command : instance.getCommandManager().getAllCommands()) {
|
for (AbstractCommand command : instance.getCommandManager().getAllCommands()) {
|
||||||
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
|
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
|
||||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription()));
|
sender.sendMessage(ChatColor.DARK_GRAY + "- " + ChatColor.YELLOW + command.getSyntax() + ChatColor.GRAY + " - " + command.getDescription());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
@ -48,7 +50,7 @@ public class CommandHelp extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads help";
|
return "help";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,7 +34,7 @@ public class CommandReload extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads reload";
|
return "reload";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,7 +36,7 @@ public class CommandSearch extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads search";
|
return "search";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,7 +36,7 @@ public class CommandSettings extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads settings";
|
return "settings";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -51,7 +51,7 @@ public class CommandUrl extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSyntax() {
|
public String getSyntax() {
|
||||||
return "/heads url";
|
return "url";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,7 +63,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SEARCH:
|
case SEARCH:
|
||||||
name = plugin.getLocale().getMessage("general.word.query") + ": " + query;
|
name = plugin.getLocale().getMessage("general.word.query").getMessage() + ": " + query;
|
||||||
break;
|
break;
|
||||||
case CATEGORY:
|
case CATEGORY:
|
||||||
name = category.getName();
|
name = category.getName();
|
||||||
@ -78,7 +78,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
pages = (int) Math.ceil(numHeads / 45.0);
|
pages = (int) Math.ceil(numHeads / 45.0);
|
||||||
|
|
||||||
this.setTitle(name + " (" + numHeads + ") " + plugin.getLocale().getMessage("general.word.page") + " " + (page) + "/" + (pages));
|
this.setTitle(name + " (" + numHeads + ") " + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page) + "/" + (pages));
|
||||||
}
|
}
|
||||||
|
|
||||||
void showPage() {
|
void showPage() {
|
||||||
@ -88,7 +88,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page - 3 >= 1) {
|
if (page - 3 >= 1) {
|
||||||
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 3,
|
setButton(0, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 3,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 3)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page - 3)),
|
||||||
(event) -> changePage(-3));
|
(event) -> changePage(-3));
|
||||||
} else {
|
} else {
|
||||||
clearActions(0);
|
clearActions(0);
|
||||||
@ -97,7 +97,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page - 2 >= 1) {
|
if (page - 2 >= 1) {
|
||||||
setButton(1, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 2,
|
setButton(1, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 2,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 2)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page - 2)),
|
||||||
(event) -> changePage(-2));
|
(event) -> changePage(-2));
|
||||||
} else {
|
} else {
|
||||||
clearActions(1);
|
clearActions(1);
|
||||||
@ -106,7 +106,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page > 1) {
|
if (page > 1) {
|
||||||
setButton(2, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 1,
|
setButton(2, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page - 1,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page - 1)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page - 1)),
|
||||||
(event) -> changePage(-1));
|
(event) -> changePage(-1));
|
||||||
} else {
|
} else {
|
||||||
clearActions(2);
|
clearActions(2);
|
||||||
@ -143,7 +143,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page + 1 <= pages) {
|
if (page + 1 <= pages) {
|
||||||
setButton(6, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 1,
|
setButton(6, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 1,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 1)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page + 1)),
|
||||||
(event) -> changePage(+1));
|
(event) -> changePage(+1));
|
||||||
} else {
|
} else {
|
||||||
clearActions(6);
|
clearActions(6);
|
||||||
@ -152,7 +152,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page + 2 <= pages) {
|
if (page + 2 <= pages) {
|
||||||
setButton(7, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 2,
|
setButton(7, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 2,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 2)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page + 2)),
|
||||||
(event) -> changePage(+2));
|
(event) -> changePage(+2));
|
||||||
} else {
|
} else {
|
||||||
clearActions(7);
|
clearActions(7);
|
||||||
@ -161,7 +161,7 @@ public class GUIHeads extends Gui {
|
|||||||
|
|
||||||
if (page + 3 <= pages) {
|
if (page + 3 <= pages) {
|
||||||
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 3,
|
setButton(8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, page + 3,
|
||||||
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page") + " " + (page + 3)),
|
ChatColor.RED.toString() + plugin.getLocale().getMessage("general.word.page").getMessage() + " " + (page + 3)),
|
||||||
(event) -> changePage(+3));
|
(event) -> changePage(+3));
|
||||||
} else {
|
} else {
|
||||||
clearActions(8);
|
clearActions(8);
|
||||||
@ -223,9 +223,9 @@ public class GUIHeads extends Gui {
|
|||||||
player.getInventory().addItem(headItem);
|
player.getInventory().addItem(headItem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(inventory != null) {
|
if (inventory != null) {
|
||||||
i += 9;
|
i += 9;
|
||||||
for(; i < this.inventory.getSize(); ++i) {
|
for (; i < this.inventory.getSize(); ++i) {
|
||||||
clearActions(i);
|
clearActions(i);
|
||||||
setItem(i, null);
|
setItem(i, null);
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ public class GUIHeads extends Gui {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(EpicHeads.getInstance(), ()
|
Bukkit.getScheduler().scheduleSyncDelayedTask(EpicHeads.getInstance(), ()
|
||||||
-> guiManager.showGUI(player, new GUIHeads(plugin, player, response.getMessage(), QueryTypes.SEARCH, searchHeads)), 0L);
|
-> guiManager.showGUI(player, new GUIHeads(plugin, player, response.getMessage(), QueryTypes.SEARCH, searchHeads)), 0L);
|
||||||
}).setOnCancel(() -> {
|
}).setOnCancel(() -> {
|
||||||
player.sendMessage(plugin.getLocale().getMessage("general.search.canceled").getPrefixedMessage());
|
plugin.getLocale().getMessage("general.search.canceled").sendPrefixedMessage(player);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import com.songoda.core.compatibility.CompatibleMaterial;
|
|||||||
import com.songoda.core.utils.ItemUtils;
|
import com.songoda.core.utils.ItemUtils;
|
||||||
import com.songoda.epicheads.EpicHeads;
|
import com.songoda.epicheads.EpicHeads;
|
||||||
import com.songoda.epicheads.head.Head;
|
import com.songoda.epicheads.head.Head;
|
||||||
import com.songoda.epicheads.utils.Methods;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -27,7 +26,8 @@ public class ItemListeners implements Listener {
|
|||||||
public void itemSpawnEvent(ItemSpawnEvent event) {
|
public void itemSpawnEvent(ItemSpawnEvent event) {
|
||||||
ItemStack item = event.getEntity().getItemStack();
|
ItemStack item = event.getEntity().getItemStack();
|
||||||
|
|
||||||
if (!CompatibleMaterial.PLAYER_HEAD.matches(item)) return;
|
if (!CompatibleMaterial.PLAYER_HEAD.matches(item)
|
||||||
|
|| item.getItemMeta() != null && item.getItemMeta().hasDisplayName()) return;
|
||||||
|
|
||||||
String encodededStr = ItemUtils.getSkullTexture(item);
|
String encodededStr = ItemUtils.getSkullTexture(item);
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.songoda.epicheads.utils;
|
package com.songoda.epicheads.utils;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by songoda on 3/20/2017.
|
* Created by songoda on 3/20/2017.
|
||||||
*/
|
*/
|
||||||
@ -71,7 +73,11 @@ public enum HeadType {
|
|||||||
PILLAGER("63550f89aea88665804c2fd1b6682930c23233184fdc060991305718ed660597"),
|
PILLAGER("63550f89aea88665804c2fd1b6682930c23233184fdc060991305718ed660597"),
|
||||||
RAVAGER("d91a9d864e36fbec19b584bcb71292530755b10c4e60784fec92b51f8189363c"),
|
RAVAGER("d91a9d864e36fbec19b584bcb71292530755b10c4e60784fec92b51f8189363c"),
|
||||||
TRADER_LLAMA("6bc438fc1fbbaea2289aabecedd3fdf269ddc979bf8b5c6a8fc4bb8dcd4e1fe"),
|
TRADER_LLAMA("6bc438fc1fbbaea2289aabecedd3fdf269ddc979bf8b5c6a8fc4bb8dcd4e1fe"),
|
||||||
BEE("5162dd0b9f65b58a1e70f81d8e03e8ff6c53e4e985bdbe0186558d8a69a81189");
|
BEE("5162dd0b9f65b58a1e70f81d8e03e8ff6c53e4e985bdbe0186558d8a69a81189"),
|
||||||
|
PIGLIN("8ed4c6c5e8ba2c3ab05cb47258a4fe95bd3b92ba0a68db6d6e961d830baa0179"),
|
||||||
|
HOGLIN("6c8c7fb74e69885f294ca6652553dd5938dac1164f652d4843abe0e891453da4"),
|
||||||
|
STRIDER("16a9186a317e31e77b85a625f9d0b1cf1809f9d46a4aa153e639b60d30743fcf"),
|
||||||
|
ZOMBIFIED_PIGLIN("f05e06b1d1357a3574268a5189615983ceffc185993047da47ac947f3b7507f3");
|
||||||
|
|
||||||
private final String url;
|
private final String url;
|
||||||
|
|
||||||
|
@ -9,5 +9,5 @@ commands:
|
|||||||
EpicHeads:
|
EpicHeads:
|
||||||
description: View information on this plugin.
|
description: View information on this plugin.
|
||||||
default: true
|
default: true
|
||||||
aliases: [ehe, heads]
|
aliases: [heads, ehe]
|
||||||
usage: /epicheads
|
usage: /epicheads
|
Loading…
Reference in New Issue
Block a user