diff --git a/.gradle/8.8/checksums/checksums.lock b/.gradle/8.8/checksums/checksums.lock index b98f7ff..f8c0b5d 100644 Binary files a/.gradle/8.8/checksums/checksums.lock and b/.gradle/8.8/checksums/checksums.lock differ diff --git a/.gradle/8.8/checksums/md5-checksums.bin b/.gradle/8.8/checksums/md5-checksums.bin index eeffb37..7bbd38e 100644 Binary files a/.gradle/8.8/checksums/md5-checksums.bin and b/.gradle/8.8/checksums/md5-checksums.bin differ diff --git a/.gradle/8.8/checksums/sha1-checksums.bin b/.gradle/8.8/checksums/sha1-checksums.bin index d3e352e..3cb35da 100644 Binary files a/.gradle/8.8/checksums/sha1-checksums.bin and b/.gradle/8.8/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.8/executionHistory/executionHistory.bin b/.gradle/8.8/executionHistory/executionHistory.bin index 2c28973..74653d7 100644 Binary files a/.gradle/8.8/executionHistory/executionHistory.bin and b/.gradle/8.8/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.8/executionHistory/executionHistory.lock b/.gradle/8.8/executionHistory/executionHistory.lock index 26b8a20..4aa80e4 100644 Binary files a/.gradle/8.8/executionHistory/executionHistory.lock and b/.gradle/8.8/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.8/fileHashes/fileHashes.bin b/.gradle/8.8/fileHashes/fileHashes.bin index 043bfae..851a0d1 100644 Binary files a/.gradle/8.8/fileHashes/fileHashes.bin and b/.gradle/8.8/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.8/fileHashes/fileHashes.lock b/.gradle/8.8/fileHashes/fileHashes.lock index 4142dd6..fd0861b 100644 Binary files a/.gradle/8.8/fileHashes/fileHashes.lock and b/.gradle/8.8/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.8/fileHashes/resourceHashesCache.bin b/.gradle/8.8/fileHashes/resourceHashesCache.bin index 1bdc586..5c91ea9 100644 Binary files a/.gradle/8.8/fileHashes/resourceHashesCache.bin and b/.gradle/8.8/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 3a4e6f1..4f4a653 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index a2f14f8..223055b 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 11cf80d..72038b8 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/build.gradle b/build.gradle index 659ec98..36f17a5 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { } group = 'com.newt-tech' -version = '1.12-RELEASE' +version = '1.13-RELEASE' repositories { mavenCentral() diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$1.class b/build/classes/java/main/CoswayUtil/CoswayUtil$1.class index 2e2d776..6202ff1 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$1.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$1.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$2.class b/build/classes/java/main/CoswayUtil/CoswayUtil$2.class index f2d540e..a4ffb8d 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$2.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$2.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class index b6b0904..dc62953 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$1.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class index 0fd550f..f81aceb 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$2.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class index 5c0a116..9b6057f 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$3.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class index e52a22c..d5ea818 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield$4.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class index 84d3cb7..4329877 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class and b/build/classes/java/main/CoswayUtil/CoswayUtil$AnchorShield.class differ diff --git a/build/classes/java/main/CoswayUtil/CoswayUtil.class b/build/classes/java/main/CoswayUtil/CoswayUtil.class index 8d2fc78..9111b6e 100644 Binary files a/build/classes/java/main/CoswayUtil/CoswayUtil.class and b/build/classes/java/main/CoswayUtil/CoswayUtil.class differ diff --git a/build/classes/java/main/CoswayUtil/FireflySimulator$1.class b/build/classes/java/main/CoswayUtil/FireflySimulator$1.class index 62d16c2..89887e8 100644 Binary files a/build/classes/java/main/CoswayUtil/FireflySimulator$1.class and b/build/classes/java/main/CoswayUtil/FireflySimulator$1.class differ diff --git a/build/classes/java/main/CoswayUtil/FireflySimulator$2.class b/build/classes/java/main/CoswayUtil/FireflySimulator$2.class index b307551..8173864 100644 Binary files a/build/classes/java/main/CoswayUtil/FireflySimulator$2.class and b/build/classes/java/main/CoswayUtil/FireflySimulator$2.class differ diff --git a/build/classes/java/main/CoswayUtil/FireflySimulator.class b/build/classes/java/main/CoswayUtil/FireflySimulator.class index 7eac3d8..4a1eed8 100644 Binary files a/build/classes/java/main/CoswayUtil/FireflySimulator.class and b/build/classes/java/main/CoswayUtil/FireflySimulator.class differ diff --git a/build/classes/java/main/CoswayUtil/MaceOfStorms$1.class b/build/classes/java/main/CoswayUtil/MaceOfStorms$1.class new file mode 100644 index 0000000..7f5fd4d Binary files /dev/null and b/build/classes/java/main/CoswayUtil/MaceOfStorms$1.class differ diff --git a/build/classes/java/main/CoswayUtil/MaceOfStorms.class b/build/classes/java/main/CoswayUtil/MaceOfStorms.class new file mode 100644 index 0000000..8eb3560 Binary files /dev/null and b/build/classes/java/main/CoswayUtil/MaceOfStorms.class differ diff --git a/build/classes/java/main/CoswayUtil/MaceOfStormsCommand.class b/build/classes/java/main/CoswayUtil/MaceOfStormsCommand.class new file mode 100644 index 0000000..cdf5aea Binary files /dev/null and b/build/classes/java/main/CoswayUtil/MaceOfStormsCommand.class differ diff --git a/build/classes/java/main/CoswayUtil/NoteStudio$1.class b/build/classes/java/main/CoswayUtil/NoteStudio$1.class new file mode 100644 index 0000000..88fdf67 Binary files /dev/null and b/build/classes/java/main/CoswayUtil/NoteStudio$1.class differ diff --git a/build/classes/java/main/CoswayUtil/NoteStudio.class b/build/classes/java/main/CoswayUtil/NoteStudio.class new file mode 100644 index 0000000..4cf4a9c Binary files /dev/null and b/build/classes/java/main/CoswayUtil/NoteStudio.class differ diff --git a/build/classes/java/main/CoswayUtil/TreasureFountain$1.class b/build/classes/java/main/CoswayUtil/TreasureFountain$1.class new file mode 100644 index 0000000..b2edd36 Binary files /dev/null and b/build/classes/java/main/CoswayUtil/TreasureFountain$1.class differ diff --git a/build/classes/java/main/CoswayUtil/TreasureFountain.class b/build/classes/java/main/CoswayUtil/TreasureFountain.class new file mode 100644 index 0000000..bac3dcd Binary files /dev/null and b/build/classes/java/main/CoswayUtil/TreasureFountain.class differ diff --git a/build/libs/CoswayUtil-1.12-RELEASE.jar b/build/libs/CoswayUtil-1.12-RELEASE.jar index 0124dc8..cfa5c9d 100644 Binary files a/build/libs/CoswayUtil-1.12-RELEASE.jar and b/build/libs/CoswayUtil-1.12-RELEASE.jar differ diff --git a/build/libs/CoswayUtil-1.13-RELEASE.jar b/build/libs/CoswayUtil-1.13-RELEASE.jar new file mode 100644 index 0000000..548915c Binary files /dev/null and b/build/libs/CoswayUtil-1.13-RELEASE.jar differ diff --git a/build/resources/main/config.yml b/build/resources/main/config.yml index 7458b3d..bb92d3c 100644 --- a/build/resources/main/config.yml +++ b/build/resources/main/config.yml @@ -94,44 +94,69 @@ shop: quantity: 10 display_name: "Obsidian" available: true - utilities: + utils: items: - ASK: + ask: material: KNOWLEDGE_BOOK - price: 450000 + price: 400000 quantity: 1 display_name: "Anchor Shield Kit" available: true - gravity_gauntlet: - material: KNOWLEDGE_BOOK - price: 200000 - quantity: 1 - display_name: "Gravity Gauntlet" - available: true - levitation_wand: - material: KNOWLEDGE_BOOK - price: 1000000 - quantity: 1 - display_name: "Levitation Wand" - available: true - launch_stick: - material: KNOWLEDGE_BOOK - price: 1234567 - quantity: 1 - display_name: "Launch Stick" - available: true - rapid_fire_bow: - material: KNOWLEDGE_BOOK - price: 9000000 - quantity: 1 - display_name: "Rapid Fire Bow" - available: true - illumination_wand: - material: KNOWLEDGE_BOOK - price: 9000000 - quantity: 1 - display_name: "Illumination Wand" - available: true + tool_id: 1 + utils1: + items: + gravity_gauntlet: + material: KNOWLEDGE_BOOK + price: 1500000 + quantity: 1 + display_name: "Gravity Gauntlet" + available: true + tool_id: 2 + utils2: + items: + levitation_wand: + material: KNOWLEDGE_BOOK + price: 600000 + quantity: 1 + display_name: "Levitation Wand" + available: true + tool_id: 3 + utils3: + items: + launch_stick: + material: KNOWLEDGE_BOOK + price: 2000000 + quantity: 1 + display_name: "Launch Stick" + available: true + tool_id: 4 + utils4: + items: + rapid_fire_bow: + material: KNOWLEDGE_BOOK + price: 1000000 + quantity: 1 + display_name: "Rapid Fire Bow" + available: false + tool_id: 5 + utils5: + items: + illumination_wand: + material: KNOWLEDGE_BOOK + price: 500000 + quantity: 1 + display_name: "Illumination Wand" + available: true + tool_id: 6 + utils6: + items: + maceofstorms: + material: KNOWLEDGE_BOOK + price: 600000 + quantity: 1 + display_name: "Mace Of Storms" + available: true + tool_id: 7 poor: "you're too poor for that, get gooder..." inventory_full: "you got too much clutter, cant fit your purchase into that mess..." pagination: diff --git a/build/resources/main/plugin.yml b/build/resources/main/plugin.yml index 7b81ff2..681b253 100644 --- a/build/resources/main/plugin.yml +++ b/build/resources/main/plugin.yml @@ -1,5 +1,5 @@ name: CoswayUtil -version: '1.12-RELEASE' +version: '1.13-RELEASE' main: CoswayUtil.CoswayUtil description: "utility plugin for Cosway servers, a yescraft network server" api-version: '1.21' @@ -45,4 +45,23 @@ commands: repair: description: Repairs the held tool to full durability. usage: /repair - permission: coswayutil.repair \ No newline at end of file + permission: coswayutil.repair + getmace: + description: get the mace of storms + usage: /getmace + permission: CoswayUtil.storm_mace + tone: + description: play the tone + usage: /tone + permission: CoswayUtil.tone + treasurefountain: + description: give player a treasure fountain item + usage: /treasurefountain + permission: CoswayUtil.treasurefountain + coswaysetpdc: + description: set a persistent data container for a desired player + usage: /coswaysetpdc + permission: CoswayUtil.admin + coswaygetpdc: + description: get set value of a players persistent data container key + usage: /coswaygetpdc \ No newline at end of file diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect$1.class.uniqueId16 b/build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect$1.class.uniqueId21 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect$1.class.uniqueId16 rename to build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect$1.class.uniqueId21 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect.class.uniqueId23 b/build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect.class.uniqueId29 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect.class.uniqueId23 rename to build/tmp/compileJava/compileTransaction/stash-dir/BlackholeEffect.class.uniqueId29 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId9 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId13 similarity index 93% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId9 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId13 index 341d5f6..6202ff1 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId9 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$1.class.uniqueId13 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId0 deleted file mode 100644 index 47fe399..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId0 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId2 new file mode 100644 index 0000000..a4ffb8d Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$2.class.uniqueId2 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId18 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId23 similarity index 91% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId18 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId23 index b812d25..dc62953 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId18 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$1.class.uniqueId23 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId8 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId11 similarity index 93% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId8 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId11 index fa87804..f81aceb 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId8 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$2.class.uniqueId11 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId3 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 similarity index 88% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId3 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 index 81bf3aa..9b6057f 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId3 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$3.class.uniqueId6 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId12 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId17 similarity index 93% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId12 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId17 index 5891ef5..d5ea818 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId12 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield$4.class.uniqueId17 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId21 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId27 similarity index 85% rename from build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId21 rename to build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId27 index a3116c9..4329877 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId21 and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil$AnchorShield.class.uniqueId27 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId11 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId11 deleted file mode 100644 index 6f06b34..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId11 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId16 b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId16 new file mode 100644 index 0000000..5bcf9a0 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/CoswayUtil.class.uniqueId16 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId10 b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId10 deleted file mode 100644 index 62d16c2..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId10 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId15 b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId15 new file mode 100644 index 0000000..89887e8 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$1.class.uniqueId15 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId22 b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId28 similarity index 86% rename from build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId22 rename to build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId28 index b307551..8173864 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId22 and b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator$2.class.uniqueId28 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId26 b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId26 deleted file mode 100644 index 7eac3d8..0000000 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId26 and /dev/null differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId32 b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId32 new file mode 100644 index 0000000..4a1eed8 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/FireflySimulator.class.uniqueId32 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId15 b/build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId20 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId15 rename to build/tmp/compileJava/compileTransaction/stash-dir/GiveWandCommand.class.uniqueId20 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId4 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId2 rename to build/tmp/compileJava/compileTransaction/stash-dir/GravityGauntlet.class.uniqueId4 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/IlluminationWand.class.uniqueId17 b/build/tmp/compileJava/compileTransaction/stash-dir/IlluminationWand.class.uniqueId22 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/IlluminationWand.class.uniqueId17 rename to build/tmp/compileJava/compileTransaction/stash-dir/IlluminationWand.class.uniqueId22 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/LaunchStick.class.uniqueId4 b/build/tmp/compileJava/compileTransaction/stash-dir/LaunchStick.class.uniqueId7 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/LaunchStick.class.uniqueId4 rename to build/tmp/compileJava/compileTransaction/stash-dir/LaunchStick.class.uniqueId7 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms$1.class.uniqueId25 b/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms$1.class.uniqueId25 new file mode 100644 index 0000000..7f5fd4d Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms$1.class.uniqueId25 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms.class.uniqueId1 new file mode 100644 index 0000000..8eb3560 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/MaceOfStorms.class.uniqueId1 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId19 b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId24 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId19 rename to build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand$1.class.uniqueId24 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId13 b/build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId18 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId13 rename to build/tmp/compileJava/compileTransaction/stash-dir/MobLevitationWand.class.uniqueId18 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio$1.class.uniqueId12 b/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio$1.class.uniqueId12 new file mode 100644 index 0000000..88fdf67 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio$1.class.uniqueId12 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio.class.uniqueId5 b/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio.class.uniqueId5 new file mode 100644 index 0000000..4cf4a9c Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/NoteStudio.class.uniqueId5 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId25 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId31 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId25 rename to build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge$1.class.uniqueId31 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId20 b/build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId26 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId20 rename to build/tmp/compileJava/compileTransaction/stash-dir/PhantomDodge.class.uniqueId26 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow$1.class.uniqueId24 b/build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow$1.class.uniqueId30 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow$1.class.uniqueId24 rename to build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow$1.class.uniqueId30 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow.class.uniqueId5 b/build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow.class.uniqueId8 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow.class.uniqueId5 rename to build/tmp/compileJava/compileTransaction/stash-dir/RapidFireBow.class.uniqueId8 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId3 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId1 rename to build/tmp/compileJava/compileTransaction/stash-dir/ShadowStep.class.uniqueId3 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain$1.class.uniqueId14 b/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain$1.class.uniqueId14 new file mode 100644 index 0000000..b2edd36 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain$1.class.uniqueId14 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain.class.uniqueId0 new file mode 100644 index 0000000..bac3dcd Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/TreasureFountain.class.uniqueId0 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId14 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId19 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId14 rename to build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$1.class.uniqueId19 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId6 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId9 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId6 rename to build/tmp/compileJava/compileTransaction/stash-dir/WitherContract$2.class.uniqueId9 diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId7 b/build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId10 similarity index 100% rename from build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId7 rename to build/tmp/compileJava/compileTransaction/stash-dir/WitherContract.class.uniqueId10 diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index 447a106..0b298e6 100644 Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/src/main/java/CoswayUtil/CoswayUtil.java b/src/main/java/CoswayUtil/CoswayUtil.java index c64e035..a808acd 100644 --- a/src/main/java/CoswayUtil/CoswayUtil.java +++ b/src/main/java/CoswayUtil/CoswayUtil.java @@ -10,6 +10,7 @@ import org.bukkit.block.data.type.LightningRod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Monster; import org.bukkit.event.EventHandler; @@ -26,6 +27,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BlockStateMeta; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -56,7 +58,7 @@ public final class CoswayUtil extends JavaPlugin implements Listener { Bukkit.getPluginManager().registerEvents(new AnchorShield(), this); // Start the detection loop when the plugin is enabled new AnchorShield().startDetectionLoop(); - registration("Anchor Shield"); + registration("Anchor Shield",1); new BukkitRunnable() { @Override public void run() { @@ -79,17 +81,17 @@ public final class CoswayUtil extends JavaPlugin implements Listener { } } }.runTaskTimer(this, 0, 2); // Runs every 10 ticks (0.5 seconds) - registration("Wither Contract"); - registration("Totem Tweaks"); + registration("Wither Contract",3); + registration("Totem Tweaks",1); // Register Gravity Gauntlet new GravityGauntlet(this); - registration("Gravity Gauntlet"); + registration("Gravity Gauntlet",2); // Register TotemShield new TotemShield(this); - registration("Totem Shield"); + registration("Totem Shield",3); // Register the ShadowStep listener new MobLevitationWand(this); - registration("Levitation Wand"); + registration("Levitation Wand",2); if (!setupEconomy()) { getLogger().severe("Vault not found or no economy provider found."); getServer().getPluginManager().disablePlugin(this); @@ -98,9 +100,9 @@ public final class CoswayUtil extends JavaPlugin implements Listener { new BlockShop(this, economy).register(); new BlockShop(this, economy); - registration("BlockShop"); + registration("BlockShop",3); new RapidFireBow(this); - registration("Rapid Fire Bow"); + registration("Rapid Fire Bow",2); getServer().getPluginManager().registerEvents(new RapidFireBow(this), this); getServer().getPluginManager().registerEvents(new ShadowStep(this), this); //register levitation wand @@ -114,12 +116,20 @@ public final class CoswayUtil extends JavaPlugin implements Listener { this.getCommand("getwand").setExecutor(new GiveWandCommand()); getServer().getPluginManager().registerEvents(new LaunchStick(this), this); new FireflySimulator(this); - registration("FireFlies"); + registration("FireFlies",3); getCommand("unbreakable").setExecutor(new UnbreakableCommand()); - registration("Unbreakable Command"); + registration("Unbreakable Command",1); getCommand("repair").setExecutor(new RepairCommand()); - registration("Repair Command"); - //getServer().getPluginManager().registerEvents(new FireflySimulator(this), this); + registration("Repair Command",1); + new MaceOfStorms(this); + getServer().getPluginManager().registerEvents(new MaceOfStorms(this), this); + getCommand("getmace").setExecutor(new MaceOfStormsCommand()); + registration("Mace Of Storms",2); + NoteStudio.init(this); + registration("Note Studio",1); + new TreasureFountain(this); + getServer().getPluginManager().registerEvents(new TreasureFountain(this), this); + registration("Treasure Fountain",3); new BukkitRunnable() { @Override @@ -141,16 +151,22 @@ public final class CoswayUtil extends JavaPlugin implements Listener { if(removeCustomKnowledgeBook(player,ChatColor.GREEN+"Launch Stick")) { player.getInventory().addItem(LaunchStick.createLaunchStick()); } + if(removeCustomKnowledgeBook(player,ChatColor.GREEN+"Mace Of Storms")) { + ItemStack gauntlet = new ItemStack(Material.MACE); // You can change this to any item you prefer + ItemMeta meta = gauntlet.getItemMeta(); + if (meta != null) { + meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Mace of Storms"); + meta.setLore(Collections.singletonList(ChatColor.GOLD + "Right Click to Smite the target"+ChatColor.GRAY+"\n range: 20 blocks")); + meta.addEnchant(Enchantment.MENDING,1,true); + meta.setUnbreakable(true); + gauntlet.setItemMeta(meta); + } + player.getInventory().addItem(gauntlet); + player.sendMessage(ChatColor.GREEN + "You have been given the Mace Of Storms!"); + } if(removeCustomKnowledgeBook(player,ChatColor.GREEN+"Anchor Shield Kit")) { // Create a chest item giveAnchorKit(player); - /* ItemStack anchor = new ItemStack(Material.RESPAWN_ANCHOR, 1); - ItemStack rod = new ItemStack(Material.LIGHTNING_ROD, 1); - ItemStack core = new ItemStack(Material.HEAVY_CORE, 1); - ItemStack charge = new ItemStack(Material.GLOWSTONE,4); - - // Give the chest and items to the player - player.getInventory().addItem(anchor,rod,core,charge);*/ } if(removeCustomKnowledgeBook(player,ChatColor.GREEN+"Levitation Wand")) { player.getInventory().addItem(MobLevitationWand.createWand()); @@ -165,14 +181,21 @@ public final class CoswayUtil extends JavaPlugin implements Listener { } }.runTaskTimer(this,0,2); new IlluminationWand(this); - registration("Illumination Wand"); + registration("Illumination Wand",2); new BlackholeEffect(this); - registration("BlackHole (W.I.P.)"); + registration("BlackHole (W.I.P.)",1); } - public void registration(String msg) { - Bukkit.broadcastMessage(ColorKey("&7[&eRegistrations&7] &aUtility Registered: &6"+msg)); + public void registration(String msg, int type) { + if(type == 1) { + Bukkit.broadcastMessage(ColorKey("&7[&eRegistrations&7] &aUtility Registered: &6" + msg)); + } else if(type == 2) { + Bukkit.broadcastMessage(ColorKey("&7[&eRegistrations&7] &bTool Registered: &6" + msg)); + } else if(type == 3) { + Bukkit.broadcastMessage(ColorKey("&7[&eRegistrations&7] &dMechanic Registered: &6" + msg)); + + } } private boolean setupEconomy() { // Setup Vault economy (make sure it's enabled and available) @@ -197,15 +220,21 @@ public final class CoswayUtil extends JavaPlugin implements Listener { if (cmd.getName().equalsIgnoreCase("launchstick") && sender instanceof Player player) { player.getInventory().addItem(LaunchStick.createLaunchStick()); } - if (cmd.getName().equalsIgnoreCase("blockshop") && sender instanceof Player player) { + if (cmd.getName().equalsIgnoreCase("treasurefountain") && sender instanceof Player player) { + player.getInventory().addItem(TreasureFountain.getTreasureFountainItem()); + } + if (cmd.getName().equalsIgnoreCase("blockshop") && sender instanceof Player player) { BlockShop.openShop(player,1); } if (cmd.getName().equalsIgnoreCase("shopbook") && sender instanceof Player player) { player.getInventory().addItem(BlockShop.createShopItem()); } - if (cmd.getName().equalsIgnoreCase("Illumination Wand") && sender instanceof Player player) { + if (cmd.getName().equalsIgnoreCase("IlluminationWand") && sender instanceof Player player) { player.getInventory().addItem(IlluminationWand.getIlluminationWand()); } + if (cmd.getName().equalsIgnoreCase("tone") && sender instanceof Player player) { + NoteStudio.playNoteBlockSong(player); + } if (cmd.getName().equalsIgnoreCase("throw") && sender instanceof Player player) { Player Target = getNearestPlayer(player,10); if(Target == null) { @@ -219,10 +248,48 @@ public final class CoswayUtil extends JavaPlugin implements Listener { if (cmd.getName().equalsIgnoreCase("rapidbow") && sender instanceof Player player) { player.getInventory().addItem(RapidFireBow.createRapidFireBow()); } + if (cmd.getName().equalsIgnoreCase("coswaysetpdc") && sender instanceof Player player) { + if(args.length < 3) { + return false; + } else { + Player target = getServer().getPlayer(args[0]); + assert target != null; + setpdc(target,args[1],args[2]); + String msg = getpdc(target,args[1]); + if(msg == null) { + msg = "&cNULL"; + } + returnMsg(player,"&aSet "+args[1]+" from "+msg+" to "+args[2]+" for "+target.getName()); + } + } + if (cmd.getName().equalsIgnoreCase("coswaygetpdc") && sender instanceof Player player) { + if(args.length < 2) { + return false; + } else { + Player target = getServer().getPlayer(args[0]); + assert target != null; + String msg = getpdc(target,args[1]); + if(msg == null) { + returnMsg(player,"&cNo data found for &7[&6"+target.getName()+"&7]-&e"+args[1]); + } else { + returnMsg(player, "PDC data: &7[&6"+target+"&7]-&e"+args[1]+"="+getpdc(target, args[1])); + } + } + } return true; } - + CoswayUtil plugin = this; + public void setpdc(Player player, String key, String value) { + NamespacedKey thiskey = new NamespacedKey(plugin, key); + assert player != null; + player.getPersistentDataContainer().set(thiskey, PersistentDataType.STRING, value); + } + public String getpdc(Player player, String key) { + NamespacedKey thiskey = new NamespacedKey(plugin, key); + String value = player.getPersistentDataContainer().get(thiskey, PersistentDataType.STRING); + return value; + } public String prefix() { return ColorKey("[&7Cosway Utility&r] "); } diff --git a/src/main/java/CoswayUtil/FireflySimulator.java b/src/main/java/CoswayUtil/FireflySimulator.java index 12d9a4d..43d2939 100644 --- a/src/main/java/CoswayUtil/FireflySimulator.java +++ b/src/main/java/CoswayUtil/FireflySimulator.java @@ -1,11 +1,11 @@ package CoswayUtil; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Particle; -import org.bukkit.Sound; +import org.bukkit.*; import org.bukkit.entity.Player; +import org.bukkit.persistence.PersistentDataType; import org.bukkit.scheduler.BukkitRunnable; + +import java.util.Objects; import java.util.Random; public class FireflySimulator { @@ -19,19 +19,28 @@ public class FireflySimulator { startSimulation(); } + public String getpdc(Player player, String key) { + NamespacedKey thiskey = new NamespacedKey(plugin, key); + String value = player.getPersistentDataContainer().get(thiskey, PersistentDataType.STRING); + return value; + } public void startSimulation() { new BukkitRunnable() { @Override public void run() { for (Player player : Bukkit.getOnlinePlayers()) { if (player.getWorld().getTime() == 13000) { // Only at night - player.stopAllSounds(); - player.playSound(player.getLocation().clone().add(0,100,0), Sound.MUSIC_DISC_MALL,10,1); + if(Objects.equals(getpdc(player,"music"), true)) { + player.stopAllSounds(); + player.playSound(player.getLocation().clone().add(0, 100, 0), Sound.MUSIC_DISC_MALL, 10, 1); + } statMsg(player,"&6time for bed"); } if (player.getWorld().getTime() == 1137) { // Only at night - player.stopAllSounds(); - player.playSound(player.getLocation().clone().add(0,100,0), Sound.MUSIC_DISC_OTHERSIDE,10,1); + if(Objects.equals(getpdc(player,"music"), true)) { + player.stopAllSounds(); + player.playSound(player.getLocation().clone().add(0, 100, 0), Sound.MUSIC_DISC_OTHERSIDE, 10, 1); + } statMsg(player,"&eRize and Shine!"); } } diff --git a/src/main/java/CoswayUtil/MaceOfStorms.java b/src/main/java/CoswayUtil/MaceOfStorms.java new file mode 100644 index 0000000..c8d9824 --- /dev/null +++ b/src/main/java/CoswayUtil/MaceOfStorms.java @@ -0,0 +1,102 @@ +package CoswayUtil; + +import org.bukkit.*; +import org.bukkit.entity.*; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +import CoswayUtil.CoswayUtil; + +import java.util.List; + +public class MaceOfStorms implements Listener { + + private final CoswayUtil plugin; + + public MaceOfStorms(CoswayUtil plugin) { + this.plugin = plugin; + } + + @EventHandler + public void onMaceUse(PlayerInteractEvent event) { + Player player = event.getPlayer(); + ItemStack item = player.getInventory().getItemInMainHand(); + + if (!isMaceOfStorms(item)) { + return; + } + + LivingEntity target = getTargetEntity(player, 20); + if (target == null) { + player.sendMessage(ChatColor.RED + "You are not looking at a valid target!"); + return; + } + + player.getWorld().playSound(player.getLocation(), Sound.ENTITY_LIGHTNING_BOLT_THUNDER, 1, 1); + + // Shoot particles from player to target + shootParticleBeam(player.getLocation().add(0, 1.5, 0), target.getLocation()); + + // Circle the target and strike with lightning + new BukkitRunnable() { + int ticks = 0; + + @Override + public void run() { + if (ticks >= 40) { // Runs for 2 seconds + target.getWorld().strikeLightning(target.getLocation()); + cancel(); + return; + } + + spawnCirclingParticles(target.getLocation(), ticks); + ticks += 2; + } + }.runTaskTimer(plugin, 0, 2); + } + + private boolean isMaceOfStorms(ItemStack item) { + if (item == null || item.getType() != Material.MACE) { // Mace-like weapon + return false; + } + ItemMeta meta = item.getItemMeta(); + return meta != null && meta.hasDisplayName() && meta.getDisplayName().equalsIgnoreCase(ChatColor.LIGHT_PURPLE+"Mace of Storms"); + } + + private LivingEntity getTargetEntity(Player player, double range) { + List nearbyEntities = player.getNearbyEntities(range, range, range); + for (Entity entity : nearbyEntities) { + if (entity instanceof LivingEntity && entity != player) { + Vector direction = player.getLocation().getDirection(); + Vector entityDirection = entity.getLocation().toVector().subtract(player.getLocation().toVector()).normalize(); + if (direction.dot(entityDirection) > 0.98) { // Check if the entity is in line of sight + return (LivingEntity) entity; + } + } + } + return null; + } + + private void shootParticleBeam(Location from, Location to) { + Vector direction = to.toVector().subtract(from.toVector()).normalize(); + double distance = from.distance(to); + for (double i = 0; i < distance; i += 0.5) { + Location point = from.clone().add(direction.clone().multiply(i)); + from.getWorld().spawnParticle(Particle.ELECTRIC_SPARK, point, 2, 0.1, 0.1, 0.1, 0); + } + } + + private void spawnCirclingParticles(Location location, int time) { + double angle = Math.toRadians(time * 9); // Adjust rotation speed + for (int i = 0; i < 6; i++) { // 6 particles around the entity + double offsetX = Math.cos(angle + (i * Math.PI / 3)) * 1.5; + double offsetZ = Math.sin(angle + (i * Math.PI / 3)) * 1.5; + location.getWorld().spawnParticle(Particle.CRIT, location.clone().add(offsetX, 0.5, offsetZ), 1, 0, 0, 0, 0); + } + } +} diff --git a/src/main/java/CoswayUtil/MaceOfStormsCommand.java b/src/main/java/CoswayUtil/MaceOfStormsCommand.java new file mode 100644 index 0000000..593fe84 --- /dev/null +++ b/src/main/java/CoswayUtil/MaceOfStormsCommand.java @@ -0,0 +1,39 @@ +package CoswayUtil; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import java.util.Collections; + +public class MaceOfStormsCommand implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (sender instanceof Player) { + Player player = (Player) sender; + ItemStack gauntlet = new ItemStack(Material.MACE); // You can change this to any item you prefer + ItemMeta meta = gauntlet.getItemMeta(); + + if (meta != null) { + meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Mace of Storms"); + meta.setLore(Collections.singletonList(ChatColor.GOLD + "Right Click to Smite the target"+ChatColor.GRAY+"\n range: 20 blocks")); + meta.addEnchant(Enchantment.MENDING,1,true); + meta.setUnbreakable(true); + gauntlet.setItemMeta(meta); + } + + player.getInventory().addItem(gauntlet); + player.sendMessage(ChatColor.GREEN + "You have been given the Mace Of Storms!"); + } else { + sender.sendMessage(ChatColor.RED + "Only players can use this command!"); + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/CoswayUtil/NoteStudio.java b/src/main/java/CoswayUtil/NoteStudio.java new file mode 100644 index 0000000..ea2012b --- /dev/null +++ b/src/main/java/CoswayUtil/NoteStudio.java @@ -0,0 +1,48 @@ +package CoswayUtil; + +import org.bukkit.Instrument; +import org.bukkit.Note; +import org.bukkit.Note.Tone; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; + +public class NoteStudio { + private static CoswayUtil plugin; + + public static void init(CoswayUtil pluginInstance) { + plugin = pluginInstance; + } + + public static void playNoteBlockSong(Player player) { + if (plugin == null) { + throw new IllegalStateException("NoteStudio has not been initialized!"); + } + + Note[] songNotes = { + Note.natural(0, Tone.C), Note.natural(0, Tone.E), Note.natural(0, Tone.G), + Note.natural(1, Tone.C), Note.natural(1, Tone.G), Note.natural(1, Tone.E), + Note.natural(2, Tone.C), Note.natural(2, Tone.D), Note.natural(2, Tone.E) + }; + + new BukkitRunnable() { + int index = 0; + + @Override + public void run() { + if (index >= songNotes.length) { + cancel(); + return; + } + + // Play the note for the player + player.playNote(player.getLocation(), Instrument.PIANO, songNotes[index]); + + // Also play a sound so everyone nearby can hear it + player.getWorld().playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 1, songNotes[index].getId() / 24.0f); + + index++; + } + }.runTaskTimer(plugin, 0, 10); // Plays one note every 10 ticks (0.5s) + } +} diff --git a/src/main/java/CoswayUtil/TreasureFountain.java b/src/main/java/CoswayUtil/TreasureFountain.java new file mode 100644 index 0000000..73014d0 --- /dev/null +++ b/src/main/java/CoswayUtil/TreasureFountain.java @@ -0,0 +1,122 @@ +package CoswayUtil; + +import org.bukkit.*; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.entity.*; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; +import java.util.List; +import java.util.Random; + +public class TreasureFountain implements Listener { + private final CoswayUtil plugin; + private final Random random = new Random(); + + public TreasureFountain(CoswayUtil plugin) { + this.plugin = plugin; + } + + @EventHandler + public void onUseTreasureFountain(PlayerInteractEntityEvent event) { + Player player = event.getPlayer(); + ItemStack item = player.getInventory().getItemInMainHand(); + Entity target = event.getRightClicked(); + + // Check if the item is the special "Treasure Fountain" + if (!isTreasureFountain(item)) return; + + // Check if the target is a living entity (monster) + if (!(target instanceof Monster)) { + player.sendMessage(ChatColor.RED + "This item only works on monsters!"); + return; + } + + // Kill the target + Location loc = target.getLocation(); + target.remove(); + player.sendMessage(ChatColor.GOLD + "The Treasure Fountain is activated!"); + + // Consume the special item + if (item.getAmount() > 1) { + item.setAmount(item.getAmount() - 1); + } else { + player.getInventory().setItemInMainHand(null); + } + + // Spawn the treasure cloud and items + spawnTreasureCloud(loc); + } + + public static ItemStack getTreasureFountainItem() { + ItemStack treasureFountain = new ItemStack(Material.BLAZE_ROD, 1); + ItemMeta meta = treasureFountain.getItemMeta(); + if (meta != null) { + meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Treasure Fountain"); + meta.setLore(List.of(ChatColor.GRAY + "Use this on a monster to", ChatColor.GRAY + "summon a treasure fountain!")); + treasureFountain.setItemMeta(meta); + } + return treasureFountain; + } + + private boolean isTreasureFountain(ItemStack item) { + if (item == null || !item.hasItemMeta() || !item.getItemMeta().hasDisplayName()) return false; + return item.getItemMeta().getDisplayName().equals(ChatColor.LIGHT_PURPLE + "Treasure Fountain"); + } + + private void spawnTreasureCloud(Location loc) { + // Show particles for 3 seconds + new BukkitRunnable() { + int count = 0; + + @Override + public void run() { + if (count >= 60) { + spawnTreasureItems(loc); + cancel(); + return; + } + loc.getWorld().spawnParticle(Particle.CLOUD, loc, 10, 0.5, 0.5, 0.5, 0); + count++; + } + }.runTaskTimer(plugin, 0, 5); + } + + private void spawnTreasureItems(Location loc) { + FileConfiguration config = plugin.getConfig(); + List treasureItems = config.getStringList("treasure"); + if (treasureItems.isEmpty()) { + Bukkit.getLogger().warning("Treasure list is empty in config!"); + return; + } + + int itemCount = 10 + random.nextInt(11); // 10-20 items + for (int i = 0; i < itemCount; i++) { + String itemName = treasureItems.get(random.nextInt(treasureItems.size())); + Material material = Material.matchMaterial(itemName); + + if (material == null) continue; + + ItemStack treasure = new ItemStack(material, 1); + spawnFloatingItem(loc, treasure); + } + } + + private void spawnFloatingItem(Location loc, ItemStack item) { + World world = loc.getWorld(); + if (world == null) return; + + Item droppedItem = world.dropItem(loc, item); + droppedItem.setVelocity(new org.bukkit.util.Vector( + (random.nextDouble() - 0.5) * 0.6, // Random horizontal direction + 0.5 + random.nextDouble() * 0.5, // Shoot up + (random.nextDouble() - 0.5) * 0.6 // Random horizontal direction + )); + droppedItem.setPickupDelay(20); + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7458b3d..bb92d3c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -94,44 +94,69 @@ shop: quantity: 10 display_name: "Obsidian" available: true - utilities: + utils: items: - ASK: + ask: material: KNOWLEDGE_BOOK - price: 450000 + price: 400000 quantity: 1 display_name: "Anchor Shield Kit" available: true - gravity_gauntlet: - material: KNOWLEDGE_BOOK - price: 200000 - quantity: 1 - display_name: "Gravity Gauntlet" - available: true - levitation_wand: - material: KNOWLEDGE_BOOK - price: 1000000 - quantity: 1 - display_name: "Levitation Wand" - available: true - launch_stick: - material: KNOWLEDGE_BOOK - price: 1234567 - quantity: 1 - display_name: "Launch Stick" - available: true - rapid_fire_bow: - material: KNOWLEDGE_BOOK - price: 9000000 - quantity: 1 - display_name: "Rapid Fire Bow" - available: true - illumination_wand: - material: KNOWLEDGE_BOOK - price: 9000000 - quantity: 1 - display_name: "Illumination Wand" - available: true + tool_id: 1 + utils1: + items: + gravity_gauntlet: + material: KNOWLEDGE_BOOK + price: 1500000 + quantity: 1 + display_name: "Gravity Gauntlet" + available: true + tool_id: 2 + utils2: + items: + levitation_wand: + material: KNOWLEDGE_BOOK + price: 600000 + quantity: 1 + display_name: "Levitation Wand" + available: true + tool_id: 3 + utils3: + items: + launch_stick: + material: KNOWLEDGE_BOOK + price: 2000000 + quantity: 1 + display_name: "Launch Stick" + available: true + tool_id: 4 + utils4: + items: + rapid_fire_bow: + material: KNOWLEDGE_BOOK + price: 1000000 + quantity: 1 + display_name: "Rapid Fire Bow" + available: false + tool_id: 5 + utils5: + items: + illumination_wand: + material: KNOWLEDGE_BOOK + price: 500000 + quantity: 1 + display_name: "Illumination Wand" + available: true + tool_id: 6 + utils6: + items: + maceofstorms: + material: KNOWLEDGE_BOOK + price: 600000 + quantity: 1 + display_name: "Mace Of Storms" + available: true + tool_id: 7 poor: "you're too poor for that, get gooder..." inventory_full: "you got too much clutter, cant fit your purchase into that mess..." pagination: diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a187189..5fccb92 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -45,4 +45,23 @@ commands: repair: description: Repairs the held tool to full durability. usage: /repair - permission: coswayutil.repair \ No newline at end of file + permission: coswayutil.repair + getmace: + description: get the mace of storms + usage: /getmace + permission: CoswayUtil.storm_mace + tone: + description: play the tone + usage: /tone + permission: CoswayUtil.tone + treasurefountain: + description: give player a treasure fountain item + usage: /treasurefountain + permission: CoswayUtil.treasurefountain + coswaysetpdc: + description: set a persistent data container for a desired player + usage: /coswaysetpdc + permission: CoswayUtil.admin + coswaygetpdc: + description: get set value of a players persistent data container key + usage: /coswaygetpdc \ No newline at end of file