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>
<groupId>com.craftaro</groupId>
<artifactId>CraftaroCore</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.3.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

View File

@ -354,7 +354,7 @@ public class EpicFarming extends SongodaPlugin {
ItemStack item = Settings.FARM_BLOCK_MATERIAL.getMaterial().parseItem();
ItemMeta meta = item.getItemMeta();
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("")) {
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)) {
player.sendMessage(EpicFarming.getInstance().getLocale().getMessage("event.general.protected").getPrefixedMessage());
EpicFarming.getInstance().getLocale().getMessage("event.general.protected").sendPrefixedMessage(player);
return;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
package com.craftaro.epicfarming.gui;
import com.craftaro.core.chat.AdventureUtils;
import com.craftaro.core.gui.CustomizableGui;
import com.craftaro.core.gui.GuiUtils;
import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
@ -98,10 +99,10 @@ public class OverviewGui extends CustomizableGui {
List<String> farmLore = this.level.getDescription();
farmLore.add("");
if (nextLevel == null) {
farmLore.add(this.plugin.getLocale().getMessage("event.upgrade.maxed").getMessage());
farmLore.add(this.plugin.getLocale().getMessage("event.upgrade.maxed").toText());
} else {
farmLore.add(this.plugin.getLocale().getMessage("interface.button.level")
.processPlaceholder("level", nextLevel.getLevel()).getMessage());
.processPlaceholder("level", nextLevel.getLevel()).toText());
farmLore.addAll(nextLevel.getDescription());
}
@ -110,16 +111,16 @@ public class OverviewGui extends CustomizableGui {
String[] parts = this.plugin.getLocale().getMessage("interface.button.boostedstats")
.processPlaceholder("amount", Integer.toString(boostData.getMultiplier()))
.processPlaceholder("time", TimeUtils.makeReadable(boostData.getEndTime() - System.currentTimeMillis()))
.getMessage().split("\\|");
.toText().split("\\|");
farmLore.add("");
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),
this.plugin.getLocale().getMessage("general.nametag.farm")
.processPlaceholder("level", this.level.getLevel()).getMessage(),
.processPlaceholder("level", this.level.getLevel()).toText(),
farmLore));
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();
farmTypeMeta.setDisplayName(this.plugin.getLocale().getMessage("interface.button.farmtype")
.processPlaceholder("type", this.farm.getFarmType().translate())
.getMessage());
.toText());
farmTypeMeta.setLore(Collections.singletonList(this.plugin.getLocale().getMessage("interface.button.farmtypelore")
.getMessage()));
.toText()));
farmType.setItemMeta(farmTypeMeta);
Map<Integer, Integer[]> layouts = new HashMap<>();

View File

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