mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-02-18 04:41:29 +01:00
Implement new core changes
This commit is contained in:
parent
d9e5b4fd8a
commit
4e00c88e39
@ -31,17 +31,17 @@ public class Level {
|
|||||||
this.description.clear();
|
this.description.clear();
|
||||||
|
|
||||||
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.range")
|
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.range")
|
||||||
.processPlaceholder("range", this.range).getMessage());
|
.processPlaceholder("range", this.range).toText());
|
||||||
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.amount")
|
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.amount")
|
||||||
.processPlaceholder("amount", this.amount).getMessage());
|
.processPlaceholder("amount", this.amount).toText());
|
||||||
if (this.linkAmount != 1) {
|
if (this.linkAmount != 1) {
|
||||||
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.linkamount")
|
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.linkamount")
|
||||||
.processPlaceholder("amount", this.linkAmount).getMessage());
|
.processPlaceholder("amount", this.linkAmount).toText());
|
||||||
}
|
}
|
||||||
if (this.filter) {
|
if (this.filter) {
|
||||||
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.filter")
|
this.description.add(getPlugin().getLocale().getMessage("interface.hopper.filter")
|
||||||
.processPlaceholder("enabled", getPlugin().getLocale()
|
.processPlaceholder("enabled", getPlugin().getLocale()
|
||||||
.getMessage("general.word.enabled").getMessage()).getMessage());
|
.getMessage("general.word.enabled").getMessage()).toText());
|
||||||
}
|
}
|
||||||
if (this.teleport) {
|
if (this.teleport) {
|
||||||
this.description.add(getPlugin()
|
this.description.add(getPlugin()
|
||||||
@ -52,8 +52,8 @@ public class Level {
|
|||||||
getPlugin()
|
getPlugin()
|
||||||
.getLocale()
|
.getLocale()
|
||||||
.getMessage("general.word.enabled")
|
.getMessage("general.word.enabled")
|
||||||
.getMessage())
|
.toText())
|
||||||
.getMessage());
|
.toText());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Module module : this.registeredModules) {
|
for (Module module : this.registeredModules) {
|
||||||
|
@ -80,7 +80,7 @@ public class Methods {
|
|||||||
String name = getPlugin().getLocale()
|
String name = getPlugin().getLocale()
|
||||||
.getMessage("general.nametag.nameformat")
|
.getMessage("general.nametag.nameformat")
|
||||||
.processPlaceholder("level", level)
|
.processPlaceholder("level", level)
|
||||||
.getMessage();
|
.toText();
|
||||||
|
|
||||||
|
|
||||||
return TextUtils.formatText(name);
|
return TextUtils.formatText(name);
|
||||||
|
@ -235,7 +235,7 @@ public class EpicHoppers extends SongodaPlugin {
|
|||||||
ItemStack item = XMaterial.HOPPER.parseItem();
|
ItemStack item = XMaterial.HOPPER.parseItem();
|
||||||
ItemMeta itemmeta = item.getItemMeta();
|
ItemMeta itemmeta = item.getItemMeta();
|
||||||
itemmeta.setDisplayName(TextUtils.formatText(Methods.formatName(level.getLevel())));
|
itemmeta.setDisplayName(TextUtils.formatText(Methods.formatName(level.getLevel())));
|
||||||
String line = getLocale().getMessage("general.nametag.lore").getMessage();
|
String line = getLocale().getMessage("general.nametag.lore").toText();
|
||||||
if (!line.isEmpty()) {
|
if (!line.isEmpty()) {
|
||||||
itemmeta.setLore(Arrays.asList(line.split("\n")));
|
itemmeta.setLore(Arrays.asList(line.split("\n")));
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class GUIAutoSellFilter extends CustomizableGui {
|
|||||||
// Whitelist
|
// Whitelist
|
||||||
ItemStack indicatorItem = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem();
|
ItemStack indicatorItem = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem();
|
||||||
ItemMeta indicatorMeta = indicatorItem.getItemMeta();
|
ItemMeta indicatorMeta = indicatorItem.getItemMeta();
|
||||||
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.whitelist").getMessage());
|
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.whitelist").toText());
|
||||||
indicatorItem.setItemMeta(indicatorMeta);
|
indicatorItem.setItemMeta(indicatorMeta);
|
||||||
|
|
||||||
int[] whiteSlots = {0, 1, 2, 45, 46, 47};
|
int[] whiteSlots = {0, 1, 2, 45, 46, 47};
|
||||||
@ -92,7 +92,7 @@ public class GUIAutoSellFilter extends CustomizableGui {
|
|||||||
// Blacklist
|
// Blacklist
|
||||||
indicatorItem = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem();
|
indicatorItem = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem();
|
||||||
indicatorMeta = indicatorItem.getItemMeta();
|
indicatorMeta = indicatorItem.getItemMeta();
|
||||||
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.blacklist").getMessage());
|
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.blacklist").toText());
|
||||||
indicatorItem.setItemMeta(indicatorMeta);
|
indicatorItem.setItemMeta(indicatorMeta);
|
||||||
|
|
||||||
int[] blackSlots = {3, 4, 5, 48, 49, 50};
|
int[] blackSlots = {3, 4, 5, 48, 49, 50};
|
||||||
@ -113,12 +113,12 @@ public class GUIAutoSellFilter extends CustomizableGui {
|
|||||||
indicatorItem = XMaterial.PAPER.parseItem();
|
indicatorItem = XMaterial.PAPER.parseItem();
|
||||||
indicatorMeta = indicatorItem.getItemMeta();
|
indicatorMeta = indicatorItem.getItemMeta();
|
||||||
|
|
||||||
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.infotitle").getMessage());
|
indicatorMeta.setDisplayName(plugin.getLocale().getMessage("interface.autosell-filter.infotitle").toText());
|
||||||
ArrayList<String> loreInfo = new ArrayList<>();
|
ArrayList<String> loreInfo = new ArrayList<>();
|
||||||
String[] parts = plugin
|
String[] parts = plugin
|
||||||
.getLocale()
|
.getLocale()
|
||||||
.getMessage("interface.autosell-filter.infolore")
|
.getMessage("interface.autosell-filter.infolore")
|
||||||
.getMessage()
|
.toText()
|
||||||
.split("\\|");
|
.split("\\|");
|
||||||
|
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
|
@ -64,7 +64,7 @@ public class GUIFilter extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack it = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem();
|
ItemStack it = XMaterial.WHITE_STAINED_GLASS_PANE.parseItem();
|
||||||
ItemMeta itm = it.getItemMeta();
|
ItemMeta itm = it.getItemMeta();
|
||||||
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.whitelist").getMessage());
|
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.whitelist").toText());
|
||||||
it.setItemMeta(itm);
|
it.setItemMeta(itm);
|
||||||
|
|
||||||
setButton("back", 8, GuiUtils.createButtonItem(XMaterial.ARROW.parseItem(),
|
setButton("back", 8, GuiUtils.createButtonItem(XMaterial.ARROW.parseItem(),
|
||||||
@ -93,7 +93,7 @@ public class GUIFilter extends CustomizableGui {
|
|||||||
|
|
||||||
it = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem();
|
it = XMaterial.BLACK_STAINED_GLASS_PANE.parseItem();
|
||||||
itm = it.getItemMeta();
|
itm = it.getItemMeta();
|
||||||
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.blacklist").getMessage());
|
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.blacklist").toText());
|
||||||
it.setItemMeta(itm);
|
it.setItemMeta(itm);
|
||||||
|
|
||||||
int[] blackSlots = {2, 3, 47, 48};
|
int[] blackSlots = {2, 3, 47, 48};
|
||||||
@ -114,7 +114,7 @@ public class GUIFilter extends CustomizableGui {
|
|||||||
|
|
||||||
it = XMaterial.BARRIER.parseItem();
|
it = XMaterial.BARRIER.parseItem();
|
||||||
itm = it.getItemMeta();
|
itm = it.getItemMeta();
|
||||||
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.void").getMessage());
|
itm.setDisplayName(plugin.getLocale().getMessage("interface.filter.void").toText());
|
||||||
it.setItemMeta(itm);
|
it.setItemMeta(itm);
|
||||||
|
|
||||||
int[] avoid = {4, 5, 49, 50};
|
int[] avoid = {4, 5, 49, 50};
|
||||||
@ -134,9 +134,9 @@ public class GUIFilter extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack itemInfo = XMaterial.PAPER.parseItem();
|
ItemStack itemInfo = XMaterial.PAPER.parseItem();
|
||||||
ItemMeta itemMetaInfo = itemInfo.getItemMeta();
|
ItemMeta itemMetaInfo = itemInfo.getItemMeta();
|
||||||
itemMetaInfo.setDisplayName(plugin.getLocale().getMessage("interface.filter.infotitle").getMessage());
|
itemMetaInfo.setDisplayName(plugin.getLocale().getMessage("interface.filter.infotitle").toText());
|
||||||
ArrayList<String> loreInfo = new ArrayList<>();
|
ArrayList<String> loreInfo = new ArrayList<>();
|
||||||
String[] parts = plugin.getLocale().getMessage("interface.filter.infolore").getMessage().split("\\|");
|
String[] parts = plugin.getLocale().getMessage("interface.filter.infolore").toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreInfo.add(TextUtils.formatText(line));
|
loreInfo.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
@ -148,11 +148,11 @@ public class GUIFilter extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack hook = XMaterial.TRIPWIRE_HOOK.parseItem();
|
ItemStack hook = XMaterial.TRIPWIRE_HOOK.parseItem();
|
||||||
ItemMeta hookMeta = hook.getItemMeta();
|
ItemMeta hookMeta = hook.getItemMeta();
|
||||||
hookMeta.setDisplayName(plugin.getLocale().getMessage("interface.hopper.rejectsync").getMessage());
|
hookMeta.setDisplayName(plugin.getLocale().getMessage("interface.hopper.rejectsync").toText());
|
||||||
ArrayList<String> loreHook = new ArrayList<>();
|
ArrayList<String> loreHook = new ArrayList<>();
|
||||||
parts = plugin.getLocale().getMessage("interface.hopper.synclore")
|
parts = plugin.getLocale().getMessage("interface.hopper.synclore")
|
||||||
.processPlaceholder("amount", filter.getEndPoint() != null ? 1 : 0)
|
.processPlaceholder("amount", filter.getEndPoint() != null ? 1 : 0)
|
||||||
.getMessage().split("\\|");
|
.toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreHook.add(TextUtils.formatText(line));
|
loreHook.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack pearl = new ItemStack(Material.ENDER_PEARL, 1);
|
ItemStack pearl = new ItemStack(Material.ENDER_PEARL, 1);
|
||||||
ItemMeta pearlMeta = pearl.getItemMeta();
|
ItemMeta pearlMeta = pearl.getItemMeta();
|
||||||
pearlMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.perltitle").getMessage());
|
pearlMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.perltitle").toText());
|
||||||
ArrayList<String> lorePearl = new ArrayList<>();
|
ArrayList<String> lorePearl = new ArrayList<>();
|
||||||
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.perllore2")
|
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.perllore2")
|
||||||
.processPlaceholder(
|
.processPlaceholder(
|
||||||
@ -88,7 +88,7 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
? this.plugin.getLocale().getMessage("general.word.disabled").getMessage()
|
? this.plugin.getLocale().getMessage("general.word.disabled").getMessage()
|
||||||
: this.hopper.getTeleportTrigger().name()
|
: this.hopper.getTeleportTrigger().name()
|
||||||
)
|
)
|
||||||
.getMessage()
|
.toText()
|
||||||
.split("\\|");
|
.split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
lorePearl.add(TextUtils.formatText(line));
|
lorePearl.add(TextUtils.formatText(line));
|
||||||
@ -98,9 +98,9 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack filter = new ItemStack(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.COMPARATOR : Material.valueOf("REDSTONE_COMPARATOR"), 1);
|
ItemStack filter = new ItemStack(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.COMPARATOR : Material.valueOf("REDSTONE_COMPARATOR"), 1);
|
||||||
ItemMeta filterMeta = filter.getItemMeta();
|
ItemMeta filterMeta = filter.getItemMeta();
|
||||||
filterMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.filtertitle").getMessage());
|
filterMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.filtertitle").toText());
|
||||||
ArrayList<String> loreFilter = new ArrayList<>();
|
ArrayList<String> loreFilter = new ArrayList<>();
|
||||||
parts = this.plugin.getLocale().getMessage("interface.hopper.filterlore").getMessage().split("\\|");
|
parts = this.plugin.getLocale().getMessage("interface.hopper.filterlore").toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreFilter.add(TextUtils.formatText(line));
|
loreFilter.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
@ -110,14 +110,14 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack item = new ItemStack(Material.HOPPER, 1);
|
ItemStack item = new ItemStack(Material.HOPPER, 1);
|
||||||
ItemMeta itemmeta = item.getItemMeta();
|
ItemMeta itemmeta = item.getItemMeta();
|
||||||
itemmeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.currentlevel").processPlaceholder("level", level.getLevel()).getMessage());
|
itemmeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.currentlevel").processPlaceholder("level", level.getLevel()).toText());
|
||||||
List<String> lore = level.getDescription();
|
List<String> lore = level.getDescription();
|
||||||
if (this.plugin.getConfig().getBoolean("Main.Allow hopper Upgrading")) {
|
if (this.plugin.getConfig().getBoolean("Main.Allow hopper Upgrading")) {
|
||||||
lore.add("");
|
lore.add("");
|
||||||
if (nextLevel == null) {
|
if (nextLevel == null) {
|
||||||
lore.add(this.plugin.getLocale().getMessage("interface.hopper.alreadymaxed").getMessage());
|
lore.add(this.plugin.getLocale().getMessage("interface.hopper.alreadymaxed").toText());
|
||||||
} else {
|
} else {
|
||||||
lore.add(this.plugin.getLocale().getMessage("interface.hopper.nextlevel").processPlaceholder("level", nextLevel.getLevel()).getMessage());
|
lore.add(this.plugin.getLocale().getMessage("interface.hopper.nextlevel").processPlaceholder("level", nextLevel.getLevel()).toText());
|
||||||
lore.addAll(nextLevel.getDescription());
|
lore.addAll(nextLevel.getDescription());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
parts = this.plugin.getLocale().getMessage("interface.hopper.boostedstats")
|
parts = this.plugin.getLocale().getMessage("interface.hopper.boostedstats")
|
||||||
.processPlaceholder("amount", Integer.toString(boostData.getMultiplier()))
|
.processPlaceholder("amount", Integer.toString(boostData.getMultiplier()))
|
||||||
.processPlaceholder("time", TimeUtils.makeReadable(boostData.getEndTime() - System.currentTimeMillis()))
|
.processPlaceholder("time", TimeUtils.makeReadable(boostData.getEndTime() - System.currentTimeMillis()))
|
||||||
.getMessage().split("\\|");
|
.toText().split("\\|");
|
||||||
lore.add("");
|
lore.add("");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
lore.add(TextUtils.formatText(line));
|
lore.add(TextUtils.formatText(line));
|
||||||
@ -139,11 +139,11 @@ public class GUIOverview extends CustomizableGui {
|
|||||||
|
|
||||||
ItemStack hook = new ItemStack(Material.TRIPWIRE_HOOK, 1);
|
ItemStack hook = new ItemStack(Material.TRIPWIRE_HOOK, 1);
|
||||||
ItemMeta hookMeta = hook.getItemMeta();
|
ItemMeta hookMeta = hook.getItemMeta();
|
||||||
hookMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.synchopper").getMessage());
|
hookMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.synchopper").toText());
|
||||||
ArrayList<String> loreHook = new ArrayList<>();
|
ArrayList<String> loreHook = new ArrayList<>();
|
||||||
parts = this.plugin.getLocale().getMessage("interface.hopper.synclore")
|
parts = this.plugin.getLocale().getMessage("interface.hopper.synclore")
|
||||||
.processPlaceholder("amount", this.hopper.getLinkedBlocks().stream().distinct().count())
|
.processPlaceholder("amount", this.hopper.getLinkedBlocks().stream().distinct().count())
|
||||||
.getMessage().split("\\|");
|
.toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreHook.add(TextUtils.formatText(line));
|
loreHook.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class GUISmeltable extends CustomizableGui {
|
|||||||
meta.setLore(Arrays.asList(TextUtils.formatText(" &7-> &e" + CompatibleMaterial.getFurnaceResult(material).getType().name()),
|
meta.setLore(Arrays.asList(TextUtils.formatText(" &7-> &e" + CompatibleMaterial.getFurnaceResult(material).getType().name()),
|
||||||
TextUtils.formatText("&7Enabled: &6" + String.valueOf(enabled).toLowerCase() + "&7."),
|
TextUtils.formatText("&7Enabled: &6" + String.valueOf(enabled).toLowerCase() + "&7."),
|
||||||
"",
|
"",
|
||||||
this.plugin.getLocale().getMessage("interface.hopper.toggle").getMessage()));
|
this.plugin.getLocale().getMessage("interface.hopper.toggle").toText()));
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
@ -192,10 +192,10 @@ public class ModuleAutoCrafting extends Module {
|
|||||||
ItemStack crafting = XMaterial.CRAFTING_TABLE.parseItem();
|
ItemStack crafting = XMaterial.CRAFTING_TABLE.parseItem();
|
||||||
ItemMeta craftingMeta = crafting.getItemMeta();
|
ItemMeta craftingMeta = crafting.getItemMeta();
|
||||||
craftingMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.craftingtitle")
|
craftingMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.craftingtitle")
|
||||||
.getMessage());
|
.toText());
|
||||||
ArrayList<String> lorecrafting = new ArrayList<>();
|
ArrayList<String> lorecrafting = new ArrayList<>();
|
||||||
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.craftinglore")
|
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.craftinglore")
|
||||||
.getMessage().split("\\|");
|
.toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
lorecrafting.add(TextUtils.formatText(line));
|
lorecrafting.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
@ -223,8 +223,8 @@ public class ModuleAutoCrafting extends Module {
|
|||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return this.plugin.getLocale()
|
return this.plugin.getLocale()
|
||||||
.getMessage("interface.hopper.crafting")
|
.getMessage("interface.hopper.crafting")
|
||||||
.processPlaceholder("enabled", this.plugin.getLocale().getMessage("general.word.enabled").getMessage())
|
.processPlaceholder("enabled", this.plugin.getLocale().getMessage("general.word.enabled").toText())
|
||||||
.getMessage();
|
.toText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -147,13 +147,13 @@ public class ModuleAutoSell extends Module {
|
|||||||
ItemStack sellItem = XMaterial.SUNFLOWER.parseItem();
|
ItemStack sellItem = XMaterial.SUNFLOWER.parseItem();
|
||||||
ItemMeta sellMeta = sellItem.getItemMeta();
|
ItemMeta sellMeta = sellItem.getItemMeta();
|
||||||
|
|
||||||
sellMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.selltitle").getMessage());
|
sellMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.selltitle").toText());
|
||||||
ArrayList<String> loreSell = new ArrayList<>();
|
ArrayList<String> loreSell = new ArrayList<>();
|
||||||
|
|
||||||
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.selllore")
|
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.selllore")
|
||||||
.processPlaceholder("timeleft", getTime(hopper) == -9999 ? "∞" : (int) Math.floor(getTime(hopper) / 20))
|
.processPlaceholder("timeleft", getTime(hopper) == -9999 ? "∞" : (int) Math.floor(getTime(hopper) / 20))
|
||||||
.processPlaceholder("state", isNotifying(hopper))
|
.processPlaceholder("state", isNotifying(hopper))
|
||||||
.getMessage()
|
.toText()
|
||||||
.split("\\|");
|
.split("\\|");
|
||||||
|
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
@ -192,7 +192,7 @@ public class ModuleAutoSell extends Module {
|
|||||||
return this.plugin.getLocale()
|
return this.plugin.getLocale()
|
||||||
.getMessage("interface.hopper.autosell")
|
.getMessage("interface.hopper.autosell")
|
||||||
.processPlaceholder("seconds", (int) Math.floor(this.timeOut / 20))
|
.processPlaceholder("seconds", (int) Math.floor(this.timeOut / 20))
|
||||||
.getMessage();
|
.toText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -92,7 +92,7 @@ public class ModuleAutoSmelter extends Module {
|
|||||||
public ItemStack getGUIButton(Hopper hopper) {
|
public ItemStack getGUIButton(Hopper hopper) {
|
||||||
ItemStack block = XMaterial.IRON_INGOT.parseItem();
|
ItemStack block = XMaterial.IRON_INGOT.parseItem();
|
||||||
ItemMeta blockMeta = block.getItemMeta();
|
ItemMeta blockMeta = block.getItemMeta();
|
||||||
blockMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.smelttitle").getMessage());
|
blockMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.smelttitle").toText());
|
||||||
ArrayList<String> loreBlock = new ArrayList<>();
|
ArrayList<String> loreBlock = new ArrayList<>();
|
||||||
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.smeltlore")
|
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.smeltlore")
|
||||||
.processPlaceholder("timeleft", getTime(hopper) == -9999 ? "∞" : (int) Math.floor(getTime(hopper) / 20.0))
|
.processPlaceholder("timeleft", getTime(hopper) == -9999 ? "∞" : (int) Math.floor(getTime(hopper) / 20.0))
|
||||||
@ -100,7 +100,7 @@ public class ModuleAutoSmelter extends Module {
|
|||||||
this.plugin.getLocale().getMessage("general.word.enabled").getMessage() :
|
this.plugin.getLocale().getMessage("general.word.enabled").getMessage() :
|
||||||
this.plugin.getLocale().getMessage("general.word.disabled").getMessage()
|
this.plugin.getLocale().getMessage("general.word.disabled").getMessage()
|
||||||
)
|
)
|
||||||
.getMessage()
|
.toText()
|
||||||
.split("\\|");
|
.split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreBlock.add(TextUtils.formatText(line));
|
loreBlock.add(TextUtils.formatText(line));
|
||||||
@ -138,7 +138,7 @@ public class ModuleAutoSmelter extends Module {
|
|||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return this.plugin.getLocale().getMessage("interface.hopper.autosmelt")
|
return this.plugin.getLocale().getMessage("interface.hopper.autosmelt")
|
||||||
.processPlaceholder("ticks", (int) Math.floor(this.timeOut / 20.0)).getMessage();
|
.processPlaceholder("ticks", (int) Math.floor(this.timeOut / 20.0)).toText();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getTime(Hopper hopper) {
|
private int getTime(Hopper hopper) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.craftaro.epichoppers.hopper.levels.modules;
|
package com.craftaro.epichoppers.hopper.levels.modules;
|
||||||
|
|
||||||
import com.craftaro.core.SongodaPlugin;
|
import com.craftaro.core.SongodaPlugin;
|
||||||
|
import com.craftaro.core.chat.AdventureUtils;
|
||||||
import com.craftaro.core.compatibility.ServerVersion;
|
import com.craftaro.core.compatibility.ServerVersion;
|
||||||
import com.craftaro.core.gui.GuiManager;
|
import com.craftaro.core.gui.GuiManager;
|
||||||
import com.craftaro.core.utils.TextUtils;
|
import com.craftaro.core.utils.TextUtils;
|
||||||
@ -127,22 +128,20 @@ public class ModuleBlockBreak extends Module {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getGUIButton(Hopper hopper) {
|
public ItemStack getGUIButton(Hopper hopper) {
|
||||||
ItemStack block = new ItemStack(Material.IRON_ORE, 1);
|
ItemStack block = new ItemStack(Material.IRON_ORE, 1);
|
||||||
ItemMeta blockMeta = block.getItemMeta();
|
AdventureUtils.formatItemName(block, this.plugin.getLocale().getMessage("interface.hopper.blocktitle").getMessage());
|
||||||
blockMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.blocktitle").getMessage());
|
|
||||||
ArrayList<String> loreBlock = new ArrayList<>();
|
ArrayList<String> loreBlock = new ArrayList<>();
|
||||||
String[] parts = this.plugin.getLocale()
|
String[] parts = this.plugin.getLocale()
|
||||||
.getMessage("interface.hopper.blocklore")
|
.getMessage("interface.hopper.blocklore")
|
||||||
.processPlaceholder("enabled", isEnabled(hopper)
|
.processPlaceholder("enabled", isEnabled(hopper)
|
||||||
? this.plugin.getLocale().getMessage("general.word.enabled").getMessage()
|
? this.plugin.getLocale().getMessage("general.word.enabled").toText()
|
||||||
: this.plugin.getLocale().getMessage("general.word.disabled").getMessage()
|
: this.plugin.getLocale().getMessage("general.word.disabled").toText()
|
||||||
)
|
)
|
||||||
.getMessage()
|
.toText()
|
||||||
.split("\\|");
|
.split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreBlock.add(TextUtils.formatText(line));
|
loreBlock.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
blockMeta.setLore(loreBlock);
|
AdventureUtils.formatItemLore(block, loreBlock);
|
||||||
block.setItemMeta(blockMeta);
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +158,7 @@ public class ModuleBlockBreak extends Module {
|
|||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return this.plugin.getLocale().getMessage("interface.hopper.blockbreak")
|
return this.plugin.getLocale().getMessage("interface.hopper.blockbreak")
|
||||||
.processPlaceholder("ticks", this.ticksPerBreak).getMessage();
|
.processPlaceholder("ticks", this.ticksPerBreak).toText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.craftaro.epichoppers.hopper.levels.modules;
|
package com.craftaro.epichoppers.hopper.levels.modules;
|
||||||
|
|
||||||
import com.craftaro.core.SongodaPlugin;
|
import com.craftaro.core.SongodaPlugin;
|
||||||
|
import com.craftaro.core.chat.AdventureUtils;
|
||||||
import com.craftaro.core.gui.GuiManager;
|
import com.craftaro.core.gui.GuiManager;
|
||||||
import com.craftaro.core.utils.TextUtils;
|
import com.craftaro.core.utils.TextUtils;
|
||||||
import com.craftaro.epichoppers.hopper.Hopper;
|
import com.craftaro.epichoppers.hopper.Hopper;
|
||||||
@ -67,17 +68,15 @@ public class ModuleMobHopper extends Module {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getGUIButton(Hopper hopper) {
|
public ItemStack getGUIButton(Hopper hopper) {
|
||||||
ItemStack block = new ItemStack(Material.ROTTEN_FLESH, 1);
|
ItemStack block = new ItemStack(Material.ROTTEN_FLESH, 1);
|
||||||
ItemMeta blockMeta = block.getItemMeta();
|
AdventureUtils.formatItemName(block, this.plugin.getLocale().getMessage("interface.hopper.mobtitle").getMessage());
|
||||||
blockMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.hopper.mobtitle").getMessage());
|
|
||||||
ArrayList<String> loreBlock = new ArrayList<>();
|
ArrayList<String> loreBlock = new ArrayList<>();
|
||||||
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.moblore").processPlaceholder("enabled",
|
String[] parts = this.plugin.getLocale().getMessage("interface.hopper.moblore").processPlaceholder("enabled",
|
||||||
isEnabled(hopper) ? this.plugin.getLocale().getMessage("general.word.enabled").getMessage()
|
isEnabled(hopper) ? this.plugin.getLocale().getMessage("general.word.enabled").toText()
|
||||||
: this.plugin.getLocale().getMessage("general.word.disabled").getMessage()).getMessage().split("\\|");
|
: this.plugin.getLocale().getMessage("general.word.disabled").getMessage()).toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
loreBlock.add(TextUtils.formatText(line));
|
loreBlock.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
blockMeta.setLore(loreBlock);
|
AdventureUtils.formatItemLore(block, loreBlock);
|
||||||
block.setItemMeta(blockMeta);
|
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +95,7 @@ public class ModuleMobHopper extends Module {
|
|||||||
return this.plugin.getLocale()
|
return this.plugin.getLocale()
|
||||||
.getMessage("interface.hopper.mobhopper")
|
.getMessage("interface.hopper.mobhopper")
|
||||||
.processPlaceholder("ticks", this.amount)
|
.processPlaceholder("ticks", this.amount)
|
||||||
.getMessage();
|
.toText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled(Hopper hopper) {
|
public boolean isEnabled(Hopper hopper) {
|
||||||
|
@ -191,11 +191,11 @@ public class ModuleSuction extends Module {
|
|||||||
Locale locale = this.plugin.getLocale();
|
Locale locale = this.plugin.getLocale();
|
||||||
ItemStack item = XMaterial.CAULDRON.parseItem();
|
ItemStack item = XMaterial.CAULDRON.parseItem();
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
meta.setDisplayName(locale.getMessage("interface.hopper.suctiontitle").getMessage());
|
meta.setDisplayName(locale.getMessage("interface.hopper.suctiontitle").toText());
|
||||||
List<String> lore = new ArrayList<>();
|
List<String> lore = new ArrayList<>();
|
||||||
String[] parts = locale.getMessage("interface.hopper.suctionlore")
|
String[] parts = locale.getMessage("interface.hopper.suctionlore")
|
||||||
.processPlaceholder("status", isEnabled(hopper) ? locale.getMessage("general.word.enabled").getMessage() : locale.getMessage("general.word.disabled").getMessage())
|
.processPlaceholder("status", isEnabled(hopper) ? locale.getMessage("general.word.enabled").toText() : locale.getMessage("general.word.disabled").toText())
|
||||||
.processPlaceholder("radius", getRadius(hopper)).getMessage().split("\\|");
|
.processPlaceholder("radius", getRadius(hopper)).toText().split("\\|");
|
||||||
for (String line : parts) {
|
for (String line : parts) {
|
||||||
lore.add(TextUtils.formatText(line));
|
lore.add(TextUtils.formatText(line));
|
||||||
}
|
}
|
||||||
@ -247,6 +247,6 @@ public class ModuleSuction extends Module {
|
|||||||
return this.plugin.getLocale()
|
return this.plugin.getLocale()
|
||||||
.getMessage("interface.hopper.suction")
|
.getMessage("interface.hopper.suction")
|
||||||
.processPlaceholder("suction", this.maxSearchRadius)
|
.processPlaceholder("suction", this.maxSearchRadius)
|
||||||
.getMessage();
|
.toText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class BlockListeners implements Listener {
|
|||||||
int max = maxHoppers(player);
|
int max = maxHoppers(player);
|
||||||
|
|
||||||
if (max != -1 && amt > max) {
|
if (max != -1 && amt > max) {
|
||||||
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.toomany").processPlaceholder("amount", max).getMessage());
|
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.toomany").processPlaceholder("amount", max).toText());
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ public class BlockListeners implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.plugin.getHopperManager().isReady()) {
|
if (!this.plugin.getHopperManager().isReady()) {
|
||||||
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.notready").getMessage());
|
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.notready").toText());
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ public class BlockListeners implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.plugin.getHopperManager().isReady()) {
|
if (!this.plugin.getHopperManager().isReady()) {
|
||||||
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.notready").getMessage());
|
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.notready").toText());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.craftaro.epichoppers.listeners;
|
package com.craftaro.epichoppers.listeners;
|
||||||
|
|
||||||
|
import com.craftaro.core.chat.AdventureUtils;
|
||||||
import com.craftaro.core.hooks.ProtectionManager;
|
import com.craftaro.core.hooks.ProtectionManager;
|
||||||
import com.craftaro.core.hooks.WorldGuardHook;
|
import com.craftaro.core.hooks.WorldGuardHook;
|
||||||
import com.craftaro.epichoppers.hopper.Hopper;
|
import com.craftaro.epichoppers.hopper.Hopper;
|
||||||
@ -63,7 +64,7 @@ public class InteractListeners implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && ProtectionManager.canInteract(player, event.getClickedBlock().getLocation()) && WorldGuardHook.isInteractAllowed(event.getClickedBlock().getLocation())) {
|
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && ProtectionManager.canInteract(player, event.getClickedBlock().getLocation()) && WorldGuardHook.isInteractAllowed(event.getClickedBlock().getLocation())) {
|
||||||
player.sendMessage(this.plugin.getLocale().getMessage("event.general.protected").getPrefixedMessage());
|
AdventureUtils.sendMessage(this.plugin, this.plugin.getLocale().getMessage("event.general.protected").getPrefixedMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ public class InteractListeners implements Listener {
|
|||||||
if (playerData.getSyncType() == null) {
|
if (playerData.getSyncType() == null) {
|
||||||
if (event.getClickedBlock().getType() == Material.HOPPER) {
|
if (event.getClickedBlock().getType() == Material.HOPPER) {
|
||||||
if (!this.plugin.getHopperManager().isReady()) {
|
if (!this.plugin.getHopperManager().isReady()) {
|
||||||
player.sendMessage(this.plugin.getLocale().getMessage("event.hopper.notready").getMessage());
|
AdventureUtils.sendMessage(this.plugin, this.plugin.getLocale().getMessage("event.hopper.notready").getPrefixedMessage());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user