From b998cac5c83bda1f795c7675cff356a1b0729653 Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Wed, 26 Apr 2023 15:01:30 -0500 Subject: [PATCH 01/30] clean: default earth day grabber had model field that was unused --- common/src/main/resources/cosmetics/defaultcosmetics.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/common/src/main/resources/cosmetics/defaultcosmetics.yml b/common/src/main/resources/cosmetics/defaultcosmetics.yml index 0ed49145..912c517d 100644 --- a/common/src/main/resources/cosmetics/defaultcosmetics.yml +++ b/common/src/main/resources/cosmetics/defaultcosmetics.yml @@ -124,7 +124,6 @@ earth_day_grabber: slot: OFFHAND dyeable: true permission: "hmccosmetics.earth_day_grabber" - model: earth_day_grabber item: material: LEATHER_HORSE_ARMOR model-data: 4 From b09bd357370bbd048f72a00849242b31832048fd Mon Sep 17 00:00:00 2001 From: Mergu Date: Sat, 29 Apr 2023 11:56:17 -0400 Subject: [PATCH 02/30] Add support for Denizen items --- build.gradle.kts | 6 ++--- common/build.gradle.kts | 1 + .../hibiscusmc/hmccosmetics/hooks/Hooks.java | 1 + .../hmccosmetics/hooks/items/HookDenizen.java | 27 +++++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookDenizen.java diff --git a/build.gradle.kts b/build.gradle.kts index 1f87d73b..cf634471 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,8 +34,8 @@ allprojects { //Hikari maven("https://mvnrepository.com/artifact/com.zaxxer/HikariCP") - // Citizens - maven("https://repo.citizensnpcs.co") + // Citizens & Denizen + maven("https://maven.citizensnpcs.co/repo") // Worldguard maven("https://maven.enginehub.org/repo/") @@ -168,7 +168,7 @@ bukkit { apiVersion = "1.17" authors = listOf("LoJoSho") depend = listOf("ProtocolLib") - softDepend = listOf("ModelEngine", "Oraxen", "ItemsAdder", "Looty", "HMCColor", "WorldGuard", "MythicMobs", "PlaceholderAPI", "SuperVanish", "PremiumVanish") + softDepend = listOf("ModelEngine", "Oraxen", "ItemsAdder", "Looty", "HMCColor", "WorldGuard", "MythicMobs", "Denizen", "PlaceholderAPI", "SuperVanish", "PremiumVanish") version = "${project.version}" commands { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 060ffef5..65da0575 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT") compileOnly("it.unimi.dsi:fastutil:8.5.11") compileOnly("io.lumine:Mythic-Dist:5.2.1") + compileOnly("com.denizenscript:denizen:1.2.7-SNAPSHOT") compileOnly("com.github.LeonMangler:SuperVanish:6.2.6-4") //compileOnly("com.github.Fisher2911:FisherLib:master-SNAPSHOT") diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java index 7c6ed5e9..15862ed4 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java @@ -22,6 +22,7 @@ public class Hooks { private static HookItemAdder ITEMADDER_HOOK = new HookItemAdder(); private static HookLooty LOOTY_HOOK = new HookLooty(); private static HookMythic MYTHIC_HOOK = new HookMythic(); + private static HookDenizen DENIZEN_HOOK = new HookDenizen(); private static HookHMCCosmetics HMCCOSMETIC_HOOK = new HookHMCCosmetics(); private static HookPlaceholderAPI PAPI_HOOK = new HookPlaceholderAPI(); private static HookPremiumVanish PREMIUM_VANISH_HOOK = new HookPremiumVanish(); diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookDenizen.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookDenizen.java new file mode 100644 index 00000000..f9b935eb --- /dev/null +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookDenizen.java @@ -0,0 +1,27 @@ +package com.hibiscusmc.hmccosmetics.hooks.items; + +import com.denizenscript.denizen.objects.ItemTag; +import com.denizenscript.denizencore.utilities.CoreUtilities; +import com.hibiscusmc.hmccosmetics.hooks.Hook; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +/** + * A hook that integrates the plugin {@link com.denizenscript.denizen.Denizen Denizen} to provide custom items + */ +@SuppressWarnings("SpellCheckingInspection") +public class HookDenizen extends Hook { + public HookDenizen() { + super("denizen"); + setEnabledItemHook(true); + } + + /** + * Gets a cosmetic {@link ItemStack} that is associated with the provided id from the plugin {@link com.denizenscript.denizen.Denizen Denizen} + */ + @Override + public ItemStack getItem(@NotNull String itemId) { + ItemTag item = ItemTag.valueOf(itemId, CoreUtilities.noDebugContext); + return item == null ? null : item.getItemStack(); + } +} From 9cfb27da28a025f79074c1a9fbad26c5f8eeb801 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:33:03 -0400 Subject: [PATCH 03/30] chore: update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 97 ++++++++++++++------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 2e57ae16..76a37dc7 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,62 +1,69 @@ name: Bug Report -description: Create a bug report to help us keep track of all bugs that have to be fixed -title: "[BUG] " +description: Report an issue with HMCCosmetics labels: [bug] - -body: - - type: checkboxes - id: i-have-checked +assignees: ["LoJoSho"] +- type: markdown attributes: - label: I have checked... - options: - - label: "I am using the latest version of HMCCosmetics" - required: true - - label: "I am using the latest version of any dependencies" - required: true - - label: "I have checked if any similar bug reports exist" - required: true + value: | + Thank you for filing an bug report! If you are here to ask a question, use our [Discord server](https://discord.gg/pcm8kWrdNt) instead! +body: + - type: input + id: release_version + attributes: + label: Plugin Version + placeholder: vx.x.x + description: | + Insert the version of HMCCosmetics you are using (e.g. `v2.2.8`). Before continuing make sure you have the latest version of HMCCosmetics as + your issue may have already been resolved. + validations: + required: true + - type: input + id: server_version + attributes: + label: Server Version + placeholder: fork-x-x.x.x + description: | + Insert the version of your minecraft server in the format `fork-build-version` (e.g. `PAPER-521-1.19.4`, `PURPUR-1838-1.19.2`) + validations: + required: true - type: textarea id: description attributes: - label: Description - description: A full description of the bug - validations: - required: true + label: Issue description + description: Describe the issue in as much detail as possible (Include any error logs in a code block below) + validations: + required: true - type: textarea id: reproduce attributes: label: Steps to reproduce description: Explain how to reproduce this issue step-by-step, in as much detail as possible. + placeholder: | + Steps to reproduce: + 1. Do thing + 2. Observe behavior + 3. Post any error logs below validations: required: true - - type: textarea - id: hmcc-version + - type: dropdown + id: priority attributes: - label: Plugin Version - description: Run `version HMCCosmetics` in your console and paste the output - validations: - required: true - - type: textarea - id: meg-version - attributes: - label: ModelEngine Version - description: "Run `version ModelEngine` in your console and paste the output. Optional if not using balloons." - validations: - required: false - - type: textarea - id: server-version - attributes: - label: Server Version - description: "Run `version` in your console and paste the output." - validations: - required: true - - type: "dropdown" - id: "type" - attributes: - label: "How breaking is the bug?" + label: Issue priority + description: Please be realistic. If you need to elaborate on your reasoning, please use the issue description field above. options: - - "Breaking Bug - Plugin unusable" - - "Non-breaking Bug - Plugin still usable, but certain features unavailable" - - "Minor Bug - Plugin completely functional, but features have non-working aspects" + - Low (slightly annoying) + - Medium (should be fixed somewhat soon) + - High (immediate attention needed) validations: required: true + - type: textarea + id: versions + attributes: + label: Other Versions + placeholder: | + - ModelEngine R3.0.1 (`\version`) + - Any other relevant version information such as depenedencies + description: | + List any necessary or relevant versions here. + validations: + required: false From f44d916b3266d0bc81260dfe1c49000bd195c43e Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:34:17 -0400 Subject: [PATCH 04/30] chore: fix bug-report.yml syntax error --- .github/ISSUE_TEMPLATE/bug-report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 76a37dc7..ebcdbeac 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -2,11 +2,11 @@ name: Bug Report description: Report an issue with HMCCosmetics labels: [bug] assignees: ["LoJoSho"] -- type: markdown +body: + - type: markdown attributes: value: | Thank you for filing an bug report! If you are here to ask a question, use our [Discord server](https://discord.gg/pcm8kWrdNt) instead! -body: - type: input id: release_version attributes: From f50731f83ee21ee9733a702b14987d2d4b04d2ef Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:36:29 -0400 Subject: [PATCH 05/30] chore: fix bug-report.yml validation errors --- .github/ISSUE_TEMPLATE/bug-report.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index ebcdbeac..ece84399 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -15,8 +15,6 @@ body: description: | Insert the version of HMCCosmetics you are using (e.g. `v2.2.8`). Before continuing make sure you have the latest version of HMCCosmetics as your issue may have already been resolved. - validations: - required: true - type: input id: server_version attributes: @@ -24,15 +22,11 @@ body: placeholder: fork-x-x.x.x description: | Insert the version of your minecraft server in the format `fork-build-version` (e.g. `PAPER-521-1.19.4`, `PURPUR-1838-1.19.2`) - validations: - required: true - type: textarea id: description attributes: label: Issue description description: Describe the issue in as much detail as possible (Include any error logs in a code block below) - validations: - required: true - type: textarea id: reproduce attributes: @@ -65,5 +59,3 @@ body: - Any other relevant version information such as depenedencies description: | List any necessary or relevant versions here. - validations: - required: false From f5bf8c70b4dfc20141280498dc3eb2643a428729 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:39:22 -0400 Subject: [PATCH 06/30] chore: modify text --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index ece84399..f96ede58 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -55,7 +55,7 @@ body: attributes: label: Other Versions placeholder: | - - ModelEngine R3.0.1 (`\version`) + - ModelEngine R3.0.1 (`/version ModelEngine`) - Any other relevant version information such as depenedencies description: | List any necessary or relevant versions here. From 1f634d668e774575fb60bafda8a05758268dc3c4 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:40:14 -0400 Subject: [PATCH 07/30] style: rename bug-report.yml --- .github/ISSUE_TEMPLATE/{bug-report.yml => 01-bug_report.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{bug-report.yml => 01-bug_report.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/01-bug_report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug-report.yml rename to .github/ISSUE_TEMPLATE/01-bug_report.yml From 651067fb17ea3ce49a34bb21e1211d4e1dcb12a4 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:40:43 -0400 Subject: [PATCH 08/30] style: rename feature-request.yml --- .../{feature-request.yml => 02-feature_request.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{feature-request.yml => 02-feature_request.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/02-feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature-request.yml rename to .github/ISSUE_TEMPLATE/02-feature_request.yml From 0a1a381ebcb16204df49c91874f044a1c0268176 Mon Sep 17 00:00:00 2001 From: Craftinators Date: Sat, 29 Apr 2023 12:45:58 -0400 Subject: [PATCH 09/30] chore: update 02-feature_request --- .github/ISSUE_TEMPLATE/02-feature_request.yml | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02-feature_request.yml b/.github/ISSUE_TEMPLATE/02-feature_request.yml index f0498ff1..df9eb954 100644 --- a/.github/ISSUE_TEMPLATE/02-feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02-feature_request.yml @@ -1,29 +1,24 @@ name: Feature Request description: Create a feature request to help us keep track of all features you want to be added -title: "[FEATURE] " labels: [enhancement] - +assignees: ["LoJoSho"] body: - - type: "checkboxes" - id: "i-have-checked" +- type: markdown + attributes: + value: | + Please check that the feature you are requesting does not already exist *and/or* hasn't already been requested by someone else. + - type: textarea + id: description attributes: - label: "I have checked that..." - options: - - label: "...such a feature does not exist already" - required: true - - label: "...such a feature request has not been submitted already" - required: true - - type: "textarea" - id: "description" - attributes: - label: "Description" - description: "A full description of the feature" + label: Feature Description + description: A clear and concise description of what the problem is, or what feature you want to be implemented. + placeholder: A good addition would be... validations: required: true - - type: "textarea" - id: "config-changes" + - type: textarea + id: solution attributes: - label: "Config Changes" - description: "The configuration changes your feature should have" + label: Implementation Description + description: A clear and concise description of what you want to happen, and any optional **configuration changes** that need to be made. validations: required: false From 28d1775c861d86e2192fde444ce23df44f027407 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sat, 29 Apr 2023 12:46:49 -0400 Subject: [PATCH 10/30] chore: fix 02-feature_request syntax error --- .github/ISSUE_TEMPLATE/02-feature_request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/02-feature_request.yml b/.github/ISSUE_TEMPLATE/02-feature_request.yml index df9eb954..190501ef 100644 --- a/.github/ISSUE_TEMPLATE/02-feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02-feature_request.yml @@ -3,9 +3,9 @@ description: Create a feature request to help us keep track of all features you labels: [enhancement] assignees: ["LoJoSho"] body: -- type: markdown - attributes: - value: | + - type: markdown + attributes: + value: | Please check that the feature you are requesting does not already exist *and/or* hasn't already been requested by someone else. - type: textarea id: description From 50ebc737e661b5ea56a23a0965e1c96d32acc269 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sat, 29 Apr 2023 12:47:25 -0400 Subject: [PATCH 11/30] chore: fix 02-feature-request indent error --- .github/ISSUE_TEMPLATE/02-feature_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/02-feature_request.yml b/.github/ISSUE_TEMPLATE/02-feature_request.yml index 190501ef..3034b282 100644 --- a/.github/ISSUE_TEMPLATE/02-feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02-feature_request.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - Please check that the feature you are requesting does not already exist *and/or* hasn't already been requested by someone else. + Please check that the feature you are requesting does not already exist *and/or* hasn't already been requested by someone else. - type: textarea id: description attributes: From db49946e5eb39db64e23f0987ae748731524158e Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sat, 29 Apr 2023 12:49:10 -0400 Subject: [PATCH 12/30] chore: add discord link at top --- .github/ISSUE_TEMPLATE/02-feature_request.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/02-feature_request.yml b/.github/ISSUE_TEMPLATE/02-feature_request.yml index 3034b282..d5c7958e 100644 --- a/.github/ISSUE_TEMPLATE/02-feature_request.yml +++ b/.github/ISSUE_TEMPLATE/02-feature_request.yml @@ -1,8 +1,12 @@ name: Feature Request -description: Create a feature request to help us keep track of all features you want to be added +description: Request a new feature for HMCCosmetics labels: [enhancement] assignees: ["LoJoSho"] body: + - type: markdown + attributes: + value: | + If you are here to ask a question, use our [Discord server](https://discord.gg/pcm8kWrdNt) instead! - type: markdown attributes: value: | From f0e60903b5234b4dccdc2c35a282314cdaed05a1 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sat, 29 Apr 2023 12:55:31 -0400 Subject: [PATCH 13/30] chore: more PR description options --- .github/PULL_REQUEST_TEMPLATE.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d25e4678..611eb543 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,14 @@ #### Select the option(s) that best describes this PR: - [ ] Major breaking change - [ ] Minor change -- [ ] Bug fix - [ ] Feature implementation -- [ ] Documentation -- [ ] Cleaning -- [ ] Refactoring +- [ ] Bug fix +- [ ] Chore (Changes that don't fix or add new features *and don't* modify source files) +- [ ] Refactoring (Changes that dont't fix or add new features *but do* modify source files) +- [ ] Documentation (Changes to README files and/or JavaDocs) +- [ ] Style (Changes that don't affect the meaning of the code) +- [ ] Performance +- [ ] Other (Please specify below) #### Please describe the changes this PR makes and why it should be merged: From 45e597c665c81a8b89771b54c0a675dffd8a2ce3 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 29 Apr 2023 12:01:20 -0500 Subject: [PATCH 14/30] version bump (2.2.9-DEV) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1f87d73b..5e842823 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.hibiscusmc" -version = "2.2.8" +version = "2.2.9-DEV" allprojects { apply(plugin = "java") From ae8335586067970802a33202dd593782ad71630d Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 29 Apr 2023 22:57:40 -0500 Subject: [PATCH 15/30] feat: add LibsDisguise hook, resolves #85 --- build.gradle.kts | 2 +- common/build.gradle.kts | 3 ++ .../hibiscusmc/hmccosmetics/hooks/Hooks.java | 6 ++-- .../hooks/misc/HookLibsDisguises.java | 32 +++++++++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/misc/HookLibsDisguises.java diff --git a/build.gradle.kts b/build.gradle.kts index 5e842823..fe62d3dc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -168,7 +168,7 @@ bukkit { apiVersion = "1.17" authors = listOf("LoJoSho") depend = listOf("ProtocolLib") - softDepend = listOf("ModelEngine", "Oraxen", "ItemsAdder", "Looty", "HMCColor", "WorldGuard", "MythicMobs", "PlaceholderAPI", "SuperVanish", "PremiumVanish") + softDepend = listOf("ModelEngine", "Oraxen", "ItemsAdder", "Looty", "HMCColor", "WorldGuard", "MythicMobs", "PlaceholderAPI", "SuperVanish", "PremiumVanish", "LibsDisguises") version = "${project.version}" commands { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 060ffef5..cff19603 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -19,6 +19,9 @@ dependencies { compileOnly("it.unimi.dsi:fastutil:8.5.11") compileOnly("io.lumine:Mythic-Dist:5.2.1") compileOnly("com.github.LeonMangler:SuperVanish:6.2.6-4") + compileOnlyApi("LibsDisguises:LibsDisguises:10.0.21") { + exclude("org.spigotmc", "spigot") + } //compileOnly("com.github.Fisher2911:FisherLib:master-SNAPSHOT") implementation("net.kyori:adventure-api:4.12.0") diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java index 7c6ed5e9..47eea18a 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/Hooks.java @@ -2,10 +2,7 @@ package com.hibiscusmc.hmccosmetics.hooks; import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import com.hibiscusmc.hmccosmetics.hooks.items.*; -import com.hibiscusmc.hmccosmetics.hooks.misc.HookCMI; -import com.hibiscusmc.hmccosmetics.hooks.misc.HookHMCColor; -import com.hibiscusmc.hmccosmetics.hooks.misc.HookPremiumVanish; -import com.hibiscusmc.hmccosmetics.hooks.misc.HookSuperVanish; +import com.hibiscusmc.hmccosmetics.hooks.misc.*; import com.hibiscusmc.hmccosmetics.hooks.placeholders.HookPlaceholderAPI; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -28,6 +25,7 @@ public class Hooks { private static HookSuperVanish SUPER_VANISH_HOOK = new HookSuperVanish(); private static HookHMCColor HMC_COLOR_HOOK = new HookHMCColor(); private static HookCMI CMI_HOOK = new HookCMI(); + private static HookLibsDisguises LIBS_DISGUISES_HOOK = new HookLibsDisguises(); public static Hook getHook(@NotNull String id) { return hooks.get(id.toLowerCase()); diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/misc/HookLibsDisguises.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/misc/HookLibsDisguises.java new file mode 100644 index 00000000..4f540674 --- /dev/null +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/misc/HookLibsDisguises.java @@ -0,0 +1,32 @@ +package com.hibiscusmc.hmccosmetics.hooks.misc; + +import com.hibiscusmc.hmccosmetics.hooks.Hook; +import com.hibiscusmc.hmccosmetics.user.CosmeticUser; +import com.hibiscusmc.hmccosmetics.user.CosmeticUsers; +import me.libraryaddict.disguise.events.DisguiseEvent; +import me.libraryaddict.disguise.events.UndisguiseEvent; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.jetbrains.annotations.NotNull; + +public class HookLibsDisguises extends Hook { + public HookLibsDisguises() { + super("LibsDisguises"); + } + + @EventHandler + public void onPlayerVanish(@NotNull DisguiseEvent event) { + if (!(event.getEntity() instanceof Player player)) return; + CosmeticUser user = CosmeticUsers.getUser(player); + if (user == null) return; + user.hideCosmetics(CosmeticUser.HiddenReason.PLUGIN); + } + + @EventHandler + public void onPlayerShow(@NotNull UndisguiseEvent event) { + if (!(event.getEntity() instanceof Player player)) return; + CosmeticUser user = CosmeticUsers.getUser(player); + if (user == null) return; + user.showCosmetics(); + } +} From 38c270558c983391574073a65bbb0379a877563e Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sun, 30 Apr 2023 10:37:57 -0500 Subject: [PATCH 16/30] fix: update PlayerAnimator to 1.2.6 for 1.19.4 support --- build.gradle.kts | 3 ++- common/build.gradle.kts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ac859726..37680377 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -100,7 +100,8 @@ dependencies { implementation("org.bstats:bstats-bukkit:3.0.0") implementation("com.jeff_media:SpigotUpdateChecker:3.0.0") implementation("com.owen1212055:particlehelper:1.0.0-SNAPSHOT") - implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.5") + implementation("com.ticxo:PlayerAnimator:R1.2.6") + //implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.5") } tasks { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 9d099ee3..6cbdfa2d 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -33,7 +33,8 @@ dependencies { implementation("org.bstats:bstats-bukkit:3.0.0") implementation("com.jeff_media:SpigotUpdateChecker:3.0.0") implementation("com.owen1212055:particlehelper:1.0.0-SNAPSHOT") - implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.5") + implementation("com.ticxo:PlayerAnimator:R1.2.6") + //implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.5") } java { From 3137c45704999d21afa6dfe7370a40c8f92717a9 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sun, 30 Apr 2023 14:09:46 -0400 Subject: [PATCH 17/30] chore: add contact link Add a contact link for general questions --- .github/ISSUE_TEMPLATE/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ec4bb386..0565505a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,5 @@ -blank_issues_enabled: false \ No newline at end of file +blank_issues_enabled: false +contact_links: + - name: 🤔 General Questions and Help + url: https://discord.gg/pcm8kWrdNt + about: This issue tracker is not for support questions. Please refer to the Hibiscus community's help and discussion discord server. From b57428e3fec65b5a43941707eb6e257e2ed9e347 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sun, 30 Apr 2023 14:13:21 -0400 Subject: [PATCH 18/30] style: remove emoji from name --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0565505a..59c2b51d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: 🤔 General Questions and Help + - name: General Questions and Help url: https://discord.gg/pcm8kWrdNt about: This issue tracker is not for support questions. Please refer to the Hibiscus community's help and discussion discord server. From e50566e2cb06dbea49c95197210cdd433eb3d69f Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Fri, 5 May 2023 13:53:01 -0500 Subject: [PATCH 19/30] feat: add hasCosmeticInSlot for cosmetic --- .../com/hibiscusmc/hmccosmetics/user/CosmeticUser.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java index b05a2b75..0a99484a 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java @@ -156,6 +156,14 @@ public class CosmeticUser { return playerCosmetics.containsKey(slot); } + public boolean hasCosmeticInSlot(Cosmetic cosmetic) { + if (getCosmetic(cosmetic.getSlot()) == null) return true; + if (cosmetic.getId() == getCosmetic(cosmetic.getSlot()).getId()) { + return true; + } + return false; + } + public Set<CosmeticSlot> getSlotsWithCosmetics() { return Set.copyOf(playerCosmetics.keySet()); } From cfe5f33a630834e3dfc579e688641fb29f9a9627 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Fri, 5 May 2023 14:38:38 -0500 Subject: [PATCH 20/30] version bump (2.3.0-DEV) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 37680377..0baf74ad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.hibiscusmc" -version = "2.2.9-DEV" +version = "2.3.0-DEV" allprojects { apply(plugin = "java") From 91361a63733f5a6bb5633f91ebdb6bdbb721dce1 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Fri, 5 May 2023 14:38:54 -0500 Subject: [PATCH 21/30] feat: equipped and locked cosmetic item in gui --- .../hmccosmetics/cosmetic/Cosmetic.java | 10 ++- .../com/hibiscusmc/hmccosmetics/gui/Menu.java | 38 +++++----- .../hmccosmetics/gui/type/Type.java | 3 +- .../gui/type/types/TypeCosmetic.java | 75 +++++++++---------- .../gui/type/types/TypeEmpty.java | 8 +- .../hmccosmetics/user/CosmeticUser.java | 2 +- 6 files changed, 74 insertions(+), 62 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/Cosmetic.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/Cosmetic.java index 44e74a92..fb2b13b5 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/Cosmetic.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/Cosmetic.java @@ -17,6 +17,7 @@ public abstract class Cosmetic { private String id; private String permission; private ItemStack item; + private String material; private CosmeticSlot slot; private boolean dyable; @@ -29,7 +30,10 @@ public abstract class Cosmetic { this.permission = null; } - if (!config.node("item").virtual()) this.item = generateItemStack(config.node("item")); + if (!config.node("item").virtual()) { + this.material = config.node("item", "material").getString(); + this.item = generateItemStack(config.node("item")); + } MessagesUtil.sendDebugMessages("Slot: " + config.node("slot").getString()); @@ -76,6 +80,10 @@ public abstract class Cosmetic { return this.dyable; } + public String getMaterial() { + return material; + } + public abstract void update(CosmeticUser user); @Nullable diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java index 7107c0d9..169eb5c7 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java @@ -118,14 +118,12 @@ public class Menu { List<Integer> slots = getSlots(slotString); - if (slots == null) { MessagesUtil.sendDebugMessages("Slot is null for " + config.key().toString()); continue; } ItemStack item; - try { item = ItemSerializer.INSTANCE.deserialize(ItemStack.class, config.node("item")); //item = config.node("item").get(ItemStack.class); @@ -145,24 +143,28 @@ public class Menu { if (Types.isType(typeId)) type = Types.getType(typeId); } - ItemStack originalItem = item.clone(); - item = updateLore(user, item, type, config); + for (int slot : slots) { + ItemStack originalItem = item.clone(); + item = updateItem(user, item, type, config, slot); - GuiItem guiItem = ItemBuilder.from(item).asGuiItem(); + GuiItem guiItem = ItemBuilder.from(item).asGuiItem(); - Type finalType = type; - guiItem.setAction(event -> { - final ClickType clickType = event.getClick(); - if (finalType != null) finalType.run(user, config, clickType); + Type finalType = type; + guiItem.setAction(event -> { + MessagesUtil.sendDebugMessages("Selected slot " + slot); + final ClickType clickType = event.getClick(); + if (finalType != null) finalType.run(user, config, clickType); - for (int i : slots) { - gui.updateItem(i, updateLore(user, originalItem.clone(), finalType, config)); - MessagesUtil.sendDebugMessages("Updated slot " + i); - } - }); + for (int guiSlot : slots) { + gui.updateItem(guiSlot, updateItem(user, originalItem.clone(), finalType, config, guiSlot)); + } + gui.update(); + MessagesUtil.sendDebugMessages("Updated slot " + slot); + }); - MessagesUtil.sendDebugMessages("Added " + slots + " as " + guiItem + " in the menu"); - gui.setItem(slots, guiItem); + MessagesUtil.sendDebugMessages("Added " + slots + " as " + guiItem + " in the menu"); + gui.setItem(slot, guiItem); + } } return gui; } @@ -195,9 +197,9 @@ public class Menu { @Contract("_, _, _, _ -> param2") @NotNull - private ItemStack updateLore(CosmeticUser user, @NotNull ItemStack itemStack, Type type, ConfigurationNode config) { + private ItemStack updateItem(CosmeticUser user, @NotNull ItemStack itemStack, Type type, ConfigurationNode config, int slot) { if (itemStack.hasItemMeta()) { - itemStack.setItemMeta(type.setLore(user, config, itemStack.getItemMeta())); + itemStack = type.setItem(user, config, itemStack); } return itemStack; } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java index ef8d7b74..66455047 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java @@ -2,6 +2,7 @@ package com.hibiscusmc.hmccosmetics.gui.type; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.spongepowered.configurate.ConfigurationNode; @@ -24,5 +25,5 @@ public abstract class Type { public abstract void run(CosmeticUser user, ConfigurationNode config, ClickType clickType); - public abstract ItemMeta setLore(CosmeticUser user, ConfigurationNode config, ItemMeta itemMeta); + public abstract ItemStack setItem(CosmeticUser user, ConfigurationNode config, ItemStack itemStack); } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java index 6068fc3e..5ee9b815 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java @@ -1,6 +1,7 @@ package com.hibiscusmc.hmccosmetics.gui.type.types; import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; +import com.hibiscusmc.hmccosmetics.config.serializer.ItemSerializer; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics; import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticArmorType; @@ -17,12 +18,14 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.spongepowered.configurate.ConfigurationNode; import org.spongepowered.configurate.serialize.SerializationException; +import java.lang.invoke.TypeDescriptor; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -96,55 +99,51 @@ public class TypeCosmetic extends Type { } @Override - public ItemMeta setLore(CosmeticUser user, @NotNull ConfigurationNode config, ItemMeta itemMeta) { - List<String> processedLore = new ArrayList<>(); + public ItemStack setItem(CosmeticUser user, @NotNull ConfigurationNode config, ItemStack itemStack) { + ItemMeta itemMeta = itemStack.getItemMeta(); - if (config.node("cosmetic").virtual()) return processLoreLines(user, itemMeta);; + if (config.node("cosmetic").virtual()) { + itemStack.setItemMeta(processLoreLines(user, itemMeta)); + return itemStack; + }; String cosmeticName = config.node("cosmetic").getString(); Cosmetic cosmetic = Cosmetics.getCosmetic(cosmeticName); if (cosmetic == null) { - return processLoreLines(user, itemMeta); + itemStack.setItemMeta(processLoreLines(user, itemMeta)); + return itemStack; } - if (user.canEquipCosmetic(cosmetic)) { - return processLoreLines(user, itemMeta); - } else { - ConfigurationNode itemConfig = config.node("item"); - if (itemConfig.virtual()) return itemMeta; - if (itemConfig.node("locked-name").virtual() && itemConfig.node("locked-lore").virtual()) { - return processLoreLines(user, itemMeta); + if (user.hasCosmeticInSlot(cosmetic) && !config.node("equipped-item").virtual()) { + ConfigurationNode equippedItem = config.node("equipped-item"); + try { + if (equippedItem.node("material").virtual()) equippedItem.node("material").set(config.node("item", "material").getString()); + } catch (SerializationException e) { + // Nothing >:) } try { - List<String> lockedLore = itemMeta.getLore(); - String lockedName = itemMeta.getDisplayName(); - - if (!itemConfig.node("locked-lore").virtual()) { - lockedLore = Utils.replaceIfNull(itemConfig.node("locked-lore").getList(String.class), - new ArrayList<String>()). - stream().map(StringUtils::parseStringToString).collect(Collectors.toList()); - } - if (!itemConfig.node("locked-name").virtual()) { - lockedName = StringUtils.parseStringToString(Utils.replaceIfNull(itemConfig.node("locked-name").getString(), "")); - } - - if (Hooks.isActiveHook("PlaceHolderAPI")) { - lockedName = PlaceholderAPI.setPlaceholders(user.getPlayer(), lockedName); - } - itemMeta.setDisplayName(lockedName); - if (itemMeta.hasLore()) { - itemMeta.getLore().clear(); - for (String loreLine : lockedLore) { - if (Hooks.isActiveHook("PlaceHolderAPI")) loreLine = PlaceholderAPI.setPlaceholders(user.getPlayer(), loreLine); - processedLore.add(loreLine); - } - } - } catch (Exception e) { - e.printStackTrace(); + itemStack = ItemSerializer.INSTANCE.deserialize(ItemStack.class, equippedItem); + } catch (SerializationException e) { + throw new RuntimeException(e); } + return itemStack; } - itemMeta.setLore(processedLore); - return itemMeta; + if (!user.canEquipCosmetic(cosmetic) && !config.node("locked-item").virtual()) { + ConfigurationNode lockedItem = config.node("locked-item"); + try { + if (lockedItem.node("material").virtual()) lockedItem.node("material").set(config.node("item", "material").getString()); + } catch (SerializationException e) { + // Nothing >:) + } + try { + itemStack = ItemSerializer.INSTANCE.deserialize(ItemStack.class, lockedItem); + //item = config.node("item").get(ItemStack.class); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return itemStack; + } + return itemStack; } @Contract("_, _ -> param2") diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java index 5c33b16f..6c4a7cc4 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java @@ -6,6 +6,7 @@ import com.hibiscusmc.hmccosmetics.hooks.Hooks; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import me.clip.placeholderapi.PlaceholderAPI; import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.jetbrains.annotations.NotNull; import org.spongepowered.configurate.ConfigurationNode; @@ -53,8 +54,9 @@ public class TypeEmpty extends Type { @Override @SuppressWarnings("Duplicates") - public ItemMeta setLore(CosmeticUser user, ConfigurationNode config, @NotNull ItemMeta itemMeta) { + public ItemStack setItem(CosmeticUser user, ConfigurationNode config, @NotNull ItemStack itemStack) { List<String> processedLore = new ArrayList<>(); + ItemMeta itemMeta = itemStack.getItemMeta(); if (itemMeta.hasLore()) { for (String loreLine : itemMeta.getLore()) { @@ -63,8 +65,8 @@ public class TypeEmpty extends Type { processedLore.add(loreLine); } } - - return itemMeta; + itemStack.setItemMeta(itemMeta); + return itemStack; } // That's it! Now, add it as a static in another one of your classes (such as your main class) and you are good to go. diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java index 0a99484a..bcf52057 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java @@ -157,7 +157,7 @@ public class CosmeticUser { } public boolean hasCosmeticInSlot(Cosmetic cosmetic) { - if (getCosmetic(cosmetic.getSlot()) == null) return true; + if (getCosmetic(cosmetic.getSlot()) == null) return false; if (cosmetic.getId() == getCosmetic(cosmetic.getSlot()).getId()) { return true; } From 0e9164a506c320e4efdad3f56adc7ddaadc92280 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Fri, 5 May 2023 16:23:03 -0500 Subject: [PATCH 22/30] fix: multi-slot gui items actions not running --- .../src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java index 169eb5c7..06e3da6c 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java @@ -144,10 +144,8 @@ public class Menu { } for (int slot : slots) { - ItemStack originalItem = item.clone(); - item = updateItem(user, item, type, config, slot); - - GuiItem guiItem = ItemBuilder.from(item).asGuiItem(); + ItemStack originalItem = updateItem(user, item, type, config, slot).clone(); + GuiItem guiItem = ItemBuilder.from(originalItem).asGuiItem(); Type finalType = type; guiItem.setAction(event -> { From 7f37937185f8eb1e98bb53e45a0bdda59d58875b Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Fri, 5 May 2023 16:34:01 -0500 Subject: [PATCH 23/30] clean: removed method not needed --- common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java | 1 - 1 file changed, 1 deletion(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java index 06e3da6c..84ddf7d7 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java @@ -156,7 +156,6 @@ public class Menu { for (int guiSlot : slots) { gui.updateItem(guiSlot, updateItem(user, originalItem.clone(), finalType, config, guiSlot)); } - gui.update(); MessagesUtil.sendDebugMessages("Updated slot " + slot); }); From 79f33ca0d13e240fab06bab82692f520ea6e7a7b Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Fri, 5 May 2023 18:39:14 -0400 Subject: [PATCH 24/30] feat: allow for multiple emotes in one bbmodel file --- .../hmccosmetics/HMCCosmeticsPlugin.java | 49 ++++++++++++------- .../hmccosmetics/command/CosmeticCommand.java | 4 +- .../command/CosmeticCommandTabComplete.java | 4 +- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java index d0ce232b..7aa907a6 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java @@ -20,7 +20,6 @@ import com.hibiscusmc.hmccosmetics.listener.PlayerGameListener; import com.hibiscusmc.hmccosmetics.nms.NMSHandlers; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import com.hibiscusmc.hmccosmetics.user.CosmeticUsers; -import com.hibiscusmc.hmccosmetics.user.manager.UserEmoteManager; import com.hibiscusmc.hmccosmetics.util.MessagesUtil; import com.hibiscusmc.hmccosmetics.util.TranslationUtil; import com.jeff_media.updatechecker.UpdateCheckSource; @@ -44,6 +43,8 @@ import org.spongepowered.configurate.yaml.YamlConfigurationLoader; import java.io.File; import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; import java.util.Map; public final class HMCCosmeticsPlugin extends JavaPlugin { @@ -55,6 +56,7 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { private static boolean hasModelEngine = false; private static boolean onLatestVersion = true; private static String latestVersion = ""; + private static final Map<String, String> emoteMap = new HashMap<>(); @Override public void onEnable() { @@ -241,23 +243,7 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { } } - File emoteFolder = new File(getInstance().getDataFolder().getPath() + "/emotes/"); - if (emoteFolder.exists()) { - PlayerAnimator.api.getAnimationManager().clearRegistry(); - File[] emotesFiles = emoteFolder.listFiles(); - for (File emoteFile : emotesFiles) { - if (!emoteFile.getName().contains("bbmodel")) continue; - String animationName = FilenameUtils.removeExtension(emoteFile.getName()); - PlayerAnimator.api.getAnimationManager().importAnimations(animationName, emoteFile); - MessagesUtil.sendDebugMessages("Added '" + animationName + "' to Player Animator "); - } - - /* - for (Map.Entry<String, AnimationPack> packEntry : PlayerAnimator.api.getAnimationManager().getRegistry().entrySet()) { - Set<String> animationNames = packEntry.getValue().getAnimations().keySet().stream().map(animation -> packEntry.getKey().replace(":", ".") + "." + animation).collect(Collectors.toSet()); - } - */ - } + loadEmotes(); getInstance().getLogger().info("Successfully Enabled HMCCosmetics"); getInstance().getLogger().info(Cosmetics.values().size() + " Cosmetics Successfully Setup"); @@ -293,4 +279,31 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { public static String getLatestVersion() { return latestVersion; } + + private static void loadEmotes() { + File emoteDir = new File(getInstance().getDataFolder().getPath() + "/emotes/"); + if (!emoteDir.exists()) return; + + File[] emoteFiles = emoteDir.listFiles(); + if (emoteFiles == null || emoteFiles.length == 0) return; + + emoteFiles = Arrays.stream(emoteFiles).filter(file -> file.getPath().endsWith(".bbmodel")).distinct().toArray(File[]::new); + if (emoteFiles.length == 0) return; + + for (File animationFile : emoteFiles) { + String animationKey = FilenameUtils.removeExtension(animationFile.getName()); + PlayerAnimator.api.getAnimationManager().importAnimations(animationKey, animationFile); + } + + for (Map.Entry<String, AnimationPack> packEntry : PlayerAnimator.api.getAnimationManager().getRegistry().entrySet()) { + packEntry.getValue().getAnimations().keySet().forEach(animation -> { + String key = packEntry.getKey().replace(":", ".") + "." + animation; + emoteMap.put(animation, key); + }); + } + } + + public static Map<String, String> getEmoteMap() { + return emoteMap; + } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java index 46f65cd7..42f966ce 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java @@ -429,7 +429,7 @@ public class CosmeticCommand implements CommandExecutor { } if (args.length >= 2) { - if (!PlayerAnimator.api.getAnimationManager().getRegistry().keySet().contains(args[1])) { + if (!HMCCosmeticsPlugin.getEmoteMap().containsKey(args[1])) { MessagesUtil.sendDebugMessages("Did not contain " + args[1]); if (!silent) MessagesUtil.sendMessage(sender, "emote-invalid"); return true; @@ -444,7 +444,7 @@ public class CosmeticCommand implements CommandExecutor { return true; } CosmeticUser user = CosmeticUsers.getUser(player); - user.getUserEmoteManager().playEmote(args[1]); + user.getUserEmoteManager().playEmote(HMCCosmeticsPlugin.getEmoteMap().get(args[1])); return true; } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java index 563e79ed..b138b3f3 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java @@ -1,5 +1,6 @@ package com.hibiscusmc.hmccosmetics.command; +import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic; import com.hibiscusmc.hmccosmetics.cosmetic.CosmeticSlot; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics; @@ -7,7 +8,6 @@ import com.hibiscusmc.hmccosmetics.gui.Menu; import com.hibiscusmc.hmccosmetics.gui.Menus; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import com.hibiscusmc.hmccosmetics.user.CosmeticUsers; -import com.ticxo.playeranimator.api.PlayerAnimator; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -82,7 +82,7 @@ public class CosmeticCommandTabComplete implements TabCompleter { completions.add("leavelocation"); } case "playemote" -> { - completions.addAll(PlayerAnimator.api.getAnimationManager().getRegistry().keySet()); + completions.addAll(HMCCosmeticsPlugin.getEmoteMap().keySet()); } } StringUtil.copyPartialMatches(args[1], completions, finalCompletions); From d1d001fcf6f5f753b53ed68165743c3ff7945130 Mon Sep 17 00:00:00 2001 From: Craftinators <craftinatorssx@gmail.com> Date: Sat, 6 May 2023 00:02:03 -0400 Subject: [PATCH 25/30] refactor(EmoteManager): move emote loading logic to `EmoteManager` class --- .../hmccosmetics/HMCCosmeticsPlugin.java | 37 +------- .../hmccosmetics/command/CosmeticCommand.java | 14 ++- .../command/CosmeticCommandTabComplete.java | 6 +- .../hmccosmetics/emotes/EmoteManager.java | 85 +++++++++++++++++++ 4 files changed, 95 insertions(+), 47 deletions(-) create mode 100644 common/src/main/java/com/hibiscusmc/hmccosmetics/emotes/EmoteManager.java diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java index 7aa907a6..d80a5ad0 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java @@ -11,6 +11,7 @@ import com.hibiscusmc.hmccosmetics.config.serializer.LocationSerializer; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics; import com.hibiscusmc.hmccosmetics.database.Database; +import com.hibiscusmc.hmccosmetics.emotes.EmoteManager; import com.hibiscusmc.hmccosmetics.gui.Menus; import com.hibiscusmc.hmccosmetics.hooks.Hooks; import com.hibiscusmc.hmccosmetics.hooks.worldguard.WGHook; @@ -25,9 +26,6 @@ import com.hibiscusmc.hmccosmetics.util.TranslationUtil; import com.jeff_media.updatechecker.UpdateCheckSource; import com.jeff_media.updatechecker.UpdateChecker; import com.ticxo.playeranimator.PlayerAnimatorImpl; -import com.ticxo.playeranimator.api.PlayerAnimator; -import com.ticxo.playeranimator.api.animation.pack.AnimationPack; -import org.apache.commons.io.FilenameUtils; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -43,9 +41,6 @@ import org.spongepowered.configurate.yaml.YamlConfigurationLoader; import java.io.File; import java.nio.file.Path; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; public final class HMCCosmeticsPlugin extends JavaPlugin { @@ -56,7 +51,6 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { private static boolean hasModelEngine = false; private static boolean onLatestVersion = true; private static String latestVersion = ""; - private static final Map<String, String> emoteMap = new HashMap<>(); @Override public void onEnable() { @@ -243,7 +237,7 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { } } - loadEmotes(); + EmoteManager.loadEmotes(); getInstance().getLogger().info("Successfully Enabled HMCCosmetics"); getInstance().getLogger().info(Cosmetics.values().size() + " Cosmetics Successfully Setup"); @@ -279,31 +273,4 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { public static String getLatestVersion() { return latestVersion; } - - private static void loadEmotes() { - File emoteDir = new File(getInstance().getDataFolder().getPath() + "/emotes/"); - if (!emoteDir.exists()) return; - - File[] emoteFiles = emoteDir.listFiles(); - if (emoteFiles == null || emoteFiles.length == 0) return; - - emoteFiles = Arrays.stream(emoteFiles).filter(file -> file.getPath().endsWith(".bbmodel")).distinct().toArray(File[]::new); - if (emoteFiles.length == 0) return; - - for (File animationFile : emoteFiles) { - String animationKey = FilenameUtils.removeExtension(animationFile.getName()); - PlayerAnimator.api.getAnimationManager().importAnimations(animationKey, animationFile); - } - - for (Map.Entry<String, AnimationPack> packEntry : PlayerAnimator.api.getAnimationManager().getRegistry().entrySet()) { - packEntry.getValue().getAnimations().keySet().forEach(animation -> { - String key = packEntry.getKey().replace(":", ".") + "." + animation; - emoteMap.put(animation, key); - }); - } - } - - public static Map<String, String> getEmoteMap() { - return emoteMap; - } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java index 42f966ce..60fb4aaa 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java @@ -8,6 +8,7 @@ import com.hibiscusmc.hmccosmetics.cosmetic.CosmeticSlot; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics; import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticEmoteType; import com.hibiscusmc.hmccosmetics.database.Database; +import com.hibiscusmc.hmccosmetics.emotes.EmoteManager; import com.hibiscusmc.hmccosmetics.gui.Menu; import com.hibiscusmc.hmccosmetics.gui.Menus; import com.hibiscusmc.hmccosmetics.gui.special.DyeMenu; @@ -15,7 +16,6 @@ import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import com.hibiscusmc.hmccosmetics.user.CosmeticUsers; import com.hibiscusmc.hmccosmetics.util.MessagesUtil; import com.hibiscusmc.hmccosmetics.util.ServerUtils; -import com.ticxo.playeranimator.api.PlayerAnimator; import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import org.apache.commons.lang3.EnumUtils; @@ -428,12 +428,10 @@ public class CosmeticCommand implements CommandExecutor { return true; } - if (args.length >= 2) { - if (!HMCCosmeticsPlugin.getEmoteMap().containsKey(args[1])) { - MessagesUtil.sendDebugMessages("Did not contain " + args[1]); - if (!silent) MessagesUtil.sendMessage(sender, "emote-invalid"); - return true; - } + if (!EmoteManager.has(args[1])) { + MessagesUtil.sendDebugMessages("Did not contain " + args[1]); + if (!silent) MessagesUtil.sendMessage(sender, "emote-invalid"); + return true; } if (sender.hasPermission("hmccosmetics.cmd.playemote.other")) { @@ -444,7 +442,7 @@ public class CosmeticCommand implements CommandExecutor { return true; } CosmeticUser user = CosmeticUsers.getUser(player); - user.getUserEmoteManager().playEmote(HMCCosmeticsPlugin.getEmoteMap().get(args[1])); + user.getUserEmoteManager().playEmote(EmoteManager.get(args[1])); return true; } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java index b138b3f3..03445bdd 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java @@ -1,9 +1,9 @@ package com.hibiscusmc.hmccosmetics.command; -import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic; import com.hibiscusmc.hmccosmetics.cosmetic.CosmeticSlot; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetics; +import com.hibiscusmc.hmccosmetics.emotes.EmoteManager; import com.hibiscusmc.hmccosmetics.gui.Menu; import com.hibiscusmc.hmccosmetics.gui.Menus; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; @@ -81,9 +81,7 @@ public class CosmeticCommandTabComplete implements TabCompleter { completions.add("viewerlocation"); completions.add("leavelocation"); } - case "playemote" -> { - completions.addAll(HMCCosmeticsPlugin.getEmoteMap().keySet()); - } + case "playemote" -> completions.addAll(EmoteManager.getAllNames()); } StringUtil.copyPartialMatches(args[1], completions, finalCompletions); } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/emotes/EmoteManager.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/emotes/EmoteManager.java new file mode 100644 index 00000000..ea0d8a39 --- /dev/null +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/emotes/EmoteManager.java @@ -0,0 +1,85 @@ +package com.hibiscusmc.hmccosmetics.emotes; + +import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; +import com.ticxo.playeranimator.api.PlayerAnimator; +import com.ticxo.playeranimator.api.animation.pack.AnimationPack; +import org.apache.commons.io.FilenameUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * Manages Emotes + */ +@SuppressWarnings("SpellCheckingInspection") +public class EmoteManager { + private static final @NotNull Map<@NotNull String, @NotNull String> emotes = new HashMap<>(); + + /** + * Loads all BlockBench animations from the emotes folder and puts it into the animation manager registry and local registry + */ + public static void loadEmotes() { + // Clear the PlayerAnimator and local registries + PlayerAnimator.api.getAnimationManager().clearRegistry(); + emotes.clear(); + + // Get the emote directory and check if it exists + File emoteDir = new File(HMCCosmeticsPlugin.getInstance().getDataFolder().getPath() + "/emotes/"); + if (!emoteDir.exists()) return; + + // Get all the files inside the directory and check if it isn't 0 + File[] emoteFiles = emoteDir.listFiles(); + if (emoteFiles == null || emoteFiles.length == 0) return; + + // Remove any files that don't have the file extension ".bbmodel" and check if there are still resulting files + emoteFiles = Arrays.stream(emoteFiles).filter(file -> file.getPath().endsWith(".bbmodel")).distinct().toArray(File[]::new); + if (emoteFiles.length == 0) return; + + // Loop through all files, importing all block bench animations into the registry + for (File animationFile : emoteFiles) { + String animationKey = FilenameUtils.removeExtension(animationFile.getName()); + PlayerAnimator.api.getAnimationManager().importAnimations(animationKey, animationFile); + } + + // Loops through all the entries in the registries and unpacks any animation packs to ensure if there were multiple animations + // inside a singular file, that they are added to the local registry individually for tab completion + for (Map.Entry<String, AnimationPack> packEntry : PlayerAnimator.api.getAnimationManager().getRegistry().entrySet()) { + packEntry.getValue().getAnimations().keySet().forEach(animationName -> { + // API key is the format "animationKey.animationFileName.animationName" + String apiKey = packEntry.getKey().replace(":", ".") + "." + animationName; + emotes.put(animationName, apiKey); + }); + } + } + + /** + * Returns true if there is an animation with the specified name + * @param animationName Name whose presence is to be tested + * @return True if this registry contains a mapping for the specified name + */ + public static boolean has(@NotNull String animationName) { + return emotes.containsKey(animationName); + } + + /** + * Returns the {@code API key} to which the specified name is mapped, or {@code null} if this map contains no mapping for the name. + * @param animationName Name whose {@code API key} is to be fetched + * @return The {@code API key} of the specified name or {@code null} if there was no animation name found + */ + public static @Nullable String get(@NotNull String animationName) { + return emotes.get(animationName); + } + + /** + * Gets a set of all the laoded animation names + * @return A set of all loaded animation names + */ + public static @NotNull Set<String> getAllNames() { + return emotes.keySet(); + } +} From e59717d61d614210ff495444fec8b5a551a9423d Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 6 May 2023 09:34:10 -0500 Subject: [PATCH 26/30] feat: positive emote distances show camera facing player --- .../hmccosmetics/user/manager/UserEmoteModel.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java index 79258f47..403d5055 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserEmoteModel.java @@ -57,6 +57,11 @@ public class UserEmoteModel extends PlayerModel { double DISTANCE = Settings.getEmoteDistance(); Location thirdPersonLocation = newLocation.add(newLocation.getDirection().normalize().multiply(DISTANCE)); + if (DISTANCE > 0) { + MessagesUtil.sendDebugMessages("Yaw " + (int) thirdPersonLocation.getYaw()); + MessagesUtil.sendDebugMessages("New Yaw " + ServerUtils.getNextYaw((int) thirdPersonLocation.getYaw(), 180)); + thirdPersonLocation.setYaw(ServerUtils.getNextYaw((int) thirdPersonLocation.getYaw(), 180)); + } if (Settings.getCosmeticEmoteBlockCheck() && thirdPersonLocation.getBlock().getType().isOccluding()) { stopAnimation(); MessagesUtil.sendMessage(player, "emote-blocked"); @@ -70,7 +75,7 @@ public class UserEmoteModel extends PlayerModel { PacketManager.sendEntitySpawnPacket(thirdPersonLocation, armorStandId, EntityType.ARMOR_STAND, UUID.randomUUID(), viewer); PacketManager.sendInvisibilityPacket(armorStandId, viewer); - PacketManager.sendLookPacket(armorStandId, player.getLocation(), viewer); + PacketManager.sendLookPacket(armorStandId, thirdPersonLocation, viewer); PacketManager.gamemodeChangePacket(player, 3); PacketManager.sendCameraPacket(armorStandId, viewer); From ebc7bfa30a0f3c71c09a39647088823da64ec2d4 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 6 May 2023 09:37:54 -0500 Subject: [PATCH 27/30] feat: menu now passes int slot to gui item types --- common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java | 2 +- .../main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java | 2 +- .../hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java | 2 +- .../com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java index 84ddf7d7..8d57d6a2 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/Menu.java @@ -196,7 +196,7 @@ public class Menu { @NotNull private ItemStack updateItem(CosmeticUser user, @NotNull ItemStack itemStack, Type type, ConfigurationNode config, int slot) { if (itemStack.hasItemMeta()) { - itemStack = type.setItem(user, config, itemStack); + itemStack = type.setItem(user, config, itemStack, slot); } return itemStack; } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java index 66455047..4c5cbddf 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/Type.java @@ -25,5 +25,5 @@ public abstract class Type { public abstract void run(CosmeticUser user, ConfigurationNode config, ClickType clickType); - public abstract ItemStack setItem(CosmeticUser user, ConfigurationNode config, ItemStack itemStack); + public abstract ItemStack setItem(CosmeticUser user, ConfigurationNode config, ItemStack itemStack, int slot); } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java index 5ee9b815..8ebdbe4d 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeCosmetic.java @@ -99,7 +99,7 @@ public class TypeCosmetic extends Type { } @Override - public ItemStack setItem(CosmeticUser user, @NotNull ConfigurationNode config, ItemStack itemStack) { + public ItemStack setItem(CosmeticUser user, @NotNull ConfigurationNode config, ItemStack itemStack, int slot) { ItemMeta itemMeta = itemStack.getItemMeta(); if (config.node("cosmetic").virtual()) { diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java index 6c4a7cc4..94f08ad7 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/gui/type/types/TypeEmpty.java @@ -54,7 +54,7 @@ public class TypeEmpty extends Type { @Override @SuppressWarnings("Duplicates") - public ItemStack setItem(CosmeticUser user, ConfigurationNode config, @NotNull ItemStack itemStack) { + public ItemStack setItem(CosmeticUser user, ConfigurationNode config, @NotNull ItemStack itemStack, int slot) { List<String> processedLore = new ArrayList<>(); ItemMeta itemMeta = itemStack.getItemMeta(); From 6ec13051bb7b5e54808030bde59a06fc6dc83b67 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 6 May 2023 09:40:13 -0500 Subject: [PATCH 28/30] clean: user tick debug message --- .../java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java index bcf52057..d96d91d7 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java @@ -52,7 +52,7 @@ public class CosmeticUser { private void tick() { // Occasionally updates the entity cosmetics Runnable run = () -> { - MessagesUtil.sendDebugMessages("Tick[" + uniqueId + "]", Level.INFO); + MessagesUtil.sendDebugMessages("Tick[uuid=" + uniqueId + "]", Level.INFO); updateCosmetic(); }; From aca14f8a04eb24f8a77189527186db53bb048d92 Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 6 May 2023 09:47:24 -0500 Subject: [PATCH 29/30] clean: config referenced wrong value in comments --- common/src/main/resources/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index ab147156..6739cedf 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -73,7 +73,7 @@ wardrobe: gamemode-options: exit-gamemode-enabled: false # Setting this to false will set the gamemode the player came in as. True sets to exit-gamemode gamemode - exit-gamemode: "SURVIVAL" # Only activates if force-exit-gamemode is true, find gamemodes here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/GameMode.html + exit-gamemode: "SURVIVAL" # Only activates if exit-gamemode-enabled is true, find gamemodes here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/GameMode.html # Bossbar that shows when a player is in a wardrobe. bossbar: From ab8ae8ee7602f10c2fdca3737f0800fa24a1b2aa Mon Sep 17 00:00:00 2001 From: LoJoSho <LoJoShogaming@gmail.com> Date: Sat, 6 May 2023 10:28:26 -0500 Subject: [PATCH 30/30] version bump (2.3.0) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0baf74ad..9d76d442 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.hibiscusmc" -version = "2.3.0-DEV" +version = "2.3.0" allprojects { apply(plugin = "java")