mirror of
https://github.com/Artillex-Studios/AxTrade.git
synced 2025-01-20 21:21:20 +01:00
Release
This commit is contained in:
parent
b1132eb6b4
commit
4c90c80b0b
14
pom.xml
14
pom.xml
@ -109,7 +109,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.artillexstudios.axapi</groupId>
|
<groupId>com.artillexstudios.axapi</groupId>
|
||||||
<artifactId>axapi</artifactId>
|
<artifactId>axapi</artifactId>
|
||||||
<version>1.4.224</version>
|
<version>1.4.232</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<classifier>all</classifier>
|
<classifier>all</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -240,12 +240,12 @@
|
|||||||
<version>2.6.4</version>
|
<version>2.6.4</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>de.rapha149.signgui</groupId>
|
<!-- <groupId>de.rapha149.signgui</groupId>-->
|
||||||
<artifactId>signgui</artifactId>
|
<!-- <artifactId>signgui</artifactId>-->
|
||||||
<version>2.3.2</version>
|
<!-- <version>2.3.2</version>-->
|
||||||
<scope>compile</scope>
|
<!-- <scope>compile</scope>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.artillexstudios</groupId>
|
<groupId>com.artillexstudios</groupId>
|
||||||
<artifactId>AxShulkers</artifactId>
|
<artifactId>AxShulkers</artifactId>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
package com.artillexstudios.axtrade.trade;
|
package com.artillexstudios.axtrade.trade;
|
||||||
|
|
||||||
|
import com.artillexstudios.axapi.gui.SignInput;
|
||||||
import com.artillexstudios.axapi.scheduler.ScheduledTask;
|
import com.artillexstudios.axapi.scheduler.ScheduledTask;
|
||||||
import com.artillexstudios.axapi.scheduler.Scheduler;
|
import com.artillexstudios.axapi.scheduler.Scheduler;
|
||||||
import com.artillexstudios.axapi.utils.StringUtils;
|
import com.artillexstudios.axapi.utils.StringUtils;
|
||||||
import com.artillexstudios.axtrade.AxTrade;
|
|
||||||
import com.artillexstudios.axtrade.utils.BlackListUtils;
|
import com.artillexstudios.axtrade.utils.BlackListUtils;
|
||||||
import com.artillexstudios.axtrade.utils.NumberUtils;
|
import com.artillexstudios.axtrade.utils.NumberUtils;
|
||||||
import com.artillexstudios.axtrade.utils.ShulkerUtils;
|
import com.artillexstudios.axtrade.utils.ShulkerUtils;
|
||||||
import com.artillexstudios.axtrade.utils.Utils;
|
import com.artillexstudios.axtrade.utils.Utils;
|
||||||
import de.rapha149.signgui.SignGUI;
|
|
||||||
import de.rapha149.signgui.SignGUIAction;
|
|
||||||
import dev.triumphteam.gui.guis.BaseGui;
|
import dev.triumphteam.gui.guis.BaseGui;
|
||||||
import dev.triumphteam.gui.guis.Gui;
|
import dev.triumphteam.gui.guis.Gui;
|
||||||
import dev.triumphteam.gui.guis.GuiItem;
|
import dev.triumphteam.gui.guis.GuiItem;
|
||||||
import dev.triumphteam.gui.guis.StorageGui;
|
import dev.triumphteam.gui.guis.StorageGui;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -173,12 +173,13 @@ public class TradeGui extends GuiFrame {
|
|||||||
trade.prepTime = System.currentTimeMillis();
|
trade.prepTime = System.currentTimeMillis();
|
||||||
event.getWhoClicked().closeInventory();
|
event.getWhoClicked().closeInventory();
|
||||||
|
|
||||||
var lines = LANG.getStringList("currency-editor-sign");
|
var lines = StringUtils.formatList(LANG.getStringList("currency-editor-sign"));
|
||||||
lines = StringUtils.formatListToString(lines);
|
lines.set(0, Component.empty());
|
||||||
final SignGUI signGUI = SignGUI.builder().setLines(lines.toArray(new String[0])).setHandler((player1, result) -> List.of(SignGUIAction.runSync(AxTrade.getInstance(), () -> {
|
|
||||||
|
var sign = new SignInput.Builder().setLines(lines).setHandler((player1, result) -> {
|
||||||
if (trade.ended) return;
|
if (trade.ended) return;
|
||||||
trade.prepTime = System.currentTimeMillis();
|
trade.prepTime = System.currentTimeMillis();
|
||||||
String am = result.getLine(0);
|
String am = PlainTextComponentSerializer.plainText().serialize(result[0]);
|
||||||
TradePlayer.Result addResult = player.setCurrency(currencyStr, am);
|
TradePlayer.Result addResult = player.setCurrency(currencyStr, am);
|
||||||
if (addResult == TradePlayer.Result.SUCCESS) {
|
if (addResult == TradePlayer.Result.SUCCESS) {
|
||||||
MESSAGEUTILS.sendLang(player1, "currency-editor.success");
|
MESSAGEUTILS.sendLang(player1, "currency-editor.success");
|
||||||
@ -192,11 +193,13 @@ public class TradeGui extends GuiFrame {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gui.open(player.getPlayer());
|
Scheduler.get().run(scheduledTask -> {
|
||||||
inSign = false;
|
gui.open(player.getPlayer());
|
||||||
trade.update();
|
inSign = false;
|
||||||
}))).build();
|
trade.update();
|
||||||
signGUI.open(player.getPlayer());
|
});
|
||||||
|
}).build(player.getPlayer());
|
||||||
|
sign.open();
|
||||||
}, Map.of("%amount%", NumberUtils.formatNumber(player.getCurrency(currencyStr))));
|
}, Map.of("%amount%", NumberUtils.formatNumber(player.getCurrency(currencyStr))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user