From 200e530b0a28bf2a3223a690c7c0bf90eb517090 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 9 Apr 2025 16:07:20 -0700 Subject: [PATCH] Fix raw copper turning into copper block & fix other issues --- .../kotlin/xyz/lncvrt/galaxyboxpvp/GalaxyBoxPvPPlugin.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/xyz/lncvrt/galaxyboxpvp/GalaxyBoxPvPPlugin.kt b/src/main/kotlin/xyz/lncvrt/galaxyboxpvp/GalaxyBoxPvPPlugin.kt index f7a8b46..23d1177 100644 --- a/src/main/kotlin/xyz/lncvrt/galaxyboxpvp/GalaxyBoxPvPPlugin.kt +++ b/src/main/kotlin/xyz/lncvrt/galaxyboxpvp/GalaxyBoxPvPPlugin.kt @@ -79,7 +79,7 @@ class GalaxyBoxPvPPlugin : JavaPlugin(), TabExecutor { } internal fun convertInventoryItemsPrep(player: Player, playerId: UUID?) { - if (autoCompressStatus.getOrDefault(playerId, false) == true) { + if (autoCompressStatus[playerId] == true) { convertInventoryItems(player, Material.DIAMOND, Material.DIAMOND_BLOCK, 9, 1) convertInventoryItems(player, Material.LAPIS_LAZULI, Material.LAPIS_BLOCK, 9, 1) convertInventoryItems(player, Material.REDSTONE, Material.REDSTONE_BLOCK, 9, 1) @@ -90,7 +90,7 @@ class GalaxyBoxPvPPlugin : JavaPlugin(), TabExecutor { convertInventoryItems(player, Material.IRON_ORE, Material.IRON_BLOCK, 9, 1) convertInventoryItems(player, Material.RAW_IRON, Material.RAW_IRON_BLOCK, 9, 1) convertInventoryItems(player, Material.COAL, Material.COAL_BLOCK, 9, 1) - convertInventoryItems(player, Material.RAW_COPPER, Material.COPPER_BLOCK, 9, 1) + convertInventoryItems(player, Material.RAW_COPPER, Material.RAW_COPPER_BLOCK, 9, 1) convertInventoryItems(player, Material.COPPER_INGOT, Material.COPPER_BLOCK, 9, 1) convertInventoryItems(player, Material.QUARTZ, Material.QUARTZ_BLOCK, 4, 1) } @@ -172,8 +172,11 @@ class GalaxyBoxPvPPlugin : JavaPlugin(), TabExecutor { private fun loadAutoCompressStatus() { val file = File(dataFolder, "autocompress.json") + if (!dataFolder.exists()) { + dataFolder.mkdirs() + } if (!file.exists()) { - return + file.writeText("[]") } try {