diff --git a/.idea/modules/1.18/HMCCosmetics.1.18.main.iml b/.idea/modules/1.18/HMCCosmetics.1.18.main.iml index c0e03ea1..8e70a189 100644 --- a/.idea/modules/1.18/HMCCosmetics.1.18.main.iml +++ b/.idea/modules/1.18/HMCCosmetics.1.18.main.iml @@ -1,5 +1,15 @@ + + + + + MCP + SPIGOT + + + + diff --git a/1.17/build.gradle.kts b/1.17/build.gradle.kts new file mode 100644 index 00000000..09963996 --- /dev/null +++ b/1.17/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + id("java") +} + +//group = "io.github.fisher2911" +//version = "1.7.1" +//description = "Intuitive, easy-to-use cosmetics plugin, designed for servers using resource packs.\n" + +repositories { + mavenCentral() + maven("https://papermc.io/repo/repository/maven-public/") + maven("https://oss.sonatype.org/content/repositories/snapshots") + maven("https://jitpack.io") + maven("https://repo.dmulloy2.net/repository/public/") +} + +dependencies { + implementation(project(":nms")) + compileOnly("com.mojang:authlib:1.5.25") + compileOnly("org.spigotmc:spigot:1.17-R0.1-SNAPSHOT") + compileOnly("org.jetbrains:annotations:22.0.0") + compileOnly("com.comphenix.protocol:ProtocolLib:4.7.0") +} diff --git a/1.18/build.gradle.kts b/1.18/build.gradle.kts new file mode 100644 index 00000000..362c6547 --- /dev/null +++ b/1.18/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + id("java") +} + +//group = "io.github.fisher2911" +//version = "1.7.1" +//description = "Intuitive, easy-to-use cosmetics plugin, designed for servers using resource packs.\n" + +repositories { + mavenCentral() + maven("https://papermc.io/repo/repository/maven-public/") + maven("https://oss.sonatype.org/content/repositories/snapshots") + maven("https://jitpack.io") + maven("https://repo.dmulloy2.net/repository/public/") +} + +dependencies { + implementation(project(":nms")) + compileOnly("com.mojang:authlib:1.5.25") + compileOnly("org.spigotmc:spigot:1.18-R0.1-SNAPSHOT") + compileOnly("org.jetbrains:annotations:22.0.0") + compileOnly("com.comphenix.protocol:ProtocolLib:4.7.0") +} diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/database/DatabaseConverter.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/database/DatabaseConverter.java index 87cbf39d..fa9d7c68 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/database/DatabaseConverter.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/database/DatabaseConverter.java @@ -40,14 +40,12 @@ public class DatabaseConverter { FILE_NAME ).toFile(); - final boolean fileExists = file.exists(); - if (!file.exists()) { this.plugin.saveResource("database" + File.separator + FILE_NAME, true); } final YamlConfiguration config = YamlConfiguration.loadConfiguration(file); - final int version = fileExists ? config.getInt("version") : 1; + final int version = config.getInt("version") == 0 ? 1 : config.getInt("version"); final Set users = new HashSet<>(); diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/gui/CosmeticGui.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/gui/CosmeticGui.java index 82eee1f1..76637f07 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/gui/CosmeticGui.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/gui/CosmeticGui.java @@ -141,7 +141,7 @@ public class CosmeticGui { final String permission = armorItem.getPermission() == null ? "" : armorItem.getPermission(); - final boolean hasPermission = permission.isBlank() || player.hasPermission(permission); + final boolean hasPermission = permission.isBlank() || user.hasPermissionToUse(armorItem); return new GuiItem( this.applyPlaceholders(user, player, armorItem, hasPermission), diff --git a/nms/build.gradle.kts b/nms/build.gradle.kts new file mode 100644 index 00000000..290b7561 --- /dev/null +++ b/nms/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("java") +} + +//group = "io.github.fisher2911" +//version = "1.7.1" +//description = "Intuitive, easy-to-use cosmetics plugin, designed for servers using resource packs.\n" + +repositories { + mavenCentral() + maven("https://papermc.io/repo/repository/maven-public/") + maven("https://oss.sonatype.org/content/repositories/snapshots") + maven("https://jitpack.io") + maven("https://repo.dmulloy2.net/repository/public/") +} + +dependencies { + compileOnly("com.mojang:authlib:1.5.25") + compileOnly("org.spigotmc:spigot:1.18-R0.1-SNAPSHOT") + compileOnly("org.jetbrains:annotations:22.0.0") + compileOnly("com.comphenix.protocol:ProtocolLib:4.7.0") +}