Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
SpraxDev committed Oct 2, 2024
2 parents 3d5f5c0 + 74040bc commit e23e6d4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
6 changes: 3 additions & 3 deletions EpicAnchors-API/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.craftaro</groupId>
<artifactId>EpicAnchors-Parent</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>EpicAnchors-API</artifactId>
Expand All @@ -17,7 +17,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<version>3.10.0</version>

<executions>
<execution>
Expand All @@ -38,7 +38,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>

<executions>
<execution>
Expand Down
6 changes: 3 additions & 3 deletions EpicAnchors-Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.craftaro</groupId>
<artifactId>EpicAnchors-Parent</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>EpicAnchors-Plugin</artifactId>
Expand All @@ -17,7 +17,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.2</version>
<version>3.6.0</version>

<executions>
<execution>
Expand Down Expand Up @@ -56,10 +56,10 @@
<excludeDefaults>false</excludeDefaults>
<includes>
<include>**/nms/v*/**</include>
<include>**/third_party/net/kyori/**</include>
</includes>
<excludes>
<exclude>**/third_party/org/apache/**</exclude>
<exclude>**/third_party/net/kyori/**</exclude>
<exclude>**/third_party/com/zaxxer/**</exclude>
<exclude>**/third_party/org/jooq/**</exclude>
<exclude>**/third_party/org/mariadb/**</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private String formatAnchorText(int ticks, boolean shorten) {
String remaining;

if (ticks < 0) {
remaining = this.plugin.getLocale().getMessage("Infinite").getMessage();
remaining = this.plugin.getLocale().getMessage("Infinite").toText();
} else {
long millis = (ticks / 20L) * 1000L;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.craftaro.epicanchors.guis;

import com.craftaro.core.chat.AdventureUtils;
import com.craftaro.core.compatibility.CompatibleParticleHandler;
import com.craftaro.core.gui.Gui;
import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.hooks.EconomyManager;
import com.craftaro.core.third_party.net.kyori.adventure.text.Component;
import com.craftaro.core.utils.TextUtils;
import com.craftaro.core.utils.TimeUtils;
import com.craftaro.epicanchors.EpicAnchors;
Expand All @@ -26,7 +28,7 @@ public AnchorGui(EpicAnchors plugin, Anchor anchor) {
this.anchor = anchor;

setRows(3);
setTitle(TextUtils.formatText(plugin.getLocale().getMessage("interface.anchor.title").getMessage()));
setTitle(plugin.getLocale().getMessage("interface.anchor.title").getMessage());

constructGUI();
runPreparedGuiTask(this.plugin, this, this.anchor);
Expand All @@ -36,8 +38,8 @@ private void constructGUI() {
prepareGui(this.plugin, this, this.anchor);

if (Settings.ADD_TIME_WITH_XP.getBoolean()) {
String itemName = this.plugin.getLocale().getMessage("interface.button.addtimewithxp").getMessage();
String itemLore = this.plugin.getLocale().getMessage("interface.button.addtimewithxplore")
Component itemName = this.plugin.getLocale().getMessage("interface.button.addtimewithxp").getMessage();
Component itemLore = this.plugin.getLocale().getMessage("interface.button.addtimewithxplore")
.processPlaceholder("cost", Settings.XP_COST.getInt())
.getMessage();

Expand All @@ -47,8 +49,8 @@ private void constructGUI() {
}

if (EconomyManager.isEnabled() && Settings.ADD_TIME_WITH_ECONOMY.getBoolean()) {
String itemName = this.plugin.getLocale().getMessage("interface.button.addtimewitheconomy").getMessage();
String itemLore = this.plugin.getLocale().getMessage("interface.button.addtimewitheconomylore")
Component itemName = this.plugin.getLocale().getMessage("interface.button.addtimewitheconomy").getMessage();
Component itemLore = this.plugin.getLocale().getMessage("interface.button.addtimewitheconomylore")
// EconomyManager#formatEconomy adds its own prefix/suffix
.processPlaceholder("cost", EconomyManager.formatEconomy(Settings.ECONOMY_COST.getDouble()))
.getMessage();
Expand Down Expand Up @@ -106,10 +108,10 @@ protected static void prepareGui(EpicAnchors plugin, Gui gui, Anchor anchor) {
gui.mirrorFill(1, 0, false, true, glass2);
gui.mirrorFill(1, 1, false, true, glass3);

String itemName = plugin.getLocale().getMessage("interface.anchor.smalltitle").getMessage();
String itemLore = anchor.isInfinite() ?
ChatColor.GRAY + "Infinite" :
ChatColor.GRAY + TimeUtils.makeReadable((long) ((anchor.getTicksLeft() / 20.0) * 1000)) + " remaining.";
Component itemName = plugin.getLocale().getMessage("interface.anchor.smalltitle").getMessage();
Component itemLore = AdventureUtils.formatComponent(anchor.isInfinite() ?
"§7Infinite" :
"§7" + TimeUtils.makeReadable((long) ((anchor.getTicksLeft() / 20.0) * 1000)) + " remaining.");

gui.setItem(13, GuiUtils.createButtonItem(plugin.getAnchorManager().createAnchorItem(
anchor.getTicksLeft(), anchor.getLocation().getBlock().getType()),
Expand All @@ -121,7 +123,7 @@ protected static void runPreparedGuiTask(EpicAnchors plugin, Gui gui, Anchor anc
if (anchor.getTicksLeft() == 0) {
gui.close();
} else {
String itemName = plugin.getLocale().getMessage("interface.anchor.smalltitle").getMessage();
String itemName = plugin.getLocale().getMessage("interface.anchor.smalltitle").toText();
String itemLore = anchor.isInfinite() ?
ChatColor.GRAY + "Infinite" :
ChatColor.GRAY + TimeUtils.makeReadable((long) ((anchor.getTicksLeft() / 20.0) * 1000)) + " remaining.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.craftaro.core.gui.Gui;
import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.gui.methods.Closable;
import com.craftaro.core.third_party.net.kyori.adventure.text.Component;
import com.craftaro.core.utils.TextUtils;
import com.craftaro.epicanchors.EpicAnchors;
import com.craftaro.epicanchors.api.Anchor;
Expand All @@ -28,7 +29,7 @@ public DestroyConfirmationGui(EpicAnchors plugin, Anchor anchor, Callback<Boolea
};

this.setRows(3);
this.setTitle(TextUtils.formatText(plugin.getLocale().getMessage("interface.anchor.title").getMessage()));
this.setTitle(plugin.getLocale().getMessage("interface.anchor.title").getMessage());

constructGUI();
AnchorGui.runPreparedGuiTask(this.plugin, this, this.anchor);
Expand All @@ -46,19 +47,19 @@ public DestroyConfirmationGui(EpicAnchors plugin, Anchor anchor, Callback<Boolea
private void constructGUI() {
AnchorGui.prepareGui(this.plugin, this, this.anchor);

String cancelLore = this.plugin.getLocale().getMessage("interface.button.cancelDestroyLore").getMessage();
String confirmLore = this.plugin.getLocale().getMessage("interface.button." +
Component cancelLore = this.plugin.getLocale().getMessage("interface.button.cancelDestroyLore").getMessage();
Component confirmLore = this.plugin.getLocale().getMessage("interface.button." +
(Settings.ALLOW_ANCHOR_BREAKING.getBoolean() ? "confirmDestroyLore" : "confirmDestroyLoreNoDrops"))
.getMessage();

setButton(11, GuiUtils.createButtonItem(XMaterial.RED_TERRACOTTA,
this.plugin.getLocale().getMessage("interface.button.cancelDestroy").getMessage(),
cancelLore.isEmpty() ? new String[0] : new String[]{cancelLore}),
cancelLore.equals(Component.empty()) ? new Component[0] : new Component[]{cancelLore}),
event -> this.handler.accept(null, false));

setButton(15, GuiUtils.createButtonItem(XMaterial.GREEN_TERRACOTTA,
this.plugin.getLocale().getMessage("interface.button.confirmDestroy").getMessage(),
confirmLore.isEmpty() ? new String[0] : new String[]{confirmLore}),
cancelLore.equals(Component.empty()) ? new Component[0] : new Component[]{confirmLore}),
event -> this.handler.accept(null, true));
}
}
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.craftaro</groupId>
<artifactId>EpicAnchors-Parent</artifactId>
<packaging>pom</packaging>
<version>3.1.1</version>
<version>3.3.0</version>
<!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z-DEV' to update version recursively -->

<modules>
Expand All @@ -20,7 +20,7 @@
<url>https://craftaro.com/marketplace/product/31</url>

<properties>
<craftaro.coreVersion>3.0.1-SNAPSHOT</craftaro.coreVersion>
<craftaro.coreVersion>3.5.0-SNAPSHOT</craftaro.coreVersion>

<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -44,8 +44,8 @@

<repositories>
<repository>
<id>craftaro-minecraft-plugins</id>
<url>https://repo.craftaro.com/repository/minecraft-plugins/</url>
<id>songoda-minecraft-plugins</id>
<url>https://repo.songoda.com/repository/minecraft-plugins/</url>
</repository>

<repository>
Expand Down

0 comments on commit e23e6d4

Please sign in to comment.