From bea1522cac6bc923f5addeaa468f090405398a8b Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:21:37 -0400 Subject: [PATCH 1/6] Fix example file loading --- gradle/libs.versions.toml | 2 +- .../tasks/crates/CrateManager.java | 2 + paper/src/main/resources/examples/config.yml | 173 ++++++++ .../examples/crates/CasinoExample.yml | 377 ++++++++++++++++++ .../examples/crates/CosmicCrateExample.yml | 266 ++++++++++++ .../examples/crates/CrateExample.yml | 237 +++++++++++ .../examples/crates/QuadCrateExample.yml | 162 ++++++++ .../examples/crates/QuickCrateExample.yml | 153 +++++++ .../examples/crates/WarCrateExample.yml | 199 +++++++++ paper/src/main/resources/examples/data.yml | 1 + .../src/main/resources/examples/locations.yml | 1 + .../src/main/resources/examples/messages.yml | 205 ++++++++++ .../resources/examples/schematics/classic.nbt | Bin 0 -> 622 bytes .../resources/examples/schematics/nether.nbt | Bin 0 -> 578 bytes .../examples/schematics/outdoors.nbt | Bin 0 -> 648 bytes .../resources/examples/schematics/sea.nbt | Bin 0 -> 623 bytes .../resources/examples/schematics/soul.nbt | Bin 0 -> 634 bytes .../resources/examples/schematics/wooden.nbt | Bin 0 -> 626 bytes 18 files changed, 1777 insertions(+), 1 deletion(-) create mode 100644 paper/src/main/resources/examples/config.yml create mode 100644 paper/src/main/resources/examples/crates/CasinoExample.yml create mode 100644 paper/src/main/resources/examples/crates/CosmicCrateExample.yml create mode 100644 paper/src/main/resources/examples/crates/CrateExample.yml create mode 100644 paper/src/main/resources/examples/crates/QuadCrateExample.yml create mode 100644 paper/src/main/resources/examples/crates/QuickCrateExample.yml create mode 100644 paper/src/main/resources/examples/crates/WarCrateExample.yml create mode 100644 paper/src/main/resources/examples/data.yml create mode 100644 paper/src/main/resources/examples/locations.yml create mode 100644 paper/src/main/resources/examples/messages.yml create mode 100644 paper/src/main/resources/examples/schematics/classic.nbt create mode 100644 paper/src/main/resources/examples/schematics/nether.nbt create mode 100644 paper/src/main/resources/examples/schematics/outdoors.nbt create mode 100644 paper/src/main/resources/examples/schematics/sea.nbt create mode 100644 paper/src/main/resources/examples/schematics/soul.nbt create mode 100644 paper/src/main/resources/examples/schematics/wooden.nbt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 778d68c9d..1b6a5b634 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ oraxen-api = { group = "io.th0rgal", name = "oraxen", version = "1.171.0" } placeholder-api = { group = "me.clip", name = "placeholderapi", version = "2.11.5" } head-database-api = { group = "com.arcaniax", name = "HeadDatabase-API", version = "1.3.1" } -vital = { group = "com.ryderbelserion.vital", name = "vital", version = "1.0-snapshot" } +vital = { group = "com.ryderbelserion.vital", name = "paper", version = "1.0" } decent-holograms = { group = "com.github.decentsoftware-eu", name = "decentholograms", version = "2.8.6" } diff --git a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java index 9ae89a533..f1ab15b33 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java +++ b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java @@ -165,6 +165,8 @@ public void loadHolograms() { * Loads the crates. */ public void loadCrates() { + FileUtil.extracts(this.plugin.getClass(), "/examples/", this.plugin.getDataFolder().toPath().resolve("examples"), true); + this.giveNewPlayersKeys = false; purge(); diff --git a/paper/src/main/resources/examples/config.yml b/paper/src/main/resources/examples/config.yml new file mode 100644 index 000000000..6e589a59f --- /dev/null +++ b/paper/src/main/resources/examples/config.yml @@ -0,0 +1,173 @@ +# Support: https://discord.gg/badbones-s-live-chat-182615261403283459 +# Github: https://github.com/Crazy-Crew +# +# Issues: https://github.com/Crazy-Crew/CrazyCrates/issues +# Features: https://github.com/Crazy-Crew/CrazyCrates/issues +# +# List of all sounds: https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html +# List of all enchantments: https://jd.papermc.io/paper/1.20/org/bukkit/enchantments/Enchantment.html +root: + # Whether you want CrazyCrates to shut up or not, This option is ignored by errors. + verbose_logging: true + # This option will let you test a different way of picking random numbers. If you have any issues, You can set it back to false. + use-different-random: false + # Sends anonymous statistics about how the plugin is used to bstats.org. + # bstats is a service for plugin developers to find out how the plugin being used, + # This information helps us figure out how to better improve the plugin. + toggle_metrics: true + # The prefix used in commands + command_prefix: '&8[&bCrazyCrates&8]: ' + # The prefix used in console + console_prefix: '&8[&bCrazyCrates&8] ' +# Settings related to guis. +gui: + # If /crates should open the main menu. Warning: This will remove the menu button from crate previews. + toggle: true + # Inventory settings like size. + inventory: + # The name of the gui. + name: '&b&lCrazy &4&lCrates' + # The size of the gui. Valid sizes are 9,18,27,36,45 + size: 45 + # The buttons in the gui. + buttons: + # The main menu button. + menu: + # The item the button should be. + item: COMPASS + override: + # This will disable our current functionality of our main menu button in crate previews. + # It allows you to override and use a menu of your choice from your plugin using a command. + toggle: false + # A list of commands to run when the main menu button is clicked. The override option above has to be set to true. + list: + - see {player} + # The name of the item. + name: '&7&l>> &c&lMenu &7&l<<' + # The lore of the item. + lore: + - '&7Return to the menu.' + # The next button. + next: + # The item the button should be. + item: FEATHER + # The name of the item. + name: '&6&lNext >>' + # The lore of the item. + lore: + - '&7&lPage: &b{page}' + # The back button. + back: + # The item the button should be. + item: FEATHER + # The name of the item. + name: '&6&l<< Back' + # The lore of the item. + lore: + - '&7&lPage: &b{page}' + filler: + # Should the menu should be filled with one type of item? + toggle: false + # The item to fill the menu with. + item: BLACK_STAINED_GLASS_PANE + # The name of the item. + name: ' ' + # The lore of the item. + lore: [] + customizer: + # Should the customizer should be enabled? + toggle: true + # The items to set to the gui. + items: + - 'slot:1, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:2, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:3, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:4, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:5, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:6, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:7, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:8, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:9, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:37, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:38, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:39, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:40, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:41, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:42, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:43, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:44, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:45, item:RED_STAINED_GLASS_PANE, name: ' + - 'slot:10, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:19, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:28, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:18, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:27, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:36, item:BLUE_STAINED_GLASS_PANE, name: ' + - 'slot:11, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:13, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:15, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:25, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:17, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:20, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:21, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:22, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:23, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:24, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:25, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:26, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:29, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:31, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:32, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:33, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:34, item:CYAN_STAINED_GLASS_PANE, name: ' + - 'slot:35, item:CYAN_STAINED_GLASS_PANE, name: ' +# Settings related to crates. +crate: + # Whether to show the display item when opening QuickCrate + quickcrate-display-item: true + # Settings that are not supported and can be removed at anytime. + unsupported-settings: + # This option is unsupported and not recommended for use. + # It is not very performant and is recommended to keep false + # The option only here for niche use cases for the time being + # If at some point it ever gets more difficult to maintain this + # The option and code related will be completely removed and not added back. + old-key-checks: false + # If crates should knock you back if you have no keys. + knock-back: true + # The preview settings. + preview: + # If players should be forced to exit out of the preview during /crates reload + force-exit: false + # Send a message if they were forced out of the preview. + send-message: false + # If a player gets to the menu related to the Prizes gui, Should they be timed out? + # + # It will wait 10 seconds and if they already collected 3 prizes, It will only give one prize. + cosmic-crate-timeout: true + # Settings related to how keys function. + keys: + # Should a physical crate accept virtual keys? + physical-crate-accepts-virtual-keys: true + # Should a virtual crate ( /crates ) accept physical keys? + physical-crate-accepts-physical-keys: true + # Should a physical crate accept physical keys? + virtual-crate-accepts-physical-keys: true + # Settings related to a player's inventory is not empty. + inventory-settings: + # Should the player should be given virtual keys if inventory is not empty? If you leave it as false, All keys will be dropped on the ground. + give-virtual-keys: false + # Should the player should be notified when their inventory is not empty? + send-message: false + key-sound: + # Should a sound should be played if they have no key? + toggle: true + # The sound to play. + name: ENTITY_VILLAGER_NO + # Settings related to QuadCrate + quad-crate: + # How long should the quad crate be active? + timer: 300 + # What worlds do you want Crates to be disabled in? + disabled-worlds: + - world_nether diff --git a/paper/src/main/resources/examples/crates/CasinoExample.yml b/paper/src/main/resources/examples/crates/CasinoExample.yml new file mode 100644 index 000000000..8ce2bbee1 --- /dev/null +++ b/paper/src/main/resources/examples/crates/CasinoExample.yml @@ -0,0 +1,377 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + + # See CosmicCrateExample.yml to see how the Cosmic CrateType works. + CrateType: Casino + # Name of the Inventory if a GUI crate. + CrateName: "&9Casino Crate" + # The name of the inventory that will be in the preview GUI. + Preview-Name: "&9Casino Crate Preview" + # Starting amount of keys when the player 1st joins. + StartingKeys: 0 + # The amount of keys required to use the crate. + RequiredKeys: 0 + #Max amount of crates that can be opened at once using /cc mass-open + Max-Mass-Open: 10 + # If the crate shows in the /cc GUI. + # If the type is QuickCrate/CrateOnTheGo/FireCracker, They will not work as they require a Physical Crate. + InGUI: true + # Slot the item is in the GUI. + Slot: 32 + # Enables/Disables the Broadcasts message when they open a crate. + OpeningBroadCast: true + # Message that is broadcast when opening the crate. + BroadCast: "%prefix%&6&l%player%&r &7is opening a &9&lCasino Crate." + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_NOTE_BLOCK_XYLOPHONE" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "ENTITY_PLAYER_LEVELUP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # A default message if the prize doesn't have any Messages + # i.e. Messages: [] or the value isn't there. + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + # A default command if the prize doesn't have any commands + # i.e. Commands: [] or the value isn't there. + Prize-Commands: [] + # Item the crate is in the GUI + Item: "GOLD_INGOT" + # If the crate in the main /cc GUI is glowing or not. + Glowing: false + # Name of the item in the GUI. + Name: "&9&lCasino Crate" + # The lore of the item in the GUI. + Lore: + - "&7This crate contains strange objects." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Preview: + # Turn on and off the preview for this crate. + Toggle: true + # How many lines the Crate Preview should have. Including Header and Bottom (Between 3 and 6) + ChestLines: 6 + Glass: + # Turn the glass border in the preview on and off. + Toggle: true + # The name of the border item. + Name: " " + # The item that shows in the border. Can be glass or any other item. + Item: "GRAY_STAINED_GLASS_PANE" + tier-preview: + # Turn on and off the preview for this crate. + toggle: true + # How many lines the Tier Preview should have. Including Header and Bottom (Between 3 and 6) + rows: 5 + glass: + # Turn the glass border in the preview on and off. + toggle: true + # The name of the border item. + name: " " + # The item that shows in the border. Can be glass or any other item. + item: "RED_STAINED_GLASS_PANE" + # Tier related settings only for Casino. + random: + # If the tiers should be random. + toggle: false + # The rows with pre-defined tiers. + types: + # Row 1 + row-1: Basic + # Row 2 + row-2: UnCommon + # Row 3 + row-3: Rare + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + # The Config Name for the Crate + Basic: + # The in-game name of the tier. + Name: "&8Basic Tier" + # The in-game lore of the tier. + Lore: + - "&7A basic tier." + # The item used for the secondary gui when you right-click for the preview. + Item: "CHEST" + # Chance of that item getting picked. It would be 80/100 chance because MaxRange is 100. + Chance: 50 + # The max range that the chance will go though. + MaxRange: 100 + # The slot this item will be in the secondary gui. + Slot: 20 + UnCommon: + Name: "&aUncommon Tier" + Lore: + - "&aAn uncommon tier." + Item: "CHEST" + Chance: 35 + MaxRange: 100 + Slot: 22 + Rare: + Name: "&4Rare Tier" + Lore: + - "&cA rare tier." + Item: "ENDER_CHEST" + Chance: 25 + MaxRange: 100 + Slot: 24 + PhysicalKey: + # Name of the Key. + Name: "&9&lCasino Crate Key" + # Lore of the Key. + Lore: + - "&7A special Key" + - "&7For a special Crate." + # The item the key is. + Item: "TRIPWIRE_HOOK" + # Makes the key look enchanted. + Glowing: true + # Settings for the holograms. + Hologram: + # Toggle on and off the holograms for the crates. + Toggle: true + # The height of the hologram above the crate. + Height: 1.5 + # The distance the hologram can be seen. Only works with CMI and DecentHolograms + Range: 8 + # The message that will be displayed. + Message: + - "&9&lCasino Crate" + # All the prizes that can be gotten in the Crate. + Prizes: + 1: + # Name of the item shown by the crate. + DisplayName: "&cAn example of a Player Head!" + # ITem shown by the crate. + DisplayItem: "PLAYER_HEAD" + # The amount displayed. + DisplayAmount: 1 + # The lore in the crate preview + Lore: + - "&7Want a player head?" + - "" + - "&cChance: &e25%" + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + - "Basic" + # If you do not want a lore, Set the "Lore:" to look like the line below. + # Lore: [] + + MaxRange: 100 # Available values: 100, 1000, 10000, 100000, 1000000, 10000000 + # + # 25 is 25% if Max Range is 100 + # Read more on "Chance" @ https://github.com/Crazy-Crew/Crazy-Crates/wiki/Chance-System + # + Chance: 25 # The chance out of MaxRange to win an item. + + # Can be a name as well. + Player: "https://textures.minecraft.net/texture/1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e" # Custom Texture Example. + + # If you do not want a player supplied, Set the "Player:" to look like the line below. + # Player: "" + + Items: # Give any item you want to the winning player & with a custom texture. + - "Item:PLAYER_HEAD, Player:https://textures.minecraft.net/texture/1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e, Amount:1" + # If you do not want to give items, Set the "Items:" to look like the line below. + # Items: [] + + Commands: # You can run any plugin command here. + - "broadcast &6&l%player%&r &7won %reward%! WOW" + # If you do not want to send commands, Set the "Commands:" to look like the line below. + # Commands: [] + + Messages: # Send any message you want to the player. + - "&cYou won a &r%reward%!" + # If you do not want to send messages, Set the "Messages:" to look like the line below. + # Messages: [] + + #This allows for one time winnable prizes. If a player has one of the permissions then they will not be able to win it. + BlackListed-Permissions: [] + #This allows users who have won the same prize before to get alternative prizes. They must have a BlackListed-Permission to get an alternative prize. + Alternative-Prize: + #Toggle if the prize will use alternative prizes for the blacklisted permission. + Toggle: false + Messages: [] + Commands: [] + Items: [] + 2: + DisplayName: "&b&lCheap Helmet" + DisplayItem: "GOLDEN_HELMET" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 50. + # It cannot be 0. + DisplayDamage: 50 + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "QUARTZ" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win a cheap helmet." + - "&6&lChance: &c&l60%" + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + - "Basic" + MaxRange: 100 + Chance: 15 + Items: + - "Item:GOLDEN_HELMET, Amount:1, Damage:50, Trim-Pattern:SENTRY, Trim-Material:QUARTZ, Name:&bCheap Helmet, PROTECTION_ENVIRONMENTAL:1, OXYGEN:1" + 3: + DisplayName: "&e&l$1,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain Money." + - "&6&lChance: &c&l20%" + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + - "Basic" + MaxRange: 100 + Chance: 35 + Firework: true + Commands: + - "eco give %player% 1000" + # - "lp user %player% permission set crazycrates.blacklist.basic.3" -> This is the line where you would give the user the permission. + Messages: + - "&7You just won &r%reward%." + BlackListed-Permissions: + - "crazycrates.blacklist.basic.3" + Alternative-Prize: + Toggle: true + Messages: + - "&r &8[&bCrazyCrates&8]: &7You have already won that prize, so enjoy some gold nuggets." + Commands: + - "give %player% gold_nugget 16" + 4: + DisplayName: "&4&lWarlord's Helmet" + DisplayItem: "NETHERITE_HELMET" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's helmet." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + Tiers: + - "UnCommon" + MaxRange: 100 + Chance: 10 + Items: + - "Item:NETHERITE_HELMET, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Helmet, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 5: + DisplayName: "&4&lWarlord's Chestplate" + DisplayItem: "NETHERITE_CHESTPLATE" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + # Boots and leggings should be in rare. ( row 3 ) + # Helmet and chestplate should be in UnCommon ( row 2 ) + # Head/Gold/Sunflower should be in basic ( row 1 ) + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's chestplate." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + Tiers: + - "UnCommon" + MaxRange: 100 + Chance: 3 + Items: + - "Item:NETHERITE_CHESTPLATE, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Chestplate, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 6: + DisplayName: "&4&lWarlord's Leggings" + DisplayItem: "NETHERITE_LEGGINGS" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's leggings." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + Tiers: + - "Rare" + MaxRange: 100 + Chance: 3 + Items: + - "Item:NETHERITE_LEGGINGS, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Leggings, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 7: + DisplayName: "&4&lWarlord's Boots" + DisplayItem: "NETHERITE_BOOTS" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's boots." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + Tiers: + - "Rare" + MaxRange: 100 + Chance: 3 + Items: + - "Item:NETHERITE_BOOTS, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Boots, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" \ No newline at end of file diff --git a/paper/src/main/resources/examples/crates/CosmicCrateExample.yml b/paper/src/main/resources/examples/crates/CosmicCrateExample.yml new file mode 100644 index 000000000..e42136190 --- /dev/null +++ b/paper/src/main/resources/examples/crates/CosmicCrateExample.yml @@ -0,0 +1,266 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + CrateType: Cosmic + CrateName: "&dCosmic Crate" + Preview-Name: "&dCosmic Crate Preview" + StartingKeys: 0 + RequiredKeys: 0 + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + Prize-Commands: [] + Max-Mass-Open: 10 + InGUI: true + Slot: 14 + OpeningBroadCast: false + BroadCast: "" + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_NOTE_BLOCK_XYLOPHONE" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_ANVIL_PLACE" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + Item: "ENDER_CHEST" + Glowing: false + Name: "&d&lCosmic Crate" + Lore: + - "&7This crate contains strange objects," + - "&7from somewhere beyond this planet." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Crate-Type-Settings: + Total-Prize-Amount: 4 + Mystery-Crate: + Item: "CHEST" + Name: "&f&l???" + Lore: + - "&7You may choose 4 crates." + Picked-Crate: + Item: "GLASS_PANE" + Name: "&f&l???" + Lore: + - "&7You have chosen #%slot%." + PhysicalKey: + Name: "&d&lGalactic Crate &b&lKey" + Lore: + - "&7A special Key" + - "&7For a special Crate." + Item: "TRIPWIRE_HOOK" + Glowing: true + Hologram: + Toggle: true + Height: 1.5 + Range: 8 + Message: + - "&d&lCosmic Crate" + Preview: + # Turn on and off the preview for this crate. + Toggle: true + # How many lines the Crate Preview should have. Including Header and Bottom (Between 3 and 6) + ChestLines: 6 + Glass: + # Turn the glass border in the preview on and off. + Toggle: true + # The name of the border item. + Name: " " + # The item that shows in the border. Can be glass or any other item. + Item: "GRAY_STAINED_GLASS_PANE" + tier-preview: + # Turn on and off the preview for this crate. + toggle: true + # How many lines the Tier Preview should have. Including Header and Bottom (Between 3 and 6) + rows: 5 + glass: + # Turn the glass border in the preview on and off. + toggle: true + # The name of the border item. + name: " " + # The item that shows in the border. Can be glass or any other item. + item: "RED_STAINED_GLASS_PANE" + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + # The Config Name for the Crate + Basic: + # The in-game name of the tier. + Name: "&8Basic Tier" + # The in-game lore of the tier. + Lore: + - "&7A basic tier." + # The item used for the secondary gui when you right-click for the preview. + Item: "CHEST" + # Chance of that item getting picked. It would be 80/100 chance because MaxRange is 100. + Chance: 80 + # The max range that the chance will go though. + MaxRange: 100 + # The slot this item will be in the secondary gui. + Slot: 20 + UnCommon: + Name: "&aUncommon Tier" + Lore: + - "&aAn uncommon tier." + Item: "CHEST" + Chance: 55 + MaxRange: 100 + Slot: 22 + Rare: + Name: "&4Rare Tier" + Lore: + - "&cA rare tier." + Item: "ENDER_CHEST" + Chance: 20 + MaxRange: 100 + Slot: 24 + Prizes: + 1: + DisplayName: "&d&lCosmic Grass" + DisplayItem: "GRASS_BLOCK" + DisplayAmount: 1 + Lore: + - "&7Win some grass for your fields." + - "&6&lChance: &c&l40%" + MaxRange: 100 + Chance: 40 + # Tiers are available in Cosmic and Casino crate types. + # The Tiers the rewards can be found in. + Tiers: + - "Basic" + - "UnCommon" + - "Rare" + Items: + - "Item:GRASS_BLOCK, Amount:32, Name:&d&lGalactic Grass" + Commands: + - "broadcast &6&l%player%&r &7has just won some &r%reward%." + 2: + DisplayName: "&b&lCheap Helmet" + DisplayItem: "GOLDEN_HELMET" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 5. + # It cannot be 0. + DisplayDamage: 5 + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "QUARTZ" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win a cheap helmet." + - "&6&lChance: &c&l60%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:1" + - "OXYGEN:1" + MaxRange: 100 + Chance: 60 + Tiers: + - "Basic" + - "UnCommon" + - "Rare" + Items: + - "Item:GOLDEN_HELMET, Amount:1, Damage:5, Trim-Pattern:SENTRY, Trim-Material:DIAMOND, Name:&bCheap Helmet, PROTECTION_ENVIRONMENTAL:1, OXYGEN:1" + 3: + DisplayName: "&e&l$1,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain Money." + - "&6&lChance: &c&l20%" + MaxRange: 100 + Chance: 20 + Firework: true + Tiers: + - "Basic" + - "UnCommon" + - "Rare" + Commands: + - "eco give %player% 1000" + 4: + DisplayName: "&b&lCrazy &4&lSword" + DisplayItem: "GOLDEN_SWORD" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 12. + DisplayDamage: 12 + DisplayAmount: 1 + Lore: + - "&7Win a crazy cool sword." + - "&6&lChance: &c&l10%" + DisplayEnchantments: + - "DAMAGE_ALL:5" + - "FIRE_ASPECT:1" + MaxRange: 100 + Chance: 10 + Tiers: + - "Rare" + Items: + - "Item:GOLDEN_SWORD, Amount:1, Damage:12, Name:&b&lCrazy &4&lSword, DAMAGE_ALL:5, FIRE_ASPECT:1" + 5: + DisplayName: "&e&l$1,000,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain a butt load of Money." + - "&6&lChance: &c&l20%" + MaxRange: 100 + Chance: 20 + Firework: true + Tiers: + - "Rare" + Commands: + - "eco give %player% 1000000" + 6: + DisplayName: "&b&lCrazy Crate &6&lKey &7(x2)" + DisplayItem: "TRIPWIRE_HOOK" + DisplayAmount: 1 + Lore: + - "&7A special Key" + - "&7For a special Crate." + - "&6&lChance: &c&l10%" + MaxRange: 100 + Chance: 10 + Firework: true + Glowing: true + Tiers: + - "UnCommon" + - "Rare" + Commands: + - "cc give physical crazy 2 %player%" \ No newline at end of file diff --git a/paper/src/main/resources/examples/crates/CrateExample.yml b/paper/src/main/resources/examples/crates/CrateExample.yml new file mode 100644 index 000000000..e4149bdf1 --- /dev/null +++ b/paper/src/main/resources/examples/crates/CrateExample.yml @@ -0,0 +1,237 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + + # See CosmicCrateExample.yml to see how the Cosmic CrateType works. + CrateType: CSGO + # Name of the Inventory if a GUI crate. + CrateName: "&aBasic Crate" + # The name of the inventory that will be in the preview GUI. + Preview-Name: "&aBasic Crate Preview" + # Starting amount of keys when the player 1st joins. + StartingKeys: 0 + # The amount of keys required to use the crate. + RequiredKeys: 0 + #Max amount of crates that can be opened at once using /cc mass-open + Max-Mass-Open: 10 + # If the crate shows in the /cc GUI. + # If the type is QuickCrate/CrateOnTheGo/FireCracker, They will not work as they require a Physical Crate. + InGUI: true + # Slot the item is in the GUI. + Slot: 12 + # Enables/Disables the Broadcasts message when they open a crate. + OpeningBroadCast: true + # Message that is broadcast when opening the crate. + BroadCast: "%prefix%&6&l%player%&r &7is opening a &7&lBasic Crate." + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_NOTE_BLOCK_XYLOPHONE" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "ENTITY_PLAYER_LEVELUP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # A default message if the prize doesn"t have any Messages + # i.e. Messages: [] or the value isn"t there. + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + # A default command if the prize doesn"t have any commands + # i.e. Commands: [] or the value isn"t there. + Prize-Commands: [] + # Item the crate is in the GUI + Item: "DIAMOND" + # If the crate in the main /cc GUI is glowing or not. + Glowing: false + # Name of the item in the GUI. + Name: "&a&lBasic Crate" + # The lore of the item in the GUI. + Lore: + - "&7This crate contains strange objects." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Preview: + # Turn on and off the preview for this crate. + Toggle: true + # How many lines the Crate Preview should have. Including Header and Bottom (Between 3 and 6) + ChestLines: 6 + Glass: + # Turn the glass border in the preview on and off. + Toggle: true + # The name of the border item. + Name: " " + # The item that shows in the border. Can be glass or any other item. + Item: "GRAY_STAINED_GLASS_PANE" + PhysicalKey: + # Name of the Key. + Name: "&7&lBasic Crate &b&lKey" + # Lore of the Key. + Lore: + - "&7A special Key" + - "&7For a special Crate." + # The item the key is. + Item: "TRIPWIRE_HOOK" + # Makes the key look enchanted. + Glowing: true + # Settings for the holograms. + Hologram: + # Toggle on and off the holograms for the crates. + Toggle: true + # The height of the hologram above the crate. + Height: 1.5 + # The distance the hologram can be seen. Only works with CMI and DecentHolograms + Range: 8 + # The message that will be displayed. + Message: + - "&7&lBasic Crate" + # All the prizes that can be gotten in the Crate. + Prizes: + 1: + # Name of the item shown by the crate. + DisplayName: "&cAn example of a Player Head!" + # ITem shown by the crate. + DisplayItem: "PLAYER_HEAD" + # The amount displayed. + DisplayAmount: 1 + # The lore in the crate preview + Lore: + - "&7Want a player head?" + - "" + - "&cChance: &e25%" + # If you do not want a lore, Set the "Lore:" to look like the line below. + # Lore: [] + + MaxRange: 100 # Available values: 100, 1000, 10000, 100000, 1000000, 10000000 + # + # 25 is 25% if Max Range is 100 + # Read more on "Chance" @ https://github.com/Crazy-Crew/Crazy-Crates/wiki/Chance-System + # + Chance: 25 # The chance out of MaxRange to win an item. + + # Can be a name as well. + Player: "https://textures.minecraft.net/texture/1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e" # Custom Texture Example. + + # If you do not want a player supplied, Set the "Player:" to look like the line below. + # Player: "" + + Items: # Give any item you want to the winning player & with a custom texture. + - "Item:PLAYER_HEAD, Player:https://textures.minecraft.net/texture/1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e, Amount:1" + # If you do not want to give items, Set the "Items:" to look like the line below. + # Items: [] + + Commands: # You can run any plugin command here. + - "broadcast &6&l%player%&r &7won %reward%! WOW" + # If you do not want to send commands, Set the "Commands:" to look like the line below. + # Commands: [] + + Messages: # Send any message you want to the player. + - "&cYou won a &r%reward%!" + # If you do not want to send messages, Set the "Messages:" to look like the line below. + # Messages: [] + + #This allows for one time winnable prizes. If a player has one of the permissions then they will not be able to win it. + BlackListed-Permissions: [] + #This allows users who have won the same prize before to get alternative prizes. They must have a BlackListed-Permission to get an alternative prize. + Alternative-Prize: + #Toggle if the prize will use alternative prizes for the blacklisted permission. + Toggle: false + Messages: [] + Commands: [] + Items: [] + 2: + DisplayName: "&b&lCheap Helmet" + DisplayItem: "GOLDEN_HELMET" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 50. + # It cannot be 0. + DisplayDamage: 50 + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "QUARTZ" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win a cheap helmet." + - "&6&lChance: &c&l60%" + MaxRange: 100 + Chance: 60 + Items: + - "Item:GOLDEN_HELMET, Amount:1, Damage:50, Trim-Pattern:SENTRY, Trim-Material:QUARTZ, Name:&bCheap Helmet, PROTECTION_ENVIRONMENTAL:1, OXYGEN:1" + 3: + DisplayName: "&e&l$1,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain Money." + - "&6&lChance: &c&l20%" + MaxRange: 100 + Chance: 20 + Firework: true + Commands: + - "eco give %player% 1000" + # - "lp user %player% permission set crazycrates.blacklist.basic.3" -> This is the line where you would give the user the permission. + Messages: + - "&7You just won &r%reward%." + BlackListed-Permissions: + - "crazycrates.blacklist.basic.3" + Alternative-Prize: + Toggle: true + Messages: + - "&r &8[&bCrazyCrates&8]: &7You have already won that prize, so enjoy some gold nuggets." + Commands: + - "give %player% gold_nugget 16" + 4: + DisplayName: "&d&lSharpness 5 / Looting 3" + DisplayItem: "ENCHANTED_BOOK" + DisplayAmount: 1 + DisplayEnchantments: + - "SHARPNESS:5" + - "LOOTING:3" + Lore: + - "&7A sharp enchantment book." + - "&6&lChance: &c&l25%" + MaxRange: 100 + Chance: 25 + Firework: true + Messages: + - "&7You just won &r%reward%." + Items: + - "Item:ENCHANTED_BOOK, Amount:1, DAMAGE_ALL:5, LOOTING:3" \ No newline at end of file diff --git a/paper/src/main/resources/examples/crates/QuadCrateExample.yml b/paper/src/main/resources/examples/crates/QuadCrateExample.yml new file mode 100644 index 000000000..68c55d77d --- /dev/null +++ b/paper/src/main/resources/examples/crates/QuadCrateExample.yml @@ -0,0 +1,162 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + + # See CosmicCrateExample.yml to see how the Cosmic CrateType works. + # Spawns 4 chests and a custom structure. + CrateType: QuadCrate + CrateName: "&bQuad Crate Preview" + Preview-Name: "&bQuad Crate Preview" + StartingKeys: 0 + RequiredKeys: 0 + Max-Mass-Open: 10 + InGUI: true + Slot: 16 + OpeningBroadCast: true + BroadCast: "%prefix%&6&l%player%&r &7is opening a &b&lCrazy Crate." + # This section is related to .nbt files. + structure: + # If it should randomly use an .nbt file. + random: true + # The file to use inside schematic"s folder. + file: "classic.nbt" + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_STONE_STEP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_ANVIL_LAND" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # Only used for quadcrates + particles: + # Only used for "dust" particle + color: "235,64,52" + # https://minecraft.wiki/w/Particles_(Java_Edition) + type: "crimson_spore" + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + Prize-Commands: [] + Item: "BREWING_STAND" + Glowing: false + Name: "&b&lQuad Crate" + Lore: + - "&7This crate contains crazy things." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Preview: + Toggle: true + ChestLines: 6 + Glass: + Toggle: true + # The name of the border item. + Name: " " + Item: "BLACK_STAINED_GLASS_PANE" + PhysicalKey: + Name: "&b&lQuad Crate &6&lKey" + Lore: + - "&7A special Key" + - "&7For a special Crate." + Item: "TRIPWIRE_HOOK" + Glowing: True + Hologram: + Toggle: true + Height: 1.5 + Range: 8 + Message: + - "&b&lCrazy Crate" + Prizes: + 1: + DisplayName: "&3&lRare ChestPlate" + DisplayItem: "DIAMOND_CHESTPLATE" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 25. + # It cannot be 0. + DisplayDamage: 25 + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "QUARTZ" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win a very rare chest plate." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + MaxRange: 100 + Chance: 40 + Items: + - "Item:DIAMOND_CHESTPLATE, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:EMERALD, Name:&3Rare ChestPlate, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 2: + DisplayName: "&b&lCrazy &4&lSword" + DisplayItem: "GOLDEN_SWORD" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 13. + DisplayDamage: 13 + DisplayAmount: 1 + Lore: + - "&7Win a crazy cool sword." + - "&6&lChance: &c&l35%" + DisplayEnchantments: + - "DAMAGE_ALL:5" + - "FIRE_ASPECT:1" + MaxRange: 100 + Chance: 35 + Items: + - "Item:GOLDEN_SWORD, Amount:1, Damage:13, Name:&b&lCrazy &4&lSword, DAMAGE_ALL:5, FIRE_ASPECT:1" + Messages: + - "&7You just won &r%reward%." + 3: + DisplayName: "&e&l$1,000,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain a butt load of Money." + - "&6&lChance: &c&l20%" + MaxRange: 100 + Chance: 20 + Firework: true + Commands: + - "eco give %player% 1000000" + Messages: + - "&7You just won &r%reward%." \ No newline at end of file diff --git a/paper/src/main/resources/examples/crates/QuickCrateExample.yml b/paper/src/main/resources/examples/crates/QuickCrateExample.yml new file mode 100644 index 000000000..b5c4f55a8 --- /dev/null +++ b/paper/src/main/resources/examples/crates/QuickCrateExample.yml @@ -0,0 +1,153 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + + # See CosmicCrateExample.yml to see how the Cosmic CrateType works. + + # QuickCrate simply allows you to speed open crates. + CrateType: QuickCrate + CrateName: "&eClassic Crate" + Preview-Name: "&eClassic Crate Preview" + StartingKeys: 0 + RequiredKeys: 0 + Max-Mass-Open: 10 + InGUI: false + Slot: 14 + OpeningBroadCast: true + BroadCast: "%prefix%&6&l%player%&r &7is opening a &e&lClassic Crate&7." + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_NOTE_BLOCK_XYLOPHONE" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "ENTITY_PLAYER_LEVELUP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + Prize-Commands: [] + Item: "CHEST" + Glowing: false + Name: "&e&lClassic Crate" + Lore: + - "&7This crate contains classic items." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Preview: + Toggle: true + ChestLines: 6 + Glass: + Toggle: true + # The name of the border item. + Name: " " + Item: "YELLOW_STAINED_GLASS_PANE" + PhysicalKey: + Name: "&e&lClassic Crate &c&lKey" + Lore: + - "&7A special Key" + - "&7For a special Crate." + Item: "TRIPWIRE_HOOK" + Glowing: True + Hologram: + Toggle: true + Height: 1.5 + Range: 8 + Message: + - "&e&lClassic Crate" + Prizes: + 1: + DisplayName: "&a&lFancy Pants" + DisplayItem: "CHAINMAIL_LEGGINGS" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 75. + # It cannot be 0. + DisplayDamage: 75 + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "QUARTZ" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win a fancy pair of pants." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:2" + MaxRange: 100 + Chance: 40 + Items: + - "Item:CHAINMAIL_LEGGINGS, Amount:1, Damage:75, Trim-Pattern:SENTRY, Trim-Material:LAPIS, Name:&aFancy Pants, PROTECTION_ENVIRONMENTAL:2" + Messages: + - "&7You just won a &r%reward%." + 2: + DisplayName: "&b&lClassic Sword" + DisplayItem: "DIAMOND_SWORD" + # Only works on items with durability. This will make the item appear more damaged. + # It does not set the durability but subtracts this number from the durability is 100, It subtracts 7. + # It cannot be 0. + DisplayDamage: 7 + DisplayAmount: 1 + Lore: + - "&7Win a old classic sword." + - "&6&lChance: &c&l35%" + DisplayEnchantments: + - "DAMAGE_ALL:2" + - "FIRE_ASPECT:1" + MaxRange: 100 + Chance: 35 + Items: + - "Item:DIAMOND_SWORD, Amount:1, Damage:7, Name:&bClassic Sword, DAMAGE_ALL:2, FIRE_ASPECT:1" + Messages: + - "&7You just won &r%reward%." + 3: + DisplayName: "&e&l$100,000" + DisplayItem: "SUNFLOWER" + DisplayAmount: 1 + Lore: + - "&7Make it rain a lot of Money." + - "&6&lChance: &c&l20%" + MaxRange: 100 + Chance: 20 + Firework: true + Commands: + - "eco give %player% 100000" + Messages: + - "&7You just won &r%reward%." \ No newline at end of file diff --git a/paper/src/main/resources/examples/crates/WarCrateExample.yml b/paper/src/main/resources/examples/crates/WarCrateExample.yml new file mode 100644 index 000000000..20cefd7b2 --- /dev/null +++ b/paper/src/main/resources/examples/crates/WarCrateExample.yml @@ -0,0 +1,199 @@ +Crate: + # Type of crate -> CSGO/Casino/Cosmic/QuadCrate/QuickCrate/Roulette/CrateOnTheGo/FireCracker/Wonder/Wheel/War + + # Make sure to check out the wiki for anything not explained here. + # https://docs.crazycrew.us/crazycrates/home + + # See CosmicCrateExample.yml to see how the Cosmic CrateType works. + CrateType: War + # Name of the Inventory if a GUI crate. + CrateName: "&4War Crate" + # The name of the inventory that will be in the preview GUI. + Preview-Name: "&4War Crate Preview" + # Starting amount of keys when the player 1st joins. + StartingKeys: 0 + # The amount of keys required to use the crate. + RequiredKeys: 0 + #Max amount of crates that can be opened at once using /cc mass-open + Max-Mass-Open: 10 + # If the crate shows in the /cc GUI. + # If the type is QuickCrate/CrateOnTheGo/FireCracker, They will not work as they require a Physical Crate. + InGUI: true + # Slot the item is in the GUI. + Slot: 30 + # Enables/Disables the Broadcasts message when they open a crate. + OpeningBroadCast: true + # Message that is broadcast when opening the crate. + BroadCast: "%prefix%&6&l%player%&r &7is opening a &4&lWar Crate&7." + # This section is related to commands opening when a crate is opened. + opening-command: + # If the commands should be sent or not. + toggle: false + # The commands to run when the crate opens. + # Supports all placeholderapi placeholders + # Supports %prefix which returns our prefix, %player% which uses the player name + commands: + - "put your command here." + sound: + # The sound options when the animation is cycling. + cycle-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "BLOCK_LAVA_POP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when an item is clicked. + click-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "UI_BUTTON_CLICK" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # The sound options when a crate ends. + stop-sound: + # If sound should be enabled or not. + toggle: true + # The type of sound to use. + # https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html + value: "ENTITY_PLAYER_LEVELUP" + # The volume of the pitch. + volume: 1.0 + # The speed of the sound. + pitch: 1.0 + # A default message if the prize doesn't have any Messages + # i.e. Messages: [] or the value isn't there. + Prize-Message: + - "&7You have won &c%reward% &7from &c%crate%." + Prize-Commands: [] + # Item the crate is in the GUI + Item: "BEACON" + # If the crate in the main /cc GUI is glowing or not. + Glowing: false + # Name of the item in the GUI. + Name: "&4&lWar Crate" + # The lore of the item in the GUI. + Lore: + - "&7This crate contains strange objects." + - "&7You have &6%keys% keys &7to open this crate with." + - "&7You have opened this crate: &6%crate_opened% times" + - "&7&l(&e&l!&7&l) Right click to view rewards." + Preview: + # Turn on and off the preview for this crate. + Toggle: true + # How many lines the Crate Preview should have. Including Header and Bottom (Between 3 and 6) + ChestLines: 6 + Glass: + # Turn the glass border in the preview on and off. + Toggle: true + # The name of the border item. + Name: " " + # The item that shows in the border. Can be glass or any other item. + Item: "GRAY_STAINED_GLASS_PANE" + PhysicalKey: + # Name of the Key. + Name: "&4&lWar Crate &b&lKey" + # Lore of the Key. + Lore: + - "&7A special Key" + - "&7For a special Crate." + # The item the key is. + Item: "TRIPWIRE_HOOK" + # Makes the key look enchanted. + Glowing: true + # Settings for the holograms. + Hologram: + # Toggle on and off the holograms for the crates. + Toggle: true + # The height of the hologram above the crate. + Height: 1.5 + # The distance the hologram can be seen. Only works with CMI and DecentHolograms + Range: 8 + # The message that will be displayed. + Message: + - "&4&lWar Crate" + # All the prizes that can be gotten in the Crate. + Prizes: + 1: + DisplayName: "&4&lWarlord's Helmet" + DisplayItem: "NETHERITE_HELMET" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's helmet." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + MaxRange: 100 + Chance: 40 + Items: + - "Item:NETHERITE_HELMET, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Helmet, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 2: + DisplayName: "&4&lWarlord's Chestplate" + DisplayItem: "NETHERITE_CHESTPLATE" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's chestplate." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + MaxRange: 100 + Chance: 40 + Items: + - "Item:NETHERITE_CHESTPLATE, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Chestplate, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 3: + DisplayName: "&4&lWarlord's Leggings" + DisplayItem: "NETHERITE_LEGGINGS" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's leggings." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + MaxRange: 100 + Chance: 40 + Items: + - "Item:NETHERITE_LEGGINGS, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Leggings, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" + 4: + DisplayName: "&4&lWarlord's Boots" + DisplayItem: "NETHERITE_BOOTS" + DisplayTrim: + # Available Materials: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimMaterial.html + Material: "REDSTONE" + # Available Patterns: https://jd.papermc.io/paper/1.20/org/bukkit/inventory/meta/trim/TrimPattern.html + Pattern: "SENTRY" + DisplayAmount: 1 + Lore: + - "&7Win the warlord's boots." + - "&6&lChance: &c&l40%" + DisplayEnchantments: + - "PROTECTION_ENVIRONMENTAL:5" + - "DURABILITY:3" + MaxRange: 100 + Chance: 40 + Items: + - "Item:NETHERITE_BOOTS, Amount:1, Damage:25, Trim-Pattern:SENTRY, Trim-Material:REDSTONE, Name:&4&lWarlord's Boots, PROTECTION_ENVIRONMENTAL:5, DURABILITY:3" \ No newline at end of file diff --git a/paper/src/main/resources/examples/data.yml b/paper/src/main/resources/examples/data.yml new file mode 100644 index 000000000..2355ec3f6 --- /dev/null +++ b/paper/src/main/resources/examples/data.yml @@ -0,0 +1 @@ +Players: {} diff --git a/paper/src/main/resources/examples/locations.yml b/paper/src/main/resources/examples/locations.yml new file mode 100644 index 000000000..8c0698de3 --- /dev/null +++ b/paper/src/main/resources/examples/locations.yml @@ -0,0 +1 @@ +Locations: { } \ No newline at end of file diff --git a/paper/src/main/resources/examples/messages.yml b/paper/src/main/resources/examples/messages.yml new file mode 100644 index 000000000..63dd1406d --- /dev/null +++ b/paper/src/main/resources/examples/messages.yml @@ -0,0 +1,205 @@ +# Support: https://discord.gg/badbones-s-live-chat-182615261403283459 +# Github: https://github.com/Crazy-Crew +# +# Issues: https://github.com/Crazy-Crew/CrazyCrates/issues +# Features: https://github.com/Crazy-Crew/CrazyCrates/issues +# +misc: + # A list of available placeholders: {prefix} + unknown-command: '{prefix}&cThis command is not known.' + # Only activates when you try to use an ender pearl while opening a crate. + no-teleporting: '{prefix}&cYou may not teleport away while opening a crate.' + # A list of available placeholders: {prefix} + no-commands: '{prefix}&cYou are not allowed to use commands while opening crates.' + # A list of available placeholders: {prefix}, {key}, {crate} + no-keys: '{prefix}&cYou must have a {key} &cto use &6{crate}.' + # A list of available placeholders: {prefix}, {key}, {crate} + no-virtual-keys: '{prefix}&cYou need a virtual key to open &6{crate}.' + # A list of available placeholders: {prefix}, {usage} + correct-usage: '{prefix}&cThe correct usage for this command is &e{usage}' + # A list of available placeholders: {prefix} + feature-disabled: '{prefix}&cThis feature is disabled.' +# All messages related to errors. +errors: + # A list of available placeholders: {prefix}, {crate} + no-prizes-found: '{prefix}&cThis crate contains no prizes that you can win.' + # A list of available placeholders: {prefix} + no-schematics-found: '{prefix}&cNo schematics were found. Please make sure files + ending in .nbt exist in the schematics folder. If not delete the folder so they + regenerate.' + # A list of available placeholders: {prefix} + internal-error: '{prefix}&cAn internal error has occurred. Please check the console + for the full error.' + # A list of available placeholders: {prefix}, {crate}, {prize} + prize-error: '{prefix}&cAn error has occurred while trying to give you the prize + called &6{prize}&c in crate called &6{crate}&c. Please contact the server owner + and show them this error.' +# All messages related to players. +player: + requirements: + # A list of available placeholders: {prefix} + must-be-player: '{prefix}&cYou must be a player to use this command.' + # A list of available placeholders: {prefix} + must-be-console-sender: '{prefix}&cYou must be using console to use this command.' + # A list of available placeholders: {prefix} + must-be-looking-at-block: '{prefix}&cYou must be looking at a block.' + # A list of available placeholders: {prefix}, {player} + target-not-online: '{prefix}&c{player} &7is not online.' + # A list of available placeholders: {prefix} + target-same-player: '{prefix}&cYou can''''t use this command on yourself.' + # A list of available placeholders: {prefix} + no-permission: '{prefix}&cYou do not have permission to use that command/menu!' + # A list of available placeholders: {prefix}, {crate} + inventory-not-empty: '{prefix}&cInventory is not empty, Please make room before + opening &6{crate}.' + # A list of available placeholders: {prefix}, {amount}, {keytype}, {key} + obtaining-keys: '{prefix}&7You have been given &6{amount} {key} &7key(s).' + # A list of available placeholders: {prefix}, {player} + too-close-to-another-player: '{prefix}&cYou are too close to a player that is opening + a crate.' +# All messages related to crates. +crates: + requirements: + # A list of available placeholders: {prefix}, {crate} + not-a-crate: '{prefix}&cThere is no crate called &6{crate}.' + # A list of available placeholders: {prefix}, {number} + not-a-number: '{prefix}&6{number} &cis not a number.' + # A list of available placeholders: {prefix}, {amount}, {key_amount}, {crate} + not-enough-keys: '{prefix}&7You need &c{key_amount} &7keys to open &c{crate}. + &7You have &c{amount}.' + # A list of available placeholders: {prefix} + not-a-block: '{prefix}&cYou must be standing on a block to use &6{crate}.' + # A list of available placeholders: {prefix}, {crate} + out-of-time: '{prefix}&cYou took &65 minutes &cto open &6{crate} &cso it closed.' + # A list of available placeholders: {prefix} + forced-out-of-preview: '{prefix}&cA reload has forced you out of the preview.' + # A list of available placeholders: {prefix} + cannot-set-menu-type: '{prefix}&cYou cannot set the Menu to a block because the + crate menu is disabled' + # A list of available placeholders: {prefix}, {crate} + crate-no-permission: '{prefix}&cYou do not have permission to use that {crate}.' + # A list of available placeholders: {prefix}, {crate} + crate-preview-disabled: '{prefix}&cThe preview for &6{crate} &cis currently disabled.' + # A list of available placeholders: {prefix}, {crate} + crate-already-open: '{prefix}&cYou are already opening &6{crate}.' + # A list of available placeholders: {prefix}, {crate} + crate-in-use: '{prefix}&c{crate} is already in use. Please wait until it finishes.' + # A list of available placeholders: {prefix}, {crate}, {cratetype} + cannot-be-a-virtual-crate: '{prefix}&6{crate} &ccannot be used as a Virtual Crate.' + # QuadCrate schematics need a fair bit of room so make sure you check the surroundings. + need-more-room: '{prefix}&cThere is not enough space to open that here' + # A list of available placeholders: {prefix}, {world} + world-disabled: '{prefix}&cI am sorry but Crates are disabled in {world}.' + physical-crate: + # A list of available placeholders: {prefix}, {crate} + created: + - '{prefix}&7You have set that block to {crate}.' + - '&7To remove the crate shift break in creative to remove.' + # A list of available placeholders: {prefix}, {id} + removed: '{prefix}&7You have removed &6{id}.' +# All messages related to commands. +command: + open: + # A list of available placeholders: {prefix}, {crate}, {player} + opened-a-crate: '{prefix}&7You have opened the &6{crate} for &6{player}.' + give: + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype} + given-player-keys: '{prefix}&7You have given &6{player} {amount} &7key(s).' + # A list of available placeholders: {prefix}, {amount}, {amount}, {keytype} + full-inventory: '{prefix}&7You have been given &6{amount} {key} &7virtual key(s) + because your inventory was full.' + # A list of available placeholders: {prefix}, {amount}, {keytype} + given-everyone-keys: '{prefix}&7You have given everyone &6{amount} &7key(s).' + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype} + given-offline-player-keys: '{prefix}&7You have given &6{amount} &7key(s) to the + offline player &6{player}.' + take: + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype} + take-player-keys: '{prefix}&7You have taken &6{amount} &7key(s) from &6{player}.' + # A list of available placeholders: {prefix}, {player} + cannot-take-keys: '{prefix}&7You cannot take key(s) from &6{player} &7as they + are poor.' + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype} + take-offline-player-keys: '{prefix}&7You have taken &6{amount} &7key(s) from the + offline player &6{player}.' + additem: + # A list of available placeholders: {prefix}, {crate} + no-item-in-hand: '{prefix}&cYou need to have an item in your hand to add it {crate}.' + # A list of available placeholders: {prefix}, {crate}, {prize} + add-item-from-hand: '{prefix}&7The item has been added to the {crate} in prize + #{prize}.' + convert: + no-files-to-convert: '&cNo available plugins to convert files.' + error-converting-files: '&cAn error has occurred while trying to convert files. + We could not convert &a{file} &cso please check the console.' + successfully-converted-files: '&aPlugin Conversion has succeeded!' + reload: + # A list of available placeholders: {prefix} + completed: '{prefix}&3You have reloaded the Config and Data Files.' + transfer: + # A list of available placeholders: {prefix} + not-enough-keys: '{prefix}&cYou do not have enough keys to transfer.' + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype}, {crate} + transferred-keys: '{prefix}&7You have transferred {amount} {crate} keys to {player}.' + # A list of available placeholders: {prefix}, {amount}, {player}, {keytype}, {crate} + transferred-keys-received: '{prefix}&7You have received {amount} {crate} keys + from {player}.' + keys: + personal: + # A list of available placeholders: {prefix} + no-virtual-keys: '{prefix}&8&l(&4&l!&8&l) &7You currently do not have any virtual + keys.' + # A list of available placeholders: {crates_opened} + virtual-keys-header: + - '&8&l(&6&l!&8&l) &7List of your current number of keys.' + - ' &e -> Total Crates Opened: &c{crates_opened}' + other-player: + # A list of available placeholders: {prefix}, {player} + no-virtual-keys: '{prefix}&8&l(&4&l!&8&l) &7The player {player} does not have + any keys.' + # A list of available placeholders: {player}, {crates_opened} + virtual-keys-header: + - '&8&l(&6&l!&8&l) &7List of {player}''''s current number of keys.' + - ' &e -> Total Crates Opened: &c{crates_opened}' + # A list of available placeholders: {crate}, {keys}, {crate_opened} + crate-format: '{crate} &7&l>&8&l> &6{keys} keys &7: Opened &6{crate_opened} times' + # This requires crazycrates.command.help + player-help: + - '&e&lCrazy Crates Player Help' + - '&6/keys view [player] &7- &eCheck the number of keys a player has.' + - '&6/keys &7- &eShows how many keys you have.' + - '&6/cc &7- &eOpens the menu.' + # This requires crazycrates.command.admin.help + admin-help: + - '&c&lCrazy Crates Admin Help' + - '' + - '&6/cc additem [tier] &7- &eAdd items in-game + to a prize in a crate including Cosmic/Casino.' + - '&6/cc preview [player] &7- &eOpens the preview of a crate for a + player.' + - '&6/cc list &7- &eLists all crates.' + - '&6/cc open &7- &eTries to open a crate for you if you have a key.' + - '&6/cc open-others [player] &7- &eTries to open a crate for a player + if they have a key.' + - '&6/cc transfer [player] [amount &7- &eTransfers keys to players + you chose.' + - '&6/cc debug &7- &eDebugs crates' + - '&6/cc admin &7- &eShows admin menu' + - '&6/cc forceopen [player] &7- &eOpens a crate for a player for free.' + - '&6/cc mass-open [amount] &7- &eMass opens a set + amount of crates.' + - '&6/cc tp &7- &eTeleport to a Crate.' + - '&6/cc give [amount] [player] &7- &eAllows you + to take keys from a player.' + - '&6/cc set &7- &eSet the block you are looking at as a crate.' + - '&6/cc set Menu &7- &eSet the block you are looking at to open the /cc menu.' + - '&6/cc reload &7- &eReloads the config/data files.' + - '&6/cc set1/set2 &7- &eSets position &c#1 &eor &c#2 for when making a new schematic + for QuadCrates.' + - '&6/cc save &7- &eCreate a new nbt file in the schematics folder.' + - '' + - '&6/keys view [player] &7- &eCheck the number of keys a player has.' + - '&6/keys &7- &eShows how many keys you have.' + - '&6/cc &7- &eOpens the menu.' + - '' + - '&7You can find a list of permissions @ &ehttps://docs.crazycrew.us/crazycrates/info/commands/permissions' diff --git a/paper/src/main/resources/examples/schematics/classic.nbt b/paper/src/main/resources/examples/schematics/classic.nbt new file mode 100644 index 0000000000000000000000000000000000000000..af8f384c575ab21535d6ee5e7aaa16edf12ede40 GIT binary patch literal 622 zcmV-!0+Ib6iwFP!000000L7NgirX+0g|8(gV>=zXX*WZkqtGsg?h2)=ZiA92wy9$o zNhZuZedSCP3nR(5?Z5~^F!^-uxj%|k0u;b>^DHO;jGvYJE+7}3X-p$DjH`h4u9f@W zy0j193!uH!Zqsd1SZTwJxbEYc%CzJ zKLo*01j7)1Tu=S8vySv4OVlR|Fn5t&WQbn)Odjb)%8%r^MbDERj12FtIwPbQr>qtFzC<-WMr91i?@Q!-9Tt zSo6WuQbGC150A1F`tz3p?t0z|W5jr0y)U8ssbnwIc%RMf?oOVcV0GlJ7FK}$;3oke zPfaKGiXY9_N^z~XmkTe<_HNELuxe#hiNjUF3Ye!}!1^GET{{VWm;|-4zP7sMySW|{ zT$`IvP<^GPO>lbbr1BowS$G0u=&c(yOfDWK7kjz0{$9MCdE5R?ZaZm=JT0kSGIY%S z#PCM_M=)F=Yu+B+)@UVbZuN6*6mP29*x5PqebZI0s4n8CNP5O5qC*qIp9dxE#0?%srGequ>U8UZ`|--Lg_|!_D;ElKe*H{ I?hX$C0EP)Ej{pDw literal 0 HcmV?d00001 diff --git a/paper/src/main/resources/examples/schematics/nether.nbt b/paper/src/main/resources/examples/schematics/nether.nbt new file mode 100644 index 0000000000000000000000000000000000000000..4dab7a8ff2dd7973cb3bdea04a4ad14d030fb39a GIT binary patch literal 578 zcmV-I0=@koiwFP!000000L7NUirX*{hR4z*YkTRf&_cVfvCtlu-U_9sUW1a16SIyL zB$cIorM_h4bmbVYB+sF+f)Esc{^y?=DN+qk0owLANdOo=tMFYxNxf@bOBRMv!Ft>2 z-J`AjR6DM!z5Oqn9W6f;Id7%^icLkAgt!YDF21%r_c1{q8kB9ps_ zFsWEMov}QO+;fa%FvwuSK*st(#`;0V`pM~Fgo&-6i>C=ABcA6BMm*1%RmAg>4l?{e zs8L3zh%j?Mg26}zgA6~Rr_;T&PV}N!$ZO8T@>*gfgF%L$(2JZ-!C(Y~kqiczelETz z%uQl{O_?&$FR>77i4hD&G8kkqpo++vG0yDXb2$QOFP6ru&LY;FuMTAM!dCBtO}DF)b_M9s&Sutaz`?ot!e$G76R~g4j8q2 z9G||wJ~g!8xXWYhoPrwa??#`=3>RjPld=w0jp{6waQo!Fnob`Mv>$(5S?yh4r@c0l zDL&CCFoypacfV<<-_hJcG$^`XXYx0B?^&Nl-46*}+o|mcy}3fFH7^oAs;&vb$&8Q6 zM=z~2sy!T?Z(O5xZGQ;KhfsGZKh8(C|2Oo%LcdDn%Nlu&$j?iU8Ct^a7vS_;D*s=wtzAs>2WrAY!>i z6S-3a0|@3?9z^a8k$Z{(L@c)eF+YHqA3)4cN(TZ=XnxL~Jcb24PZXQYSWuzAwq8C0>M0%0(<9d;bl_404 zU>Je{q@S~Ik0~Sj%V$=Re$km&a|}f=48Z_`as8U}JjYN3!w?K0V-3rH_r8ntf+6+} zOUyhCFtJ|v%x$C>DL<|ksaP3;p$LW{7(g(t&i*$g_Pu~a?li!}>YUO6gdbODpNV}h zQhq3cVF(6-ewJjxds9h8$_KuCkgd?4zZB%AR!ak6|FK2TyMXhjNR)xer`X`@aqOX5AGWTzHEno?$OYl iwN%@x-r2X#>Kixwmr%Nvtvz}EA%6jj`E1KH4*&p4eKgwu literal 0 HcmV?d00001 diff --git a/paper/src/main/resources/examples/schematics/sea.nbt b/paper/src/main/resources/examples/schematics/sea.nbt new file mode 100644 index 0000000000000000000000000000000000000000..e9c839bff86ca6603f9afc7dd8800667cbcd67b7 GIT binary patch literal 623 zcmV-#0+9V5iwFP!000000L_=rj@mE~#wWJJ66p5S9{T4wDz(Q|Z0=D2g&G=2tyOGayosP5xG-D?m31bV)?-k>yRPVVNQo4bQnShI!_F-4s%Qazpqsm z$!pA%k-WytEaI7rn45^7F*A-u5DY~y4B^N3G<ZyR($9nMfLSD-uaH?L`b8#UO)&()Pz1vejPKW!=P8CD7>ZyRGS+2;d+&=x zFGA)v(F=;`MUJ5eh9Ug;UgUHN1Va!EMKBEMXZ%}`+UFUfh9Q&M=R+p7&*x$h1Va%F zi~5_k8AFNxXJHC<4-uv=#-^b&+ z{9WLO3jTw@U0007pwD+mAp literal 0 HcmV?d00001 diff --git a/paper/src/main/resources/examples/schematics/soul.nbt b/paper/src/main/resources/examples/schematics/soul.nbt new file mode 100644 index 0000000000000000000000000000000000000000..b3bb6e98825b1291870287f2a019d263af82841f GIT binary patch literal 634 zcmV-=0)_n_iwFP!000000L7QvirX*{hR4!48zArnThNCsDN*j@edsvhtgPK<>85tDI!eKV;CV0C&WQQ9N&seoFc-ogq|FOgj~L{ zjAlk)kiZE?`gPps)QFIGf8++42)}t;RFT=db}68I0b=W1cnnB zBJen1O^F=uXA{&yh+qKWK!n^66zc>sq-Ra-X`iCGO6<-r-u<3 zPGB&qXAC2;wYAbPxe<#S)k*W^YXw&u(MoIO?tS&$81Sc9OL)I-Iyu*3X}=k@ZD&Sw z3-C8TKHlu4t)-sb>c+kC9)S;iK#TdE+u0|-wAx6$dslX-6vhHty_I8_-aD1LRjZX; zK)DpHaTiOM+SVQ^JEdLE-^6?A9)IW^6Mu>;n=NHGmvI3;UQWTW8qkm7 z`pK2a>iR#W$(eIXWiI2*vuaR_cIiIml(lM|)KH6!i*KwJ&8oI;i7myv=~iBj&-^)& z*{#k-o3oAn;KoZ2{vrPp$Ns#``^vpU=7S-ZHvF=i;puzM`DWZ%=KLvJ4u|P?Va0E$ UO`|&Z75Eqa0mA2BTIdk~0NUX%Q2+n{ literal 0 HcmV?d00001 diff --git a/paper/src/main/resources/examples/schematics/wooden.nbt b/paper/src/main/resources/examples/schematics/wooden.nbt new file mode 100644 index 0000000000000000000000000000000000000000..90a85fa5e0abc4aa82826de0fea67774b4e8e469 GIT binary patch literal 626 zcmV-&0*(D2iwFP!000000KJyMirX*{hR4#xYdaKLXesnT3hi;}tx$UEH7JRam^hY^ z6tdf=ubho+*OBEZg%yM#^y!~}W@K9hKn`fi-;x7B`&;<`95Pwk(w5RdJ90?ZmD(Il z;U?d6;EghVQ#Uv)j1^Yib_|&$z$7Dv1sFDBI6(&qe*8!xI!S<;@)Ki_5X%o1(P06G zPsEDpbmbxB&I!547$n5<0}1B`3Fik1o?|)~U_$5T>S@4W!1I_{1U!$KG~jto2MK<_ z*C?Ws1emcOMqoIBL4qIO)8Vu8Fwu)-Ca*CQ%4?3{1O^Fyd@o`;34vh*h7%Yh`nmcZ zFxkZOHDvOMezBQYa||OeoWLM~@%@_fJjXBs!wC!$W3^-W?ky&I!3oa}C-fr5Z~}t_ zKfV_+orJ(J0>cRm5*T0S;WuUKdx4SMS%8_Ub4&*betex{I!S<;s`H%ZIR=A%GDyYQ z9+ZaSQEVSoEzRdIIXpC?lGe)hzPc=+_^DMRb$g%90L4>jAbECs@rO7`cy}smxzS>0 zzbbKDRchZYz5jcusYHD=FcMr|oEz=7?d290J5d?w_S@%1Lb_GwbtOZ3#yYbrQ;GFh zFWrevS?__Jo6KFrpRBC6opLAjwwG$kR%|STQW)F$37T9O<%-u&Yo!NMyvTuobK{cI z=ib4m-oZw#U79Z`T|`y=ONrLXT6OAFKMYFL==0`QBftEnUlygl%lROxotK(O}Kn76Yw8#G05PpDa{vGU literal 0 HcmV?d00001 From 4e9cba0a55c53fd98ae56c112cbfaa0449552671 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:22:07 -0400 Subject: [PATCH 2/6] Use valid config path for CrateName --- .../badbones69/crazycrates/tasks/crates/CrateManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java index f1ab15b33..4203f9051 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java +++ b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/CrateManager.java @@ -12,7 +12,8 @@ import com.badbones69.crazycrates.tasks.crates.types.*; import com.badbones69.crazycrates.tasks.crates.types.CasinoCrate; import com.badbones69.crazycrates.tasks.crates.types.CsgoCrate; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.common.util.FileUtil; +import com.ryderbelserion.vital.enums.Support; import org.apache.commons.lang.WordUtils; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.meta.ItemMeta; @@ -186,7 +187,7 @@ public void loadCrates() { List prizes = new ArrayList<>(); List tiers = new ArrayList<>(); - String previewName = file.contains("Crate.Preview-Name") ? file.getString("Crate.Preview-Name") : file.getString("Crate.Name"); + String previewName = file.contains("Crate.Preview-Name") ? file.getString("Crate.Preview-Name") : file.getString("Crate.CrateName"); int maxMassOpen = file.getInt("Crate.Max-Mass-Open", 10); int requiredKeys = file.getInt("Crate.RequiredKeys", 0); From ef613febf7259a38cf46fd6bb8fc3f67707e7e69 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:22:38 -0400 Subject: [PATCH 3/6] Update imports --- .../badbones69/crazycrates/CrazyCrates.java | 22 ++++--------------- .../crazycrates/api/PrizeManager.java | 2 +- .../api/builders/InventoryBuilder.java | 2 +- .../crazycrates/api/builders/ItemBuilder.java | 16 +++++++------- .../crazycrates/api/enums/Messages.java | 6 ++--- .../crazycrates/api/objects/Crate.java | 2 +- .../commands/subs/BaseKeyCommand.java | 2 +- .../commands/subs/CrateBaseCommand.java | 2 -- .../listeners/crates/CrateOpenListener.java | 2 +- 9 files changed, 20 insertions(+), 36 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java b/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java index 9fbafa810..9359a1319 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java +++ b/paper/src/main/java/com/badbones69/crazycrates/CrazyCrates.java @@ -24,8 +24,8 @@ import com.badbones69.crazycrates.tasks.InventoryManager; import com.badbones69.crazycrates.tasks.MigrationManager; import com.badbones69.crazycrates.tasks.crates.CrateManager; -import com.ryderbelserion.vital.VitalPlugin; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.VitalPaper; +import com.ryderbelserion.vital.enums.Support; import net.minecraft.server.dedicated.DedicatedServer; import org.bukkit.plugin.java.JavaPlugin; import com.badbones69.crazycrates.api.FileManager; @@ -83,13 +83,9 @@ public void onLoad() { .setup(); } - private VitalPlugin plugin; - @Override public void onEnable() { - this.plugin = new VitalPlugin(this); - this.plugin.setLogging(MiscUtils.isLogging()); - this.plugin.start(); + new VitalPaper(this); int radius = DedicatedServer.getServer().getSpawnProtectionRadius(); @@ -180,13 +176,7 @@ public void onEnable() { @Override public void onDisable() { // Cancel the timer task. - if (this.timer != null) { - this.timer.cancel(); - } - - if (this.plugin != null) { - this.plugin.stop(); - } + this.timer.cancel(); // Clean up any mess we may have left behind. if (this.crateManager != null) { @@ -204,10 +194,6 @@ public void onDisable() { } } - public @NotNull VitalPlugin getPlugin() { - return this.plugin; - } - public @NotNull InventoryManager getInventoryManager() { return this.inventoryManager; } diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java b/paper/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java index b5a7e48d8..0f80ad6f0 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/PrizeManager.java @@ -2,7 +2,7 @@ import com.badbones69.crazycrates.api.objects.Tier; import com.badbones69.crazycrates.api.builders.ItemBuilder; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.enums.Support; import org.apache.commons.lang.WordUtils; import com.badbones69.crazycrates.CrazyCrates; import com.badbones69.crazycrates.api.events.PlayerPrizeEvent; diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/builders/InventoryBuilder.java b/paper/src/main/java/com/badbones69/crazycrates/api/builders/InventoryBuilder.java index 36cc3c7f0..ca00cb2e7 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/builders/InventoryBuilder.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/builders/InventoryBuilder.java @@ -5,7 +5,7 @@ import com.badbones69.crazycrates.api.objects.Crate; import com.badbones69.crazycrates.api.objects.Tier; import com.badbones69.crazycrates.api.utils.MiscUtils; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.enums.Support; import org.bukkit.plugin.java.JavaPlugin; import us.crazycrew.crazycrates.platform.config.ConfigManager; import us.crazycrew.crazycrates.platform.config.impl.ConfigKeys; diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/builders/ItemBuilder.java b/paper/src/main/java/com/badbones69/crazycrates/api/builders/ItemBuilder.java index efa0cd06a..aad781487 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/builders/ItemBuilder.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/builders/ItemBuilder.java @@ -6,8 +6,8 @@ import com.badbones69.crazycrates.api.utils.MsgUtils; import com.badbones69.crazycrates.support.SkullCreator; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.ryderbelserion.vital.api.enums.Support; -import com.ryderbelserion.vital.utils.DyeUtils; +import com.ryderbelserion.vital.enums.Support; +import com.ryderbelserion.vital.util.DyeUtil; import io.th0rgal.oraxen.api.OraxenItems; import me.clip.placeholderapi.PlaceholderAPI; import net.minecraft.nbt.TagParser; @@ -583,10 +583,10 @@ public ItemBuilder setMaterial(String type) { } else { this.potionType = getPotionType(PotionEffectType.getByName(metaData)).getEffectType(); - this.potionColor = DyeUtils.getColor(metaData); - this.armorColor = DyeUtils.getColor(metaData); - this.mapColor = DyeUtils.getColor(metaData); - this.fireworkColor = DyeUtils.getColor(metaData); + this.potionColor = DyeUtil.getColor(metaData); + this.armorColor = DyeUtil.getColor(metaData); + this.mapColor = DyeUtil.getColor(metaData); + this.fireworkColor = DyeUtil.getColor(metaData); } } else if (type.contains("#")) { String[] section = type.split("#"); @@ -1160,7 +1160,7 @@ public static ItemBuilder convertString(String itemString, String placeHolder) { try { for (PatternType pattern : PatternType.values()) { if (option.equalsIgnoreCase(pattern.name()) || value.equalsIgnoreCase(pattern.getIdentifier())) { - DyeColor color = DyeUtils.getDyeColor(value); + DyeColor color = DyeUtil.getDyeColor(value); if (color != null) itemBuilder.addPattern(new Pattern(color, pattern)); break; } @@ -1363,7 +1363,7 @@ private void addPatterns(String stringPattern) { for (PatternType pattern : PatternType.values()) { if (split[0].equalsIgnoreCase(pattern.name()) || split[0].equalsIgnoreCase(pattern.getIdentifier())) { - DyeColor color = DyeUtils.getDyeColor(split[1]); + DyeColor color = DyeUtil.getDyeColor(split[1]); if (color != null) addPattern(new Pattern(color, pattern)); diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/enums/Messages.java b/paper/src/main/java/com/badbones69/crazycrates/api/enums/Messages.java index d09295743..9e73218b5 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/enums/Messages.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/enums/Messages.java @@ -2,8 +2,8 @@ import ch.jalu.configme.SettingsManager; import ch.jalu.configme.properties.Property; -import com.ryderbelserion.vital.api.enums.Support; -import com.ryderbelserion.vital.utils.MiscUtils; +import com.ryderbelserion.vital.common.util.StringUtil; +import com.ryderbelserion.vital.enums.Support; import org.bukkit.command.CommandSender; import us.crazycrew.crazycrates.platform.config.ConfigManager; import us.crazycrew.crazycrates.platform.config.impl.messages.CommandKeys; @@ -159,7 +159,7 @@ public String getMessage(Map placeholders, CommandSender sender) String message; if (isList()) { - message = MiscUtils.convertList(getPropertyList(this.listProperty)); + message = StringUtil.convertList(getPropertyList(this.listProperty)); } else { message = getProperty(this.property); } diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java b/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java index a2db5fbbf..d27861e5f 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java @@ -138,7 +138,7 @@ public Crate(String name, String previewName, CrateType crateType, ItemStack key if (crateType == CrateType.quad_crate) { this.particle = Registry.PARTICLE_TYPE.get(NamespacedKey.minecraft(file != null ? file.getString("Crate.particles.type", "dust") : "dust")); - this.color = DyeUtils.getColor(file != null ? file.getString("Crate.particles.color", "235,64,52") : "235,64,52"); + this.color = DyeUtil.getColor(file != null ? file.getString("Crate.particles.color", "235,64,52") : "235,64,52"); } this.hologram = hologram != null ? hologram : new CrateHologram(); diff --git a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java index cc0dd0067..17e2e66ba 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java +++ b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java @@ -3,7 +3,7 @@ import com.badbones69.crazycrates.CrazyCrates; import com.badbones69.crazycrates.api.objects.Crate; import com.google.common.collect.Lists; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.enums.Support; import dev.triumphteam.cmd.bukkit.annotation.Permission; import dev.triumphteam.cmd.core.BaseCommand; import dev.triumphteam.cmd.core.annotation.*; diff --git a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/CrateBaseCommand.java b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/CrateBaseCommand.java index 5c242a895..ccdc93b4e 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/CrateBaseCommand.java +++ b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/CrateBaseCommand.java @@ -157,8 +157,6 @@ public void onReload(CommandSender sender) { this.plugin.getMetrics().start(); } - this.plugin.getPlugin().setLogging(MiscUtils.isLogging()); - FileUtils.cleanFiles(); // Close previews diff --git a/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CrateOpenListener.java b/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CrateOpenListener.java index b2dddfb8b..d5d2dfb38 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CrateOpenListener.java +++ b/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CrateOpenListener.java @@ -6,7 +6,7 @@ import com.badbones69.crazycrates.api.enums.Messages; import com.badbones69.crazycrates.api.events.CrateOpenEvent; import com.badbones69.crazycrates.api.objects.Crate; -import com.ryderbelserion.vital.api.enums.Support; +import com.ryderbelserion.vital.enums.Support; import me.clip.placeholderapi.PlaceholderAPI; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; From 418538d14106aa20ddf564cffb41ec8844d39314 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:22:53 -0400 Subject: [PATCH 4/6] Use crate name method --- .../badbones69/crazycrates/commands/subs/BaseKeyCommand.java | 2 +- .../crazycrates/listeners/crates/CosmicCrateListener.java | 4 ++-- .../crazycrates/tasks/crates/types/CosmicCrate.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java index 17e2e66ba..2b2516b4b 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java +++ b/paper/src/main/java/com/badbones69/crazycrates/commands/subs/BaseKeyCommand.java @@ -84,7 +84,7 @@ private void getKeys(Player player, CommandSender sender, String header, String hasKeys = true; - placeholders.put("{crate}", crate.getFile().getString("Crate.Name")); + placeholders.put("{crate}", crate.getCrateInventoryName()); placeholders.put("{keys}", String.valueOf(amount)); placeholders.put("{crate_opened}", String.valueOf(this.userManager.getCrateOpened(player.getUniqueId(), crate.getName()))); diff --git a/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CosmicCrateListener.java b/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CosmicCrateListener.java index 885e75a86..aec73522d 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CosmicCrateListener.java +++ b/paper/src/main/java/com/badbones69/crazycrates/listeners/crates/CosmicCrateListener.java @@ -341,7 +341,7 @@ public void onInventoryClick(InventoryClickEvent event) { } // Get new name. - String shufflingName = crate.getFile().getString("Crate.CrateName") + " - Shuffling"; + String shufflingName = crate.getCrateInventoryName() + " - Shuffling"; // Update the cosmic name. holder.title(shufflingName); @@ -432,7 +432,7 @@ private void startRollingAnimation(Player player, InventoryView view, CratePrize } private void showRewards(Player player, InventoryView view, CratePrizeMenu cosmic, CosmicCrateManager crateManager) { - String rewardsName = cosmic.getCrate().getFile().getString("Crate.CrateName") + " - Prizes"; + String rewardsName = cosmic.getCrate().getCrateInventoryName() + " - Prizes"; cosmic.title(rewardsName); diff --git a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/types/CosmicCrate.java b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/types/CosmicCrate.java index 7859ca963..1793b987c 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/types/CosmicCrate.java +++ b/paper/src/main/java/com/badbones69/crazycrates/tasks/crates/types/CosmicCrate.java @@ -20,7 +20,7 @@ public class CosmicCrate extends CrateBuilder { private final CrateManager crateManager = this.plugin.getCrateManager(); public CosmicCrate(Crate crate, Player player, int size) { - super(crate, player, size, crate.getFile().getString("Crate.CrateName") + " - Choose"); + super(crate, player, size, crate.getCrateInventoryName() + " - Choose"); } @Override From 5d0fd8703de8f96d5c4aabfc9b7a57ec661b2b92 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:23:15 -0400 Subject: [PATCH 5/6] Add null check from TDL's pull request --- .../java/com/badbones69/crazycrates/api/objects/Crate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java b/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java index d27861e5f..072a6c31f 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/objects/Crate.java @@ -4,7 +4,7 @@ import com.badbones69.crazycrates.api.builders.types.CrateTierMenu; import com.badbones69.crazycrates.api.enums.PersistentKeys; import com.badbones69.crazycrates.tasks.crates.effects.SoundEffect; -import com.ryderbelserion.vital.utils.DyeUtils; +import com.ryderbelserion.vital.util.DyeUtil; import org.bukkit.Color; import org.bukkit.NamespacedKey; import org.bukkit.Particle; @@ -97,7 +97,7 @@ public class Crate { public Crate(String name, String previewName, CrateType crateType, ItemStack key, String keyName, List prizes, FileConfiguration file, int newPlayerKeys, List tiers, int maxMassOpen, int requiredKeys, List prizeMessage, List prizeCommands, CrateHologram hologram) { this.emptyKey = ItemBuilder.convertItemStack(key); this.keyBuilder = ItemBuilder.convertItemStack(key).setCrateName(name); - this.keyName = keyName; + this.keyName = keyName != null ? keyName : "Crate.PhysicalKey.Name is not in the " + name + ".yml"; this.file = file; this.name = name; From cee8299bb20cfc8d8595bdde4fc297f5fa09f8d1 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Wed, 17 Apr 2024 01:25:35 -0400 Subject: [PATCH 6/6] Bump version --- .github/workflows/publish.yml | 2 ++ CHANGELOG.md | 6 +++++- gradle.properties | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5473a9443..880e84e7f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,8 +18,10 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 + - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v2 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 540261378..9362756b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ Please read the previous changelog https://modrinth.com/plugin/crazycrates/version/2.0 ## Fixes: -* Fixed an issue where setting crate type menu tried to create a hologram. +* Fixed a placeholder issue in commands like /key by using the right config path +* Fixed the `examples` folder not generating + +## Pull Requests Merged: +* https://github.com/Crazy-Crew/CrazyCrates/pull/692 -> Adds null safety to the key name if not found in config. ## Other: * [Feature Requests](https://github.com/Crazy-Crew/CrazyCrates/discussions/categories/features) diff --git a/gradle.properties b/gradle.properties index 389caf8a0..920571ba3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ issues = https://github.com/Crazy-Crew/CrazyCrates/issues group = com.badbones69.crazycrates description = Add unlimited crates to your server with 10 different crate types to choose from! -version = 2.0.1 +version = 2.0.2 apiVersion = 1.20 mcVersion = 1.20.4