From d198a673461cc5d8d358184893dde9b3df231d76 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:20:17 +0100 Subject: [PATCH] Resolving merge conflicts --- .../java/org/samo_lego/simpleauth/SimpleAuth.java | 1 + .../org/samo_lego/simpleauth/storage/PlayerCache.java | 11 ++--------- .../simpleauth/storage/database/LevelDB.java | 4 ++-- .../simpleauth/storage/database/MongoDB.java | 1 + 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java b/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java index ce0e8cd..16b053c 100644 --- a/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java +++ b/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java @@ -20,6 +20,7 @@ import java.io.FileReader; import java.io.IOException; import java.nio.file.Path; import java.util.HashMap; +import java.util.HashSet; import java.util.Properties; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; diff --git a/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java b/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java index ec2613a..b489a27 100644 --- a/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java +++ b/src/main/java/org/samo_lego/simpleauth/storage/PlayerCache.java @@ -1,14 +1,11 @@ package org.samo_lego.simpleauth.storage; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.JsonObject; import net.minecraft.block.Blocks; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.LiteralText; -import net.minecraft.util.Identifier; import net.minecraft.util.math.Vec3d; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryKey; import java.util.Objects; @@ -121,8 +118,6 @@ public class PlayerCache { playerCache.lastIp = player.getIp(); playerCache.wasInPortal = player.getBlockState().getBlock().equals(Blocks.NETHER_PORTAL); - playerCache.lastAir = player.getAir(); - playerCache.wasOnFire = player.isOnFire(); // Setting position cache playerCache.lastLocation.dimension = player.getServerWorld(); @@ -132,8 +127,6 @@ public class PlayerCache { } else { playerCache.wasInPortal = false; - playerCache.lastAir = 300; - playerCache.wasOnFire = false; } return playerCache; diff --git a/src/main/java/org/samo_lego/simpleauth/storage/database/LevelDB.java b/src/main/java/org/samo_lego/simpleauth/storage/database/LevelDB.java index 30c5388..b0cbc06 100644 --- a/src/main/java/org/samo_lego/simpleauth/storage/database/LevelDB.java +++ b/src/main/java/org/samo_lego/simpleauth/storage/database/LevelDB.java @@ -64,7 +64,7 @@ public class LevelDB { * @return true if operation was successful, otherwise false */ @Deprecated - public boolean registerUser(String uuid, String data) { + public static boolean registerUser(String uuid, String data) { try { if(!isUserRegistered(uuid)) { levelDBStore.put(bytes("UUID:" + uuid), bytes("data:" + data)); @@ -112,7 +112,7 @@ public class LevelDB { * @param data data to put inside database */ @Deprecated - public void updateUserData(String uuid, String data) { + public static void updateUserData(String uuid, String data) { try { levelDBStore.put(bytes("UUID:" + uuid), bytes("data:" + data)); } catch (Error e) { diff --git a/src/main/java/org/samo_lego/simpleauth/storage/database/MongoDB.java b/src/main/java/org/samo_lego/simpleauth/storage/database/MongoDB.java index 0d58bf0..161d496 100644 --- a/src/main/java/org/samo_lego/simpleauth/storage/database/MongoDB.java +++ b/src/main/java/org/samo_lego/simpleauth/storage/database/MongoDB.java @@ -32,6 +32,7 @@ public class MongoDB { config.mongoDBCredentials.useSsl ) + playerCache.wasOnFire = false; );*/ mongoClient = MongoClients.create(String.format("mongodb://%s:%d", config.mongoDBCredentials.host, config.mongoDBCredentials.port)); MongoDatabase database = mongoClient.getDatabase(config.mongoDBCredentials.databaseName);