This commit is contained in:
BenceX100 2024-04-04 21:00:52 +02:00
parent 2dd3038526
commit 326b7113b8
3 changed files with 7 additions and 1 deletions

View File

@ -16,6 +16,11 @@ public class Requests {
private static final ArrayList<Request> requests = new ArrayList<>();
public static void addRequest(@NotNull Player sender, @NotNull Player receiver) {
if (sender.isDead() || receiver.isDead()) {
MESSAGEUTILS.sendLang(sender, "request.not-accepting", Map.of("%player%", receiver.getName()));
return;
}
if (sender.equals(receiver)) {
MESSAGEUTILS.sendLang(sender, "request.cant-trade-self", Map.of("%player%", receiver.getName()));
return;

View File

@ -42,6 +42,7 @@ public class TradeGui extends GuiFrame {
gui.setDefaultTopClickAction(event -> {
player.cancel();
Scheduler.get().run(scheduledTask -> trade.update());
if (!slots.contains(event.getSlot())) {
event.setCancelled(true);
if (event.getCursor() == null) return;
@ -49,7 +50,6 @@ public class TradeGui extends GuiFrame {
event.getCursor().setAmount(0);
return;
}
Scheduler.get().run(scheduledTask -> trade.update());
});
gui.setDragAction(event -> {

View File

@ -38,6 +38,7 @@ request:
already-in-trade: "&#CCFFEEThe player is already trading with someone!"
already-sent: "&#CCFFEEYou have already sent a trade request to &#00FFDD%player%&#CCFFEE!"
too-far: "&#CCFFEEYou are too far from &#00FFDD%player% &#CCFFEEto send a trade request!"
not-accepting: "&#CCFFEEThis player is not accepting trades right now!"
# this must be 4 lines
# note: currently the first line must be left empty