mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-05 16:37:38 +07:00
Add uuid return to PlayerBanEvent (#4982)
* Update EventType.java * Update Administration.java
This commit is contained in:
parent
268672adb8
commit
a40731624a
@ -421,18 +421,22 @@ public class EventType{
|
|||||||
public static class PlayerBanEvent{
|
public static class PlayerBanEvent{
|
||||||
@Nullable
|
@Nullable
|
||||||
public final Player player;
|
public final Player player;
|
||||||
|
public final String uuid;
|
||||||
|
|
||||||
public PlayerBanEvent(Player player){
|
public PlayerBanEvent(Player player, String uuid){
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
this.uuid = uuid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PlayerUnbanEvent{
|
public static class PlayerUnbanEvent{
|
||||||
@Nullable
|
@Nullable
|
||||||
public final Player player;
|
public final Player player;
|
||||||
|
public final String uuid;
|
||||||
|
|
||||||
public PlayerUnbanEvent(Player player){
|
public PlayerUnbanEvent(Player player, String uuid){
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
this.uuid = uuid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ public class Administration{
|
|||||||
getCreateInfo(id).banned = true;
|
getCreateInfo(id).banned = true;
|
||||||
|
|
||||||
save();
|
save();
|
||||||
Events.fire(new PlayerBanEvent(Groups.player.find(p -> id.equals(p.uuid()))));
|
Events.fire(new PlayerBanEvent(Groups.player.find(p -> id.equals(p.uuid())), id));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ public class Administration{
|
|||||||
info.banned = false;
|
info.banned = false;
|
||||||
bannedIPs.removeAll(info.ips, false);
|
bannedIPs.removeAll(info.ips, false);
|
||||||
save();
|
save();
|
||||||
Events.fire(new PlayerUnbanEvent(Groups.player.find(p -> id.equals(p.uuid()))));
|
Events.fire(new PlayerUnbanEvent(Groups.player.find(p -> id.equals(p.uuid())), id));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user