- Update Paper API: 1.20.1 -> 1.21.4 - Update plugin version: 1.5.5-1.20.1 -> 1.5.5-1.21.8 - Add checkstyle plugin with reasonable rules - Fix Enchantment.LUCK -> Enchantment.UNBREAKING - Fix EntityType.FIREWORK -> EntityType.FIREWORK_ROCKET - Remove unused imports - Add temp_*/ to .gitignore - 118 files changed, 1633 insertions(+), 1301 deletions(-)
93 lines
2.4 KiB
Java
93 lines
2.4 KiB
Java
package com.loki.lochat.data.model;
|
|
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* Модель данных мута (Value Object)
|
|
*/
|
|
public class MuteData {
|
|
public long endTime; // 0 = перманентный (public for JSON serialization)
|
|
public String reason;
|
|
public String mutedBy;
|
|
public long mutedAt;
|
|
private UUID uuid;
|
|
private String playerName;
|
|
|
|
public MuteData() {
|
|
} // For JSON deserialization
|
|
|
|
public MuteData(UUID uuid, String playerName, long endTime, String reason, String mutedBy) {
|
|
this.uuid = uuid;
|
|
this.playerName = playerName;
|
|
this.endTime = endTime;
|
|
this.reason = reason;
|
|
this.mutedBy = mutedBy;
|
|
this.mutedAt = System.currentTimeMillis();
|
|
}
|
|
|
|
public MuteData(long endTime, String reason, String mutedBy, long mutedAt, String playerName) {
|
|
this.endTime = endTime;
|
|
this.reason = reason;
|
|
this.mutedBy = mutedBy;
|
|
this.mutedAt = mutedAt;
|
|
this.playerName = playerName;
|
|
}
|
|
|
|
public UUID getUuid() {
|
|
return uuid;
|
|
}
|
|
|
|
public String getPlayerName() {
|
|
return playerName;
|
|
}
|
|
|
|
public long getEndTime() {
|
|
return endTime;
|
|
}
|
|
|
|
public String getReason() {
|
|
return reason;
|
|
}
|
|
|
|
public String getMutedBy() {
|
|
return mutedBy;
|
|
}
|
|
|
|
public long getMutedAt() {
|
|
return mutedAt;
|
|
}
|
|
|
|
public boolean isPermanent() {
|
|
return endTime == 0;
|
|
}
|
|
|
|
/**
|
|
* Запись истории мута
|
|
*/
|
|
public static class MuteHistoryEntry {
|
|
public String playerName;
|
|
public long duration;
|
|
public String reason;
|
|
public String mutedBy;
|
|
public long mutedAt;
|
|
public boolean unmuted;
|
|
public String unmutedBy;
|
|
public long unmutedAt;
|
|
|
|
public MuteHistoryEntry() {
|
|
} // For JSON deserialization
|
|
|
|
public MuteHistoryEntry(String playerName, long duration, String reason,
|
|
String mutedBy, long mutedAt, boolean unmuted,
|
|
String unmutedBy, long unmutedAt) {
|
|
this.playerName = playerName;
|
|
this.duration = duration;
|
|
this.reason = reason;
|
|
this.mutedBy = mutedBy;
|
|
this.mutedAt = mutedAt;
|
|
this.unmuted = unmuted;
|
|
this.unmutedBy = unmutedBy;
|
|
this.unmutedAt = unmutedAt;
|
|
}
|
|
}
|
|
}
|