From 72847bf663043078ff95f915a76ccb7a0c0ef446 Mon Sep 17 00:00:00 2001 From: Bierque Jason Date: Fri, 19 Jan 2024 17:09:59 +0100 Subject: [PATCH] Vous pouvez maintenant choisir la hauteur de l'ile --- .idea/sonarlint/issuestore/index.pb | 4 +++- .idea/sonarlint/securityhotspotstore/index.pb | 4 +++- .../euphyllia/skyllia/api/skyblock/model/SchematicWorld.java | 2 +- .../java/fr/euphyllia/skyllia/configuration/ConfigToml.java | 3 ++- .../main/java/fr/euphyllia/skyllia/utils/WorldEditUtils.java | 1 + 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb index 7001d2b..52f4f9a 100644 --- a/.idea/sonarlint/issuestore/index.pb +++ b/.idea/sonarlint/issuestore/index.pb @@ -131,4 +131,6 @@ Pplugin/src/main/java/fr/euphyllia/skyllia/cache/PermissionRoleInIslandCache.jav y Iplugin/src/main/java/fr/euphyllia/skyllia/cache/PlayersInIslandCache.java,3\e\3e593d1489153c7be9704086f4de90fcefbcf1be x -Hplugin/src/main/java/fr/euphyllia/skyllia/cache/PositionIslandCache.java,c\f\cf2b2a23d9c3002a72b6a75e4927dc79309c93de \ No newline at end of file +Hplugin/src/main/java/fr/euphyllia/skyllia/cache/PositionIslandCache.java,c\f\cf2b2a23d9c3002a72b6a75e4927dc79309c93de +„ +Tplugin/src/main/java/fr/euphyllia/skyllia/commands/subcommands/DeleteSubCommand.java,3\6\366be589277425a5ecfb5e630e65f1247263aca3 \ No newline at end of file diff --git a/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/sonarlint/securityhotspotstore/index.pb index 7001d2b..52f4f9a 100644 --- a/.idea/sonarlint/securityhotspotstore/index.pb +++ b/.idea/sonarlint/securityhotspotstore/index.pb @@ -131,4 +131,6 @@ Pplugin/src/main/java/fr/euphyllia/skyllia/cache/PermissionRoleInIslandCache.jav y Iplugin/src/main/java/fr/euphyllia/skyllia/cache/PlayersInIslandCache.java,3\e\3e593d1489153c7be9704086f4de90fcefbcf1be x -Hplugin/src/main/java/fr/euphyllia/skyllia/cache/PositionIslandCache.java,c\f\cf2b2a23d9c3002a72b6a75e4927dc79309c93de \ No newline at end of file +Hplugin/src/main/java/fr/euphyllia/skyllia/cache/PositionIslandCache.java,c\f\cf2b2a23d9c3002a72b6a75e4927dc79309c93de +„ +Tplugin/src/main/java/fr/euphyllia/skyllia/commands/subcommands/DeleteSubCommand.java,3\6\366be589277425a5ecfb5e630e65f1247263aca3 \ No newline at end of file diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/SchematicWorld.java b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/SchematicWorld.java index 4e7a871..f69372b 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/SchematicWorld.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/SchematicWorld.java @@ -1,4 +1,4 @@ package fr.euphyllia.skyllia.api.skyblock.model; -public record SchematicWorld(String key, String worldName, String schematicFile) { +public record SchematicWorld(String key, String worldName, double height, String schematicFile) { } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/ConfigToml.java b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/ConfigToml.java index a2827a7..fb52064 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/ConfigToml.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/ConfigToml.java @@ -221,7 +221,8 @@ private static void schematicIsland() { String schematicFile = getString(isKey + ".schematic", "./schematics/default.schem"); String worldName = islandStarterEntry.getKey(); String name = getString(isKey + ".name", entry.getKey()); - SchematicWorld schematicWorld = new SchematicWorld(name, worldName, schematicFile); + double height = getDouble(isKey + ".height", 64D); + SchematicWorld schematicWorld = new SchematicWorld(name, worldName, height, schematicFile); schematicWorldMap.put(name.toLowerCase(), schematicWorld); } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/utils/WorldEditUtils.java b/plugin/src/main/java/fr/euphyllia/skyllia/utils/WorldEditUtils.java index c4db3c3..fa0593f 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/utils/WorldEditUtils.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/utils/WorldEditUtils.java @@ -57,6 +57,7 @@ public static Type worldEditVersion() { public static void pasteSchematicWE(InterneAPI api, Location loc, SchematicWorld schematicWorld) { try { + loc.setY(schematicWorld.height()); File file = new File(api.getPlugin().getDataFolder() + File.separator + schematicWorld.schematicFile()); ClipboardFormat format = cachedIslandSchematic.getOrDefault(file, ClipboardFormats.findByFile(file)); try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {