Skip to content

Commit

Permalink
Version 1.0-alpha.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Jan 19, 2024
1 parent 72847bf commit 5186ad5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
10 changes: 9 additions & 1 deletion .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/sonarlint/securityhotspotstore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ConfigToml {
public static Map<String, SchematicWorld> schematicWorldMap = new HashMap<>();
public static String defaultSchematicKey = "example-schem";
public static int updateCacheTimer = 60;
public static int dbVersion = 1;
private static boolean verbose;

public static void init(File configFile) {
Expand All @@ -45,7 +46,9 @@ public static void init(File configFile) {

version = getInt("config-version", 1);
set("config-version", 1);
logger.log(Level.FATAL, "Lecture des config");
if (verbose) {
logger.log(Level.INFO, "Lecture des config");
}
try {
readConfig(ConfigToml.class, null);
} catch (Exception e) {
Expand Down Expand Up @@ -99,7 +102,7 @@ private static Double getDouble(@NotNull String path, Double def) {
}
if (tryIt instanceof Double) { // Fix issue https://github.com/Euphillya/skyllia/issues/9
return config.get(path);
} else if (tryIt instanceof Integer){
} else if (tryIt instanceof Integer) {
return (double) config.getInt(path);
} else {
String value = String.valueOf(config.get(path));
Expand Down Expand Up @@ -153,8 +156,6 @@ private static Long getLong(@NotNull String path, Long def) {
return builder.build();
}

public static int dbVersion = 1;

private static void initMariaDB() {
String path = "sgbd.mariadb.%s";
String hostname = getString(path.formatted("hostname"), "127.0.0.1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ public static void init(File configFile) {

version = getInt("config-version", 1);
set("config-version", 1);
logger.log(Level.FATAL, "Lecture des config");
if (verbose) {
logger.log(Level.INFO, "Lecture du fichier langue");
}
try {
readConfig(LanguageToml.class, null);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public static void teleportPlayerSpawn(Main main, Player player) {
public static void updateChunk(Main main, Player player, int chunkX, int chunkZ) throws UnsupportedMinecraftVersionException {
final String versionMC = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
switch (versionMC) {
case "v1_19_R3" ->
PlayerNMS.refreshPlayerChunk(main, player, chunkX, chunkZ);
case "v1_19_R3" -> PlayerNMS.refreshPlayerChunk(main, player, chunkX, chunkZ);
case "v1_20_R1" ->
fr.euphyllia.skyllia.utils.nms.v1_20_R1.PlayerNMS.refreshPlayerChunk(main, player, chunkX, chunkZ);
case "v1_20_R2" ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public static Vector getMaxXRegion(World world, int regionX, int regionZ) {
public static Position getRegionWithLocation(int locX, int locZ) {
return getRegionInChunk(locX >> 4, locZ >> 4);
}

public static Position getRegionInChunk(Position chunk) {
return getRegionInChunk(chunk.regionX(), chunk.regionZ());
}
Expand Down

0 comments on commit 5186ad5

Please sign in to comment.