mirror of
https://github.com/Artillex-Studios/AxTrade.git
synced 2025-01-21 21:31:38 +01:00
Fixes
This commit is contained in:
parent
2dd3038526
commit
326b7113b8
@ -16,6 +16,11 @@ public class Requests {
|
|||||||
private static final ArrayList<Request> requests = new ArrayList<>();
|
private static final ArrayList<Request> requests = new ArrayList<>();
|
||||||
|
|
||||||
public static void addRequest(@NotNull Player sender, @NotNull Player receiver) {
|
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)) {
|
if (sender.equals(receiver)) {
|
||||||
MESSAGEUTILS.sendLang(sender, "request.cant-trade-self", Map.of("%player%", receiver.getName()));
|
MESSAGEUTILS.sendLang(sender, "request.cant-trade-self", Map.of("%player%", receiver.getName()));
|
||||||
return;
|
return;
|
||||||
|
@ -42,6 +42,7 @@ public class TradeGui extends GuiFrame {
|
|||||||
|
|
||||||
gui.setDefaultTopClickAction(event -> {
|
gui.setDefaultTopClickAction(event -> {
|
||||||
player.cancel();
|
player.cancel();
|
||||||
|
Scheduler.get().run(scheduledTask -> trade.update());
|
||||||
if (!slots.contains(event.getSlot())) {
|
if (!slots.contains(event.getSlot())) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (event.getCursor() == null) return;
|
if (event.getCursor() == null) return;
|
||||||
@ -49,7 +50,6 @@ public class TradeGui extends GuiFrame {
|
|||||||
event.getCursor().setAmount(0);
|
event.getCursor().setAmount(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Scheduler.get().run(scheduledTask -> trade.update());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gui.setDragAction(event -> {
|
gui.setDragAction(event -> {
|
||||||
|
@ -38,6 +38,7 @@ request:
|
|||||||
already-in-trade: "&#CCFFEEThe player is already trading with someone!"
|
already-in-trade: "&#CCFFEEThe player is already trading with someone!"
|
||||||
already-sent: "&#CCFFEEYou have already sent a trade request to �FFDD%player%&#CCFFEE!"
|
already-sent: "&#CCFFEEYou have already sent a trade request to �FFDD%player%&#CCFFEE!"
|
||||||
too-far: "&#CCFFEEYou are too far from �FFDD%player% &#CCFFEEto send a trade request!"
|
too-far: "&#CCFFEEYou are too far from �FFDD%player% &#CCFFEEto send a trade request!"
|
||||||
|
not-accepting: "&#CCFFEEThis player is not accepting trades right now!"
|
||||||
|
|
||||||
# this must be 4 lines
|
# this must be 4 lines
|
||||||
# note: currently the first line must be left empty
|
# note: currently the first line must be left empty
|
||||||
|
Loading…
Reference in New Issue
Block a user