diff --git a/docs/all-plugins/pages.md b/docs/all-plugins/pages.md new file mode 100644 index 0000000000..e26068c226 --- /dev/null +++ b/docs/all-plugins/pages.md @@ -0,0 +1,38 @@ +--- +title: GUI Pages +sidebar_position: 1 +--- + +## Custom Pages +Custom pages are used in most of the plugins, and understanding how to correctly configure a GUI page is important to creating your menus. + +## How to make a page + +Pages consist of three key components, a mask, a pattern, and sometimes a page number. A pattern is the layout of the background or filler items. Think of the pattern section as the GUI, with 9 columns and up to 6 rows. + +Patterns use a simple format: +`0` is an empty slot. +`1-9` are the first nine different filler items +`a-z` is the remaining 26 items. +In total you could display 35 different items as "filler" items in your GUI. + +A mask is the items to be shown in the pattern layout, these work from the top down. You can use the [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system) here to add custom items, apply names or any other of the options. +The first item in the list will represent `1` in the pattern, the second item in the list is `2`, etc.. + +## Example Page Config + +```yaml + - page: 1 + mask: + items: # The order of items to display + - gray_stained_glass_pane # The 1st Item + - black_stained_glass_pane # The 2nd Item + pattern: + - "222222222" + - "211111112" + - "222222222" +``` + +This example has a surrounding layer of `gray_stained_glass_pane` and a center strip of `black_stained_glass_pane`. + +[![Page](https://i.imgur.com/tQLXe3F.png) \ No newline at end of file diff --git a/docs/ecocrates/animationsandrolls.md b/docs/ecocrates/animationsandrolls.md index 31acc615ff..4359e69b35 100644 --- a/docs/ecocrates/animationsandrolls.md +++ b/docs/ecocrates/animationsandrolls.md @@ -5,46 +5,16 @@ sidebar_position: 4 ## What are rolls? -Whenever you open a crate, it creates a roll and runs it - a roll is essentially an animation, for example CS:GO crates or the Encircle roll. - -## List of Rolls - -### CSGO - -ID: `csgo` - -[csgo](https://youtu.be/IGwYEmMBGk8) - -### Encircle - -ID: `encircle` - -[encircle](https://youtu.be/EhLiTVnQ6zs) - -### Flash - -ID: `flash` - -[flash](https://youtu.be/J9S5HKUBFwA) - -### Quick - -ID: `quick` - -[quick](https://youtu.be/_gaMLZ_QM6E) - -### Instant - -ID: `instant` - -[instant](https://youtu.be/U3TNbZMrju4) - -### Semi-Instant - -ID: `semi_instant` - -[semi_instant](https://youtu.be/ecsIdOLwSnU) - +Rolls happen whenever you open a crate. It's essentially an animation the player sees before a reward is won. + +| Roll ID | Video | +| -------------- | ------------------------------------- | +| `csgo` | [Video](https://youtu.be/IGwYEmMBGk8) | +| `encircle` | [Video](https://youtu.be/EhLiTVnQ6zs) | +| `flash` | [Video](https://youtu.be/J9S5HKUBFwA) | +| `quick` | [Video](https://youtu.be/_gaMLZ_QM6E) | +| `instant` | [Video](https://youtu.be/U3TNbZMrju4) | +| `semi_instant` | [Video](https://youtu.be/ecsIdOLwSnU) | ## Rerolls Rerolls are a chance to get another reward - you can toggle this in crate config. The GUI is also completely customizable to your liking. diff --git a/docs/ecocrates/how-to-make-a-custom-crate.md b/docs/ecocrates/how-to-make-a-custom-crate.md index 00ff8cd206..9bd580196e 100644 --- a/docs/ecocrates/how-to-make-a-custom-crate.md +++ b/docs/ecocrates/how-to-make-a-custom-crate.md @@ -2,16 +2,17 @@ title: "How to make a custom crate" sidebar_position: 2 --- -## Default config - -The default configs can be found here: -[GitHub](https://github.com/Auxilor/EcoCrates/blob/master/eco-core/core-plugin/src/main/resources/crates/) +## Default config +The default configs can be found [here](https://github.com/Auxilor/EcoCrates/tree/master/eco-core/core-plugin/src/main/resources/crates). ## How to add crates -Crates are each config files placed in the `/crates/` folder, and you can add or remove them as you please. There's an example config called `_example.yml` to help you out! +Each crate is its own config file, placed in the `/mobs/` folder, and you can add or remove them as you please. There's an example config called `_example.yml` to help you out! -## Typical Crate Config +The ID of the crate is the file name. This is what you use in commands and in the [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). +ID's must be lowercase letters, numbers, and underscores only. + +## Example Crate Config ```yaml name: "Demo Crate" # The display name of the crate @@ -161,214 +162,201 @@ rewards: # The rewards to give, configure in rewards.yml ## Understanding all the sections -**id:** The ID of the crate. This is what you use in commands - ID's must be lowercase letters, numbers, and underscores only. - -**name:** The name of the booster, shown to the player. +**name:** The name of the crate, shown to the player. **roll:** The [Roll](https://plugins.auxilor.io/ecocrates/animationsandrolls#list-of-rolls) type for this crate **can-reroll:** Enable/disable reroll feature for this crate. - -**preview:** Config for the preview GUI of this crate. - -**key:** Config for the key item of this crate. - -  **item:** The [Items Lookup](https://plugins.auxilor.io/all-plugins/the-item-lookup-system) string for the key item. - -  **lore:** The lore of a key item. - -  **is-custom-item** If the key should be the exact item provided, rather than using it as a base for it's own key item - enable this to have custom items as your keys, for example ecoitems:fuschium_shard would be the key, so all Fuschium Shards would open the crate - -**keygui:** Config for the [/crate keys](https://plugins.auxilor.io/ecocrates/commands-and-permissions#crate-keys-view-your-keys) appearance of this crate. - -**pay-to-open:** Config for opening this crate for money. - -  **enabled:** Enable/Disable pay-to-open feature for this crate (true/false). -  **price:** The price to open this crate (works only if enabled: is set to true). - -**placed:** Config for the placed version of this crate. - -**open:** Config for the actions on crate open. - -**finish:** Config for the actions on crate finish opening. - -**rewards:** A list of [Rewards](https://plugins.auxilor.io/ecocrates/rewards) that this crate should give. - -## Preview Config +### Preview ```yaml -preview: # The preview GUI, when left-clicking a crate or using /crates preview - title: Demo Crate # The GUI title - rows: 6 # The amount of rows for the gui, between 1 and 6 - mask: # Filler items for decoration - items: # Add as many items as you want - - gray_stained_glass_pane # Item 1 - - black_stained_glass_pane # Item 2 - pattern: - - "222222222" - - "211010112" - - "201010102" - - "201010102" - - "201111102" - - "222222222" - rewards: # Where to put rewards in the GUI - - id: diamond_sword # The reward ID - row: 3 # The row - column: 2 # The column - - id: stack_of_emeralds - row: 4 - column: 2 - - id: bedrock - row: 3 - column: 2 - - id: 1000_coins - row: 5 - column: 2 +preview: + title: Demo Crate + rows: 6 + forwards-arrow: + item: arrow name:"&fNext Page" + row: 6 + column: 6 + backwards-arrow: + item: arrow name:"&fPrevious Page" + row: 6 + column: 4 + pages: + - page: 1 + mask: + items: + - gray_stained_glass_pane + - black_stained_glass_pane + pattern: + - "222222222" + - "211111112" + - "211011112" + - "211110112" + - "211111112" + - "222222222" + rewards: + - id: diamond_sword # The reward ID + row: 3 + column: 4 + - id: stack_of_emeralds + row: 4 + column: 6 ``` **title:** The title of preview GUI. **rows:** The amount of rows in the preview GUI (1-6). +##### Pages -**mask:** The section of a GUI mask. +To configure a pattern and mask, read here for more info: [Pages](https://plugins.auxilor.io/all-plugins/pages) +##### Rewards +Where you set where crate rewards are placed in the preview GUI. -**items:** A list if [Items Lookup](https://plugins.auxilor.io/all-plugins/the-item-lookup-system) strings. +**id:** The ID of a [Reward](https://plugins.auxilor.io/ecocrates/rewards). -**pattern:** A numeric pattern, where each number refferes to the item from the items section (0 for air). +**row/column:** The location of this item in the crate +### Key -**rewards:** A place where you set where crate rewards are placed in the preview GUI. +```yaml +key: + item: tripwire_hook unbreaking:1 hide_enchants name:"&aDemo Crate Key" + lore: + - "&fUse this key to open" + - "&fthe Demo Crate" + use-custom-item: false +``` -**id:** The id of a [Reward](https://plugins.auxilor.io/ecocrates/rewards). +**item:** This is the item shown in the GUI, read here for more info: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). -**row:** The row of the GUI. +**lore:** The item lore shown in-game. Set to `lore: []` to remove all lore lines. -**column:** The column of the GUI. +**is-custom-item** If the key should be the exact item provided, rather than using it as a base for it's own key item - enable this to have custom items as your keys, for example `ecoitems:fuschium_shard` would be the key, so **all** Fuschium Shards would open the crate. -## Key GUI config +### Key GUI ```yaml -keygui: # Options for showing up in /crate keys - enabled: true # If the crate should be in the key gui - item: tripwire_hook unbreaking:1 hide_enchants name:"Demo Crate" # The item in the gui - lore: # The GUI lore +keygui: + enabled: true + item: tripwire_hook unbreaking:1 hide_enchants name:"Demo Crate" + lore: - "Demo Crate" - "&fYou have %keys% keys" - "&fGet more at &astore.example.net" - row: 2 # The position in the gui - column: 3 - right-click-previews: true # If right click opens the preview - left-click-opens: true # If left click open the crate virtually - shift-left-click-messsage: # The messages to send on shift-left-click + row: 2 + column: 3 + right-click-previews: true + left-click-opens: true + shift-left-click-messsage: - "Buy a Demo Crate key here! &astore.example.net" ``` -**enabled:** Enable/Disable showing this crate in [/crate keys](https://plugins.auxilor.io/ecocrates/commands-and-permissions#crate-keys-view-your-keys) (true/false) - -**item:** The [Items Lookup](https://plugins.auxilor.io/all-plugins/the-item-lookup-system) string for the GUI item. +**enabled:** If the crate should be in [/crate keys](https://plugins.auxilor.io/ecocrates/commands-and-permissions#crate-keys-view-your-keys) (true/false). -**lore:** The lore of the GUI item. +**item:** This is the item shown in the GUI, read here for more info: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). -**row:** The row position in the GUI. +**lore:** The item lore shown in-game. Set to `lore: []` to remove all lore lines. -**column:** The row column in the GUI. +**row/column:** The location of this item in the GUI. -**right-click-previews:** If right-clicking the item in the key GUI should open this crate preview (true/false). +**right-click-previews:** If right click opens up crate preview (true/false). -**left-click-opens:** If left-clicking the item in the key GUI should open this crate virtually (true/false). +**left-click-opens:** If left click should open the crate (true/false). -**shift-left-click-messsage:** A list of messages sent to the player when he shift-left-clicks the item in the key GUI. +**shift-left-click-message:** A message to be sent on shift-left-click. -## Placed Crate config +### Pay To Open -```yaml -placed: # Options for physically placed crates - random-reward: # The random reward hologram, shows an item - enabled: true # If the random reward should be shown - height: 1.5 # The height above the crate at which to show the reward - delay: 30 # The ticks between showing a new item - name: "&fYou could win:" # The text above the item - particles: # The particle effects around the crate, add as many as you want - - particle: flame # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html - animation: spiral # spiral, double_spiral, circle, or twirl - hologram: # The text hologram, requires a hologram plugin to be installed - height: 1.5 # The height above the crate - ticks: 200 # The total ticks to cycle all frames - frames: - - tick: 0 # The starting tick to show this frame - lines: - - "&lDEMO CRATE" - - "&b&lLeft Click to Preview" - - '&a&lRight click to Open' - - tick: 100 - lines: - - "&lDEMO CRATE" - - "&a&lLeft Click to Preview" - - '&b&lRight click to Open' -``` +**enabled:** Enable/Disable pay-to-open feature for this crate (true/false). -**random-reward:** Options for a random reward appearing above the placed physical crate. +**price:** The price to open this crate (works only if enabled: is set to true). -  **enabled:** Enable/Disable random reward displaying for this crate (true/false). +### Placed -  **height:** The Y offset for the reward item from the crate block. +```yaml +placed: + random-reward: + enabled: true + height: 1.5 + delay: 30 + name: "&fYou could win:" + particles: + - particle: flame + animation: spiral + hologram: + height: 1.5 + ticks: 200 + frames: + - tick: 0 + lines: + - "&lDEMO CRATE" + - "&b&lLeft Click to Preview" + - '&a&lRight click to Open' + - tick: 100 + lines: + - "&lDEMO CRATE" + - "&a&lLeft Click to Preview" + - '&b&lRight click to Open' +``` +#### random-reward -  **delay:** Ticks between changing the displayed reward. +**enabled:** If a random item shows in the hologram. -  **name:** The text displayed above the random reward item. +**height:** The height above the crate to show the rewards. -**particles:** A list o particle effects around the placed crate. +**delay:** The ticks between changing the displayed item. -  **particle:** The [Particle](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html) name. +**name:** The text shown above the display item. +#### particles -  **animation:** The Animation name (spiral, double_spiral, circle, or twirl). +**particle:** The particle, read here for more info: [Particles](https://plugins.auxilor.io/all-plugins/the-particle-lookup-system). -**hologram:** The text hologram above the crate. Requires a [Hologram](https://plugins.auxilor.io/all-plugins/what-plugins-do-you-support#hologram) plugin to be installed. +**animation:** The particle animation (`spiral`, `double_spiral`, `circle`, or `twirl`). -  **height:** The Y offset for the hologram from the crate block. +#### hologram -  **ticks:** The total ticks in the hologram animation. +**height:** The Y offset for the hologram from the crate block. -  **frames:** A list of frames for the hologram animation. +**ticks:** The total ticks in the hologram animation. +##### frames -    **tick:** The starting tick for this frame to be shown. +**tick:** The starting tick for this frame to be shown. -    **lines:** A list of hologram text lines on this frame. +**lines:** A list of hologram text lines on this frame. -## Opening/Finish opening crate effects config +### Opening/Finish opening crate effects config ```yaml -open: # Effects when opening the crate, before rewards are given - right when the player clicks - messages: # The messages to send the player +open: + messages: - "Good luck!" - broadcasts: # The messages to send to everyone + broadcasts: - "%player%&f is opening the Demo Crate!" - commands: [ ] # Commands to execute, use %player% as a placeholder - sounds: # The sounds to play - - sound: entity_villager_yes # https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html - volume: 10 # Essentially the distance at which the sound should be heard - pitch: 1 # Between 0.5 and 2 - -finish: # Effects once the crate rewards have been given - messages: # The messages to send the player + commands: [ ] + sounds: + - sound: entity_villager_yes + volume: 10 + pitch: 1 + +finish: + messages: - "You won %reward%&f!" - broadcasts: # The messages to send to everyone + broadcasts: - "%player%&f won %reward%&f from the Demo Crate!" - commands: [ ] # Commands to execute, use %player% as a placeholder - fireworks: # The fireworks to launch, add as many as you want - - power: 2 # The duration of the firework, set to 0 for instant explosion - type: ball_large # https://hub.spigotmc.org/javadocs/spigot/org/bukkit/FireworkEffect.Type.html - colors: # Any hex colors + commands: [ ] + fireworks: + - power: 2 + type: ball_large - 00ffff - 00ff00 - fade-colors: # Any hex colors + fade-colors: - ffffff - 999999 trail: true flicker: true - sounds: # The sounds to play, ad ass many as you want - - sound: entity_generic_explode # https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html - volume: 10 # Essentially the distance at which the sound should be heard - pitch: 1 # Between 0.5 and 2 + sounds: + - sound: entity_generic_explode + volume: 10 + pitch: 1 ``` **messages:** A list of messages sent to the player when he starts/finishes opening the crate. @@ -376,25 +364,40 @@ finish: # Effects once the crate rewards have been given **broadcasts:** A list of messages sent to the whole server when a player starts/finishes opening the crate. **commands:** A list of commands to be executed when a player starts/finishes opening the crate (%player% for a player name) +#### Fireworks: + +**power:** The duration of the firework, set to 0 for instant explosion. + +**type:** The [Firework Effect Type](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/FireworkEffect.Type.html). -**fireworks:** A list of fireworks to be launched when a player finishes opening the crate. +**colors:** A list of the firework colors (any HEX color of `#ffffff` format). -  **power:** The duration of the firework, set to 0 for instant explosion. +**fade-colors:** A list of the firework fade colors (any HEX color of `#ffffff` format). -  **type:** The [Firework Effect Type](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/FireworkEffect.Type.html). +**trail** Enable/Disable the trail for this firework (true/false). -  **colors:** A list of the firework colors (any HEX color of ffffff format). +**flicker** Enable/Disable the flicker for this firework (true/false). -  **fade-colors:** A list of the firework fade colors (any HEX color of ffffff format). +#### Sounds -  **trail** Enable/Disable the trail for this firework (true/false). +**sound:** The [Sound Name](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html). -  **flicker** Enable/Disable the flicker for this firework (true/false). +**volume:** Essentially the distance at which the sound should be heard. -**sounds:** A list of sounds to be played when a player starts/finishes opening the crate. +**pitch:** The pitch for that sound (between 0.5 and 2). -  **sound:** The [Sound Name](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html). +### Rewards +A list of rewards winnable in the crate. + +```yaml +rewards: + - diamond_sword +``` +## Internal Placeholders -  **volume:** Essentially the distance at which the sound should be heard. +| Placeholder | Value | +| ----------- | --------------------------------------------------------- | +| `%keys%` | The amount of virtual keys for this crate the player has. | +| `%reward%` | The display name of the reward. | +| `%player%` | The player who won the reward. | -  **pitch:** The pitch for that sound (between 0.5 and 2). diff --git a/docs/ecocrates/rewards.md b/docs/ecocrates/rewards.md index 9743ae1917..ff34b8161d 100644 --- a/docs/ecocrates/rewards.md +++ b/docs/ecocrates/rewards.md @@ -3,9 +3,13 @@ title: "Rewards" sidebar_position: 3 --- -## How to configure a reward +## Default config +The default reward config can be found [here](https://github.com/Auxilor/EcoCrates/blob/master/eco-core/core-plugin/src/main/resources/rewards.yml). -Example reward config: +## How to configure rewards +Each reward goes into the `rewards.yml` file. From here you reference each one in your crates using the ID of the reward. + +## Example Reward Config ```yaml - id: 1000_coins @@ -13,74 +17,53 @@ Example reward config: - "eco give %player% 1000" items: [ ] messages: [ ] + max-wins: -1 weight: permission-multipliers: false actual: 10 display: 25 - max-wins: -1 display: name: "&a$1000" item: paper 1 unbreaking:1 hide_enchants - dont-keep-lore: false # Optional, set to true to only show custom lore + dont-keep-lore: false lore: - "&fDisplay Chance: &a%chance%%" - "&fActual Chance: &a%actual_chance%%" ``` +## Understanding all the sections + **id:** The ID of the reward, used to add the reward to a crate **commands:** Commands to be ran when the reward is won - use %player% for the player-name -**items:** A list of items to be given to the player when the reward is won, supports custom items, enchants, and more - read about the syntax here: - -[The Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system) +**items:** A list of items to be given to the player when the reward is won, read here for more info: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). **messages:** The messages to be sent to the player when they win -**weight:** +**max-wins:** The max amount of times a given player can win the reward, perfect for single-use rewards like giving particle effects. Set to -1 to disable +#### Weight -* **permission-multipliers:** If permission chance multipliers should apply to this reward -* **actual:** The actual chance of winning the reward -* **display:** The chance of the reward showing up in crate animations - this allows you to rig crates however you want, for example making a rare (or even unwinnable) item appear common, or vice versa. Both actual and display weight let you use PAPI placeholders to calculate them, for example %player_y%, if you want the chance to depend on a placeholder - very useful if you're basing it off of wins, ranks, or whatever - this supports mathematical expressions too, like when configuring an effect in my other plugins +**permission-multipliers:** If permission chance multipliers should apply to this reward -**max-wins:** The max amount of times a given player can win the reward, perfect for single-use rewards like giving particle effects. Set to -1 to disable +**actual:** The actual chance of winning the reward -**display:** +**display:** The chance of the reward showing up in crate animations - this allows you to rig crates however you want, for example making a rare (or even unwinnable) item appear common, or vice versa. Both actual and display weight let you use PAPI placeholders to calculate them, for example `%player_y%`, if you want the chance to depend on a placeholder - very useful if you're basing it off of wins, ranks, or whatever - this supports mathematical expressions too, like when configuring an effect in my other plugins -* **name:** The name of the reward -* **item:** The item to be shown in animations and previews -* **lore:** The lore of the item +#### Display -## Showing a reward in the preview GUI +**name:** The name of the reward + +**item:** The item to be shown in animations and previews, read here for more info: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). + +**dont-keep-lore:** (Optional) Set to true to only show custom lore. + +**lore:** The lore of the item. +## Internal Placeholders + +| Placeholder | Value | +| ----------------- | --------------------------- | +| `%chance%` | The reward's display chance | +| `%actual_chance%` | The reward's actual chance | -In order to have the reward be shown in the preview GUI, you need to specify it like this in your crate config: -```yaml -preview: # The preview GUI, when left-clicking a crate or using /crates preview - title: Demo Crate # The GUI title - rows: 6 # The amount of rows for the gui, between 1 and 6 - mask: # Filler items for decoration - items: # Add as many items as you want - - gray_stained_glass_pane # Item 1 - - black_stained_glass_pane # Item 2 - pattern: - - "222222222" - - "211010112" - - "201010102" - - "201010102" - - "201111102" - - "222222222" - rewards: # Where to put rewards in the GUI - - id: diamond_sword # The reward ID - row: 3 # The row - column: 2 # The column - - id: stack_of_emeralds - row: 4 - column: 2 - - id: bedrock - row: 3 - column: 2 - - id: 1000_coins - row: 5 - column: 2 -``` diff --git a/docs/ecoshop/how-to-make-a-category.md b/docs/ecoshop/how-to-make-a-category.md index 639ce9fecb..7fccffd419 100644 --- a/docs/ecoshop/how-to-make-a-category.md +++ b/docs/ecoshop/how-to-make-a-category.md @@ -99,7 +99,7 @@ items: ##### Pages -To configure a pattern and mask, read here for more info: +To configure a pattern and mask, read here for more info: [Pages](https://plugins.auxilor.io/all-plugins/pages) **custom-slots:** Any non-shop items for the GUI (eg. info items), read here for more info: [Custom GUI Slots](https://plugins.auxilor.io/all-plugins/custom-gui-slots). diff --git a/docs/ecoshop/how-to-make-a-shop.md b/docs/ecoshop/how-to-make-a-shop.md index 62908fa02f..6049cc34a3 100644 --- a/docs/ecoshop/how-to-make-a-shop.md +++ b/docs/ecoshop/how-to-make-a-shop.md @@ -125,7 +125,7 @@ There are two methods to add [categories](https://plugins.auxilor.io/ecoshop/how **rows:** How many rows are in the shop GUI. ##### Pages -To configure a pattern and mask, read here for more info: +To configure a pattern and mask, read here for more info: [Pages](https://plugins.auxilor.io/all-plugins/pages) ##### Categories **id:** The ID of the category (eg. `example.yml` has an ID of `example`)