Fixing #6
This commit is contained in:
parent
19964910de
commit
103d634eb2
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.4-SNAPSHOT'
|
id 'fabric-loom' version '0.4.29'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
|
|
||||||
# Fabric properties
|
# Fabric properties
|
||||||
minecraft_version=1.16
|
minecraft_version=1.16.1
|
||||||
yarn_mappings=1.16+build.1
|
yarn_mappings=1.16.1+build.17
|
||||||
loader_version=0.8.8+build.202
|
loader_version=0.8.8+build.202
|
||||||
|
|
||||||
#Fabric api
|
#Fabric api
|
||||||
fabric_version=0.13.1+build.370-1.16
|
fabric_version=0.14.0+build.371-1.16
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.4
|
mod_version = 1.4.4
|
||||||
|
|
|
@ -238,13 +238,25 @@ public class SimpleAuth implements DedicatedServerModInitializer {
|
||||||
}
|
}
|
||||||
PlayerCache cache = deauthenticatedUsers.get(convertUuid(player));
|
PlayerCache cache = deauthenticatedUsers.get(convertUuid(player));
|
||||||
// Puts player to last cached position
|
// Puts player to last cached position
|
||||||
player.teleport(
|
try {
|
||||||
server.getWorld(RegistryKey.of(Registry.DIMENSION, new Identifier(cache.lastDim))),
|
player.teleport(
|
||||||
|
server.getWorld(RegistryKey.of(Registry.DIMENSION, new Identifier(cache.lastDim))),
|
||||||
|
cache.lastX,
|
||||||
|
cache.lastY,
|
||||||
|
cache.lastZ,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
} catch (Error e) {
|
||||||
|
player.sendMessage(new LiteralText(config.lang.corruptedPosition), false);
|
||||||
|
LOGGER.error("[SimpleAuth] Couldn't teleport player " + player.getName().asString());
|
||||||
|
LOGGER.error(
|
||||||
|
String.format("[SimpleAuth] Last recorded position is X: %s, Y: %s, Z: %s in dimension %s",
|
||||||
cache.lastX,
|
cache.lastX,
|
||||||
cache.lastY,
|
cache.lastY,
|
||||||
cache.lastZ,
|
cache.lastZ,
|
||||||
0,
|
cache.lastDim
|
||||||
0
|
));
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -93,6 +93,7 @@ public class AuthConfig {
|
||||||
public String disallowedUsername = "§6Invalid username characters! Allowed character regex: %s";
|
public String disallowedUsername = "§6Invalid username characters! Allowed character regex: %s";
|
||||||
public String playerAlreadyOnline = "§cPlayer %s is already online!";
|
public String playerAlreadyOnline = "§cPlayer %s is already online!";
|
||||||
public String worldSpawnSet = "§aSpawn for logging in was set successfully.";
|
public String worldSpawnSet = "§aSpawn for logging in was set successfully.";
|
||||||
|
public String corruptedPosition = "§cYour position data is probably corrupted. Please contact admin.";
|
||||||
}
|
}
|
||||||
public static class ExperimentalConfig {
|
public static class ExperimentalConfig {
|
||||||
// Prevents player being kicked because another player with the same name has joined the server
|
// Prevents player being kicked because another player with the same name has joined the server
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class PlayerCache {
|
||||||
this.lastAir = player.getAir();
|
this.lastAir = player.getAir();
|
||||||
|
|
||||||
// Setting position cache
|
// Setting position cache
|
||||||
this.lastDim = String.valueOf(player.getEntityWorld().getDimension());
|
this.lastDim = String.valueOf(player.getEntityWorld().getRegistryKey().getValue());
|
||||||
this.lastX = player.getX();
|
this.lastX = player.getX();
|
||||||
this.lastY = player.getY();
|
this.lastY = player.getY();
|
||||||
this.lastZ = player.getZ();
|
this.lastZ = player.getZ();
|
||||||
|
|
Loading…
Reference in New Issue