Update to core version 3.3.0-SNAPSHOT

This commit is contained in:
ceze88 2024-08-21 16:56:51 +02:00
parent cc10775d0c
commit 89bed57e18
10 changed files with 22 additions and 21 deletions

View File

@ -123,7 +123,7 @@
<dependency> <dependency>
<groupId>com.craftaro</groupId> <groupId>com.craftaro</groupId>
<artifactId>CraftaroCore</artifactId> <artifactId>CraftaroCore</artifactId>
<version>3.1.0-SNAPSHOT</version> <version>3.3.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -354,7 +354,7 @@ public class EpicFarming extends SongodaPlugin {
ItemStack item = Settings.FARM_BLOCK_MATERIAL.getMaterial().parseItem(); ItemStack item = Settings.FARM_BLOCK_MATERIAL.getMaterial().parseItem();
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.setDisplayName(TextUtils.formatText(Methods.formatName(level.getLevel()))); meta.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.equals("")) { if (!line.equals("")) {
meta.setLore(Collections.singletonList(line)); meta.setLore(Collections.singletonList(line));
} }

View File

@ -100,7 +100,7 @@ public class Farm implements Data {
} }
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && !ProtectionManager.canInteract(player, this.location)) { if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && !ProtectionManager.canInteract(player, this.location)) {
player.sendMessage(EpicFarming.getInstance().getLocale().getMessage("event.general.protected").getPrefixedMessage()); EpicFarming.getInstance().getLocale().getMessage("event.general.protected").sendPrefixedMessage(player);
return; return;
} }

View File

@ -9,7 +9,7 @@ public enum FarmType {
return EpicFarming.getPlugin(EpicFarming.class) return EpicFarming.getPlugin(EpicFarming.class)
.getLocale() .getLocale()
.getMessage("general.interface." + name().toLowerCase()) .getMessage("general.interface." + name().toLowerCase())
.getMessage(); .toText();
} }
} }

View File

@ -36,22 +36,22 @@ public class Level {
EpicFarming instance = EpicFarming.getPlugin(EpicFarming.class); EpicFarming instance = EpicFarming.getPlugin(EpicFarming.class);
this.description.add(instance.getLocale().getMessage("interface.button.radius") this.description.add(instance.getLocale().getMessage("interface.button.radius")
.processPlaceholder("radius", this.radius).getMessage()); .processPlaceholder("radius", this.radius).toText());
this.description.add(instance.getLocale().getMessage("interface.button.speed") this.description.add(instance.getLocale().getMessage("interface.button.speed")
.processPlaceholder("speed", this.speedMultiplier).getMessage()); .processPlaceholder("speed", this.speedMultiplier).toText());
if (this.autoReplant) { if (this.autoReplant) {
this.description.add(instance.getLocale().getMessage("interface.button.autoreplant") this.description.add(instance.getLocale().getMessage("interface.button.autoreplant")
.processPlaceholder("status", .processPlaceholder("status",
instance.getLocale().getMessage("general.interface.unlocked") instance.getLocale().getMessage("general.interface.unlocked")
.getMessage()).getMessage()); .toText()).toText());
} }
if (this.pages > 1) { if (this.pages > 1) {
this.description.add(instance.getLocale().getMessage("interface.button.pages") this.description.add(instance.getLocale().getMessage("interface.button.pages")
.processPlaceholder("amount", this.pages).getMessage()); .processPlaceholder("amount", this.pages).toText());
} }
for (Module module : this.registeredModules) { for (Module module : this.registeredModules) {

View File

@ -143,7 +143,7 @@ public class ModuleAutoBreeding extends Module {
return this.plugin.getLocale() return this.plugin.getLocale()
.getMessage("interface.button.autobreeding") .getMessage("interface.button.autobreeding")
.processPlaceholder("status", this.autoBreedCap) .processPlaceholder("status", this.autoBreedCap)
.getMessage(); .toText();
} }
private void handleStackedBreed(LivingEntity entity) { private void handleStackedBreed(LivingEntity entity) {

View File

@ -92,7 +92,7 @@ public class ModuleAutoButcher extends Module {
@Override @Override
public String getDescription() { public String getDescription() {
return this.plugin.getLocale().getMessage("interface.button.autobutcher") return this.plugin.getLocale().getMessage("interface.button.autobutcher")
.processPlaceholder("status", this.autoButcherDelay).getMessage(); .processPlaceholder("status", this.autoButcherDelay).toText();
} }
private boolean isEnabled(Farm farm) { private boolean isEnabled(Farm farm) {

View File

@ -175,8 +175,8 @@ public class ModuleAutoCollect extends Module {
return this.plugin.getLocale() return this.plugin.getLocale()
.getMessage("interface.button.autocollect") .getMessage("interface.button.autocollect")
.processPlaceholder("status", .processPlaceholder("status",
this.plugin.getLocale().getMessage("general.interface.unlocked").getMessage()) this.plugin.getLocale().getMessage("general.interface.unlocked").toText())
.getMessage(); .toText();
} }
public boolean isEnabled(Farm farm) { public boolean isEnabled(Farm farm) {
@ -283,7 +283,7 @@ public class ModuleAutoCollect extends Module {
return EpicFarming.getPlugin(EpicFarming.class) return EpicFarming.getPlugin(EpicFarming.class)
.getLocale() .getLocale()
.getMessage("general.interface." + name().replace("_", "").toLowerCase()) .getMessage("general.interface." + name().replace("_", "").toLowerCase())
.getMessage(); .toText();
} }
} }
} }

View File

@ -1,5 +1,6 @@
package com.craftaro.epicfarming.gui; package com.craftaro.epicfarming.gui;
import com.craftaro.core.chat.AdventureUtils;
import com.craftaro.core.gui.CustomizableGui; import com.craftaro.core.gui.CustomizableGui;
import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.gui.GuiUtils;
import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
@ -98,10 +99,10 @@ public class OverviewGui extends CustomizableGui {
List<String> farmLore = this.level.getDescription(); List<String> farmLore = this.level.getDescription();
farmLore.add(""); farmLore.add("");
if (nextLevel == null) { if (nextLevel == null) {
farmLore.add(this.plugin.getLocale().getMessage("event.upgrade.maxed").getMessage()); farmLore.add(this.plugin.getLocale().getMessage("event.upgrade.maxed").toText());
} else { } else {
farmLore.add(this.plugin.getLocale().getMessage("interface.button.level") farmLore.add(this.plugin.getLocale().getMessage("interface.button.level")
.processPlaceholder("level", nextLevel.getLevel()).getMessage()); .processPlaceholder("level", nextLevel.getLevel()).toText());
farmLore.addAll(nextLevel.getDescription()); farmLore.addAll(nextLevel.getDescription());
} }
@ -110,16 +111,16 @@ public class OverviewGui extends CustomizableGui {
String[] parts = this.plugin.getLocale().getMessage("interface.button.boostedstats") String[] parts = this.plugin.getLocale().getMessage("interface.button.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("\\|");
farmLore.add(""); farmLore.add("");
for (String line : parts) { for (String line : parts) {
farmLore.add(TextUtils.formatText(line)); farmLore.add(AdventureUtils.formatLegacy(line));
} }
} }
setItem("farm", 13, GuiUtils.createButtonItem(Settings.FARM_BLOCK_MATERIAL.getMaterial(XMaterial.END_ROD), setItem("farm", 13, GuiUtils.createButtonItem(Settings.FARM_BLOCK_MATERIAL.getMaterial(XMaterial.END_ROD),
this.plugin.getLocale().getMessage("general.nametag.farm") this.plugin.getLocale().getMessage("general.nametag.farm")
.processPlaceholder("level", this.level.getLevel()).getMessage(), .processPlaceholder("level", this.level.getLevel()).toText(),
farmLore)); farmLore));
if (this.player != null && Settings.UPGRADE_WITH_XP.getBoolean() && this.player.hasPermission("EpicFarming.Upgrade.XP")) { if (this.player != null && Settings.UPGRADE_WITH_XP.getBoolean() && this.player.hasPermission("EpicFarming.Upgrade.XP")) {
@ -162,9 +163,9 @@ public class OverviewGui extends CustomizableGui {
ItemMeta farmTypeMeta = farmType.getItemMeta(); ItemMeta farmTypeMeta = farmType.getItemMeta();
farmTypeMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.button.farmtype") farmTypeMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.button.farmtype")
.processPlaceholder("type", this.farm.getFarmType().translate()) .processPlaceholder("type", this.farm.getFarmType().translate())
.getMessage()); .toText());
farmTypeMeta.setLore(Collections.singletonList(this.plugin.getLocale().getMessage("interface.button.farmtypelore") farmTypeMeta.setLore(Collections.singletonList(this.plugin.getLocale().getMessage("interface.button.farmtypelore")
.getMessage())); .toText()));
farmType.setItemMeta(farmTypeMeta); farmType.setItemMeta(farmTypeMeta);
Map<Integer, Integer[]> layouts = new HashMap<>(); Map<Integer, Integer[]> layouts = new HashMap<>();

View File

@ -26,7 +26,7 @@ public class Methods {
.getLocale() .getLocale()
.getMessage("general.nametag.farm") .getMessage("general.nametag.farm")
.processPlaceholder("level", level) .processPlaceholder("level", level)
.getMessage(); .toText();
} }
public static void animate(Location location, XMaterial material) { public static void animate(Location location, XMaterial material) {