Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.events;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.UUID;
- import de.omel.api.file.FileBuilder;
- public class PlayerData {
- private FileBuilder fb;
- private UUID uuid;
- public PlayerData(UUID uuid) {
- fb = new FileBuilder("plugins//PowerBans//PlayerData//", uuid.toString() + ".yml");
- fb.save();
- this.uuid = uuid;
- }
- public boolean exist() {
- return fb.exist();
- }
- public void setTempBanned(String from, String reason, long time) {
- fb.setValue("tempban.istempbanned", true);
- fb.setValue("tempban.from", from);
- fb.setValue("tempban.reason", reason);
- fb.setValue("tempban.duration", time);
- fb.setValue("tempban.timestamp", new SimpleDateFormat("dd.MM.yyyy HH:mm").format(new Date()));
- fb.save();
- }
- public void setUnTempbanned() {
- fb.setValue("tempban", null);
- fb.save();
- }
- public String getTempBannedReason() {
- return fb.getString("tempban.reason");
- }
- public String getTempBannedFrom() {
- return fb.getString("tempban.from");
- }
- public long getTempBanMilliseconds() {
- return fb.getLong("tempban.duration");
- }
- public String getTempbanTimestamp() {
- return fb.getString("tempban.timestamp");
- }
- public boolean isTempbanned() {
- return fb.getBoolean("tempban.istempbanned");
- }
- public void setMuted(boolean muted) {
- fb.setValue("muted", muted);
- fb.save();
- }
- public boolean isMuted() {
- return fb.getBoolean("muted");
- }
- public boolean isTempmuted() {
- return fb.getBoolean("tempmuted");
- }
- public long getTempmuteMilliseconds() {
- return fb.getLong("tempmute.duration");
- }
- public void setUnTempmuted() {
- fb.setValue("tempmute", null);
- fb.save();
- }
- public void setTempmuted(String from, String reason, long time) {
- fb.setValue("tempmute.istempmuted", true);
- fb.setValue("tempmute.from", from);
- fb.setValue("tempmute.reason", reason);
- fb.setValue("tempmute.duration", time + System.currentTimeMillis());
- fb.setValue("tempmute.timestamp", new SimpleDateFormat("dd.MM.yyyy HH:mm").format(new Date()));
- fb.save();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement