|
1 | | -**New API** |
| 1 | +## How to update |
2 | 2 |
|
3 | | -**New Storage System** |
| 3 | +v3 is basically a complete rewrite of the plugin. |
| 4 | +It is not compatible with v2 and earlier versions. |
| 5 | +Not everything will be migrated automatically, so you will have to do some manual work. |
4 | 6 |
|
5 | | -**Traits** |
6 | | -Built-in traits: |
| 7 | +Things that will be migrated automatically: |
| 8 | +- Hologram data (holograms.yml) |
| 9 | + |
| 10 | +Things that will **not** be migrated automatically: |
| 11 | +- All configurations from config.yml |
| 12 | +- All configurations from featureFlags.yml |
| 13 | + |
| 14 | +The API has changed significantly, so you will have to update your code accordingly. |
| 15 | +Read more about the new API [here](#new-api). |
| 16 | + |
| 17 | +## New Commands |
| 18 | + |
| 19 | +## New Storage System |
| 20 | + |
| 21 | +The storage system has been completely rewritten. |
| 22 | +It now uses a more efficient and flexible system that allows for better performance and easier management of holograms. |
| 23 | + |
| 24 | +The file format is now JSON instead of YAML, which allows for better compatibility with other systems and easier parsing. |
| 25 | + |
| 26 | +Many of you are annoyed by the fact that the hologram data was stored in a single file (`holograms.yml`). |
| 27 | +If you had a lot of holograms, this file could become huge and difficult to manage. |
| 28 | +This has been changed in v3. |
| 29 | + |
| 30 | +The hologram data is no longer stored in a single file, but in multiple files. |
| 31 | +The new place for hologram data is in the `plugins/FancyHolograms/data/holograms/` folder. |
| 32 | +In this folder, you can create subfolders to organize your holograms. |
| 33 | +Every JSON file in this folder will be loaded (recursively). |
| 34 | +Each JSON file can contain multiple holograms, which allows for better organization and management of holograms. |
| 35 | + |
| 36 | +Example folder structure: |
| 37 | + |
| 38 | +- `plugins/FancyHolograms/data/holograms/` |
| 39 | + - `rules-hologram.json` |
| 40 | + - `info-hologram.json` |
| 41 | + - `spawn-holograms/` |
| 42 | + - `shop-holograms.json` |
| 43 | + - `quest-holograms.json` |
| 44 | + - `crates/` |
| 45 | + - `crate1.json` |
| 46 | + - `crate2.json` |
| 47 | + - `crate3.json` |
| 48 | + - `event-holograms/` |
| 49 | + - `event1.json` |
| 50 | + - `event2.json` |
| 51 | + - `event3.json` |
| 52 | + |
| 53 | +Looking at one JSON file, it will look like this: |
| 54 | + |
| 55 | +```json |
| 56 | +[ |
| 57 | + { |
| 58 | + first hologram ... |
| 59 | + }, |
| 60 | + { |
| 61 | + second hologram ... |
| 62 | + } |
| 63 | +] |
| 64 | +``` |
| 65 | + |
| 66 | +With each hologram containing the following "components": |
| 67 | + |
| 68 | +```json |
| 69 | +{ |
| 70 | + "hologram_data": { ... }, |
| 71 | + "display_data": { ... }, |
| 72 | + "text_data": { ... }, |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +If the hologram is a block or item hologram, it will have the `block_data` or `item_data` component instead of `text_data`. |
| 77 | + |
| 78 | +The `hologram_data` component contains the basic information about the hologram, such as its name, location and visibility. |
| 79 | +The `display_data` component contains the display settings for the hologram, such as its scale, shadow and billboard. |
| 80 | +The `text_data` component contains the text settings for the hologram, such as the text itself, text alignment and background color. |
| 81 | + |
| 82 | +## New Configuration |
| 83 | + |
| 84 | +**Disclaimer:** all configuration options do not migrate automatically. You will have to update your configuration files manually. |
| 85 | + |
| 86 | +## New API |
| 87 | + |
| 88 | +## Traits |
| 89 | + |
| 90 | +Traits are a new feature in v3 that allow you to extend the functionality of holograms. |
| 91 | +A trait is basically a plugin that can be added to a hologram to add new features or functionality. |
| 92 | +Traits have access to the hologram's data and lifecycle, allowing them to modify the hologram's behavior or appearance. |
| 93 | +Each trait can have its own configuration and can be enabled or disabled individually. |
| 94 | + |
| 95 | +There are several built-in traits that come with FancyHolograms v3: |
7 | 96 |
|
8 | | -- `trait_trait`: Manages the hologram's traits (default) |
9 | 97 | - `multiple_pages_trait`: Allows you to create multiple pages in a hologram |
| 98 | +- `interaction_trait`: Allows you to make clickable holograms (using FancyNpcs) |
10 | 99 | - `file_content_trait`: Allows you to display the content of a file in a hologram |
11 | | -- `interaction_trait`: Allows you to make clickable holograms |
| 100 | + |
| 101 | +You can also create your own traits by extending the `HologramTrait` class. |
| 102 | +View the Javadocs for more information about how the `HologramTrait` class is structured. |
| 103 | +You can override all the `on` methods, as well as the `load` and `save` methods. |
0 commit comments