diff --git a/docs/en/archived/baguette-of-wisdom.md b/docs/en/archived/baguette-of-wisdom.md index c169246..bd4c795 100644 --- a/docs/en/archived/baguette-of-wisdom.md +++ b/docs/en/archived/baguette-of-wisdom.md @@ -730,4 +730,4 @@ And that's it! [PlayerInteractEntityEvent]: https://jd.papermc.io/paper/1.21.8/org/bukkit/event/player/PlayerInteractEntityEvent.html [PylonItemEntityInteractor]: https://pylonmc.github.io/pylon-core/docs/javadoc/io/github/pylonmc/pylon/core/item/base/PylonItemEntityInteractor.html [Persistent data container]: https://docs.papermc.io/paper/dev/pdc/ -[PylonInteractor]: https://pylonmc.github.io/pylon-core/docs/javadoc/io/github/pylonmc/pylon/core/item/base/PylonInteractor.html +[PylonInteractor]: https://pylonmc.github.io/pylon-core/docs/javadoc/io/github/pylonmc/pylon/core/item/base/PylonInteractor.html \ No newline at end of file diff --git a/docs/en/creating-addons/tutorial-1.md b/docs/en/creating-addons/tutorial-1.md index ff8a65d..fb34e07 100644 --- a/docs/en/creating-addons/tutorial-1.md +++ b/docs/en/creating-addons/tutorial-1.md @@ -28,10 +28,10 @@ The second thing we need is an actual item. We'll use [ItemStackBuilder] for thi [ItemStackBuilder] contains several different methods to help you create [ItemStack]s. For example, you can use `.set(, )` to set some of the item's values, like enchantments, whether the item is unbreakable, and so on. -**Whenever you're creating a Rebar item, make sure you use `ItemStackBuilder.rebarItem(, )`.** There are others ways to create [ItemStack]s, but **do not** use these to create Rebar items. +**Whenever you're creating a Rebar item, make sure you use `ItemStackBuilder.rebar(, )`.** There are others ways to create [ItemStack]s, but **do not** use these to create Rebar items. -??? question "Why use `ItemStackBuilder.rebarItem`, and not any of the other ways to create an [ItemStack]?" - Under the hood, Rebar stores item keys in [PersistentDataContainer]s, or PDCs. When you call `ItemStackBuilder.rebarItem` and supply a key, that key is written to the item's PDC automatically. If you supply your own item stack, its PDC won't contain the item's key, and Rebar won't be able to differentiate that item with a regular Minecraft item. +??? question "Why use `ItemStackBuilder.rebar`, and not any of the other ways to create an [ItemStack]?" + Under the hood, Rebar stores item keys in [PersistentDataContainer]s, or PDCs. When you call `ItemStackBuilder.rebar` and supply a key, that key is written to the item's PDC automatically. If you supply your own item stack, its PDC won't contain the item's key, and Rebar won't be able to differentiate that item with a regular Minecraft item. [ItemStackBuilder] also sets the name and lore of the item to the default translation keys (which will be explained later in this tutorial). @@ -42,7 +42,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguette = ItemStackBuilder.rebarItem(Material.BREAD, baguetteKey) + public static final ItemStack baguette = ItemStackBuilder.rebar(Material.BREAD, baguetteKey) .set(DataComponentTypes.FOOD, FoodProperties.food().nutrition(6)) .build(); @@ -61,7 +61,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguette = ItemStackBuilder.rebarItem(Material.BREAD, baguetteKey) + public static final ItemStack baguette = ItemStackBuilder.rebar(Material.BREAD, baguetteKey) .set(DataComponentTypes.FOOD, FoodProperties.food().nutrition(6)) .build(); @@ -84,7 +84,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguette = ItemStackBuilder.rebarItem(Material.BREAD, baguetteKey) + public static final ItemStack baguette = ItemStackBuilder.rebar(Material.BREAD, baguetteKey) .set(DataComponentTypes.FOOD, FoodProperties.food().nutrition(6)) .build(); @@ -95,7 +95,7 @@ public final class ExampleAddonItems { // ... RebarItem.register(RebarItem.class, baguette); - BasePages.FOOD.addItem(baguetteKey); + PylonPages.FOOD.addItem(baguetteKey); } } ``` @@ -296,7 +296,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguette = ItemStackBuilder.rebarItem(Material.BREAD, baguetteKey) + public static final ItemStack baguette = ItemStackBuilder.rebar(Material.BREAD, baguetteKey) .set(DataComponentTypes.FOOD, FoodProperties.food().nutrition(6)) .build(); @@ -307,7 +307,7 @@ public final class ExampleAddonItems { // ... RebarItem.register(RebarItem.class, baguette); - BasePages.FOOD.addItem(baguetteKey); + PylonPages.FOOD.addItem(baguetteKey); } } ``` diff --git a/docs/en/creating-addons/tutorial-2.md b/docs/en/creating-addons/tutorial-2.md index 2d8b0fe..5b71247 100644 --- a/docs/en/creating-addons/tutorial-2.md +++ b/docs/en/creating-addons/tutorial-2.md @@ -21,7 +21,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguetteFlamethrower = ItemStackBuilder.rebarItem(Material.BREAD, baguetteFlamethrowerKey) + public static final ItemStack baguetteFlamethrower = ItemStackBuilder.rebar(Material.BREAD, baguetteFlamethrowerKey) .build(); // ... @@ -31,7 +31,7 @@ public final class ExampleAddonItems { // ... RebarItem.register(RebarItem.class, baguette); - BasePages.FOOD.addItem(baguetteKey); + PylonPages.FOOD.addItem(baguetteKey); } } ``` @@ -76,7 +76,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(40); } } @@ -133,7 +133,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(40); } } @@ -160,7 +160,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(burnTimeTicks); } } @@ -190,7 +190,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(burnTimeTicks); } } @@ -203,7 +203,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack baguetteFlamethrower = ItemStackBuilder.rebarItem(Material.BREAD, baguetteFlamethrowerKey) + public static final ItemStack baguetteFlamethrower = ItemStackBuilder.rebar(Material.BREAD, baguetteFlamethrowerKey) .build(); // ... @@ -213,7 +213,7 @@ public final class ExampleAddonItems { // ... RebarItem.register(RebarItem.class, baguette); - BasePages.FOOD.addItem(baguetteKey); + PylonPages.FOOD.addItem(baguetteKey); } } ``` diff --git a/docs/en/creating-addons/tutorial-3.md b/docs/en/creating-addons/tutorial-3.md index 869eb90..af5669c 100644 --- a/docs/en/creating-addons/tutorial-3.md +++ b/docs/en/creating-addons/tutorial-3.md @@ -115,7 +115,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(burnTimeTicks); } @@ -155,7 +155,7 @@ public class BaguetteFlamethrower extends RebarItem implements RebarItemEntityIn } @Override - public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { + public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { event.getRightClicked().setFireTicks(burnTimeTicks); } diff --git a/docs/en/creating-addons/tutorial-4.md b/docs/en/creating-addons/tutorial-4.md index 5a21592..9ae3334 100644 --- a/docs/en/creating-addons/tutorial-4.md +++ b/docs/en/creating-addons/tutorial-4.md @@ -53,7 +53,7 @@ public final class ExampleAddonItems { // ... - public static final ItemStack countingBaguette = ItemStackBuilder.pylonItem(Material.BREAD, countingBaguetteKey) + public static final ItemStack countingBaguette = ItemStackBuilder.rebar(Material.BREAD, countingBaguetteKey) .build(); // ... @@ -62,8 +62,8 @@ public final class ExampleAddonItems { // ... - PylonItem.register(CountingBaguette.class, countingBaguette); - BasePages.FOOD.addItem(countingBaguette); + RebarItem.register(CountingBaguette.class, countingBaguette); + PylonPages.FOOD.addItem(countingBaguette); } } ``` @@ -71,7 +71,7 @@ public final class ExampleAddonItems { ```java title="CountingBaguette.java" -public class CountingBaguette extends PylonItem { +public class CountingBaguette extends RebarItem { public CountingBaguette(@NotNull ItemStack stack) { super(stack); } @@ -90,13 +90,13 @@ item: First, we need to detect when the player right clicks: ```java title="CountingBaguette.java" hl_lines="1 6-10" -public class CountingBaguette extends PylonItem implements PylonInteractor { +public class CountingBaguette extends RebarItem implements RebarInteractor { public CountingBaguette(@NotNull ItemStack stack) { super(stack); } @Override - public void onUsedToRightClick(@NotNull PlayerInteractEvent event) { + public void onUsedToClick(@NotNull PlayerInteractEvent event, @NotNull EventPriority priority) { // TODO send stored value to player // TODO increment stored value } @@ -111,7 +111,7 @@ To store a piece of data in a persistent data container, we need two other thing For convenience, Pylon supplies a range of types in the [PylonSerializers] file. This includes all the default types provided by Paper, but also some extra types (like UUID, Vector, BlockPosition, ItemStack, and more). ```java title="CountingBaguette.java" hl_lines="2 10-12" -public class CountingBaguette extends PylonItem implements PylonInteractor { +public class CountingBaguette extends RebarItem implements RebarInteractor { public static final NamespacedKey COUNT_KEY = new NamespacedKey(MyAddon.getInstance(), "count"); public CountingBaguette(@NotNull ItemStack stack) { @@ -119,7 +119,7 @@ public class CountingBaguette extends PylonItem implements PylonInteractor { } @Override - public void onUsedToRightClick(@NotNull PlayerInteractEvent event) { + public void onUsedToClick(@NotNull PlayerInteractEvent event, @NotNull EventPriority priority) { int count = getStack().getPersistentDataContainer().get(COUNT_KEY, PylonSerializers.INTEGER); event.getPlayer().sendMessage(String.valueOf(count)); getStack().editPersistentDataContainer(pdc -> pdc.set(COUNT_KEY, PylonSerializers.INTEGER, count + 1)); @@ -133,11 +133,11 @@ You may have noticed that we have not set a starting value for the count yet. In ```java title="CountingBaguette.java" hl_lines="3" NamespacedKey countingBaguetteKey = new NamespacedKey(this, "counting_baguette"); -ItemStack countingBaguette = ItemStackBuilder.pylonItem(Material.BREAD, countingBaguetteKey) +ItemStack countingBaguette = ItemStackBuilder.rebar(Material.BREAD, countingBaguetteKey) .editPdc(pdc -> pdc.set(CountingBaguette.COUNT_KEY, PylonSerializers.INTEGER, 0)) .build(); -PylonItem.register(CountingBaguette.class, countingBaguette); -BasePages.FOOD.addItem(countingBaguette); +RebarItem.register(CountingBaguette.class, countingBaguette); +PylonPages.FOOD.addItem(countingBaguette); ``` And that's it! The data we stored will persist as long as the item exists. diff --git a/docs/en/documentation/contributing/getting-started.md b/docs/en/documentation/contributing/getting-started.md index 2541cab..b3f2bd1 100644 --- a/docs/en/documentation/contributing/getting-started.md +++ b/docs/en/documentation/contributing/getting-started.md @@ -1,26 +1,26 @@ # Getting started -Pylon Core is written in [Kotlin](https://kotlinlang.org/), a language similar to Java, but with more modern features and concise syntax. If you know Java, you'll be able to pick up Kotlin very quickly. +Rebar is written in [Kotlin](https://kotlinlang.org/), a language similar to Java, but with more modern features and concise syntax. If you know Java, you'll be able to pick up Kotlin very quickly. -Pylon Base is written in Java. +Pylon is written in Java. ## How to get started -1. Clone the `pylon` repository: `git clone https://github.com/pylonmc/pylon` (or use a GUI like Github Desktop) -2. If you're using IntelliJ, it'll set everything up automatically. If not, run `./gradlew`. This will clone the `pylon-core` and `pylon-base` repositories. -3. If you want to submit your changes to the Pylon project, **delete the `pylon-core` or `pylon-base` directory (depending on which one you want to contribute to), fork the pylon-core or pylon-base repository, and clone your fork into the same directory.** Otherwise, you won't be able to open a pull request with your changes (unless you're a Pylon developer and have access to the Pylon repositories). +1. Clone the `parallel-dev-repo` repository: `git clone https://github.com/pylonmc/parallel-dev-repo` (or use a GUI like Github Desktop) +2. If you're using IntelliJ, it'll set everything up automatically. If not, run `./gradlew`. This will clone the `rebar` and `pylon` repositories. +3. If you want to submit your changes to the master project, **delete the `rebar` or `pylon` directory (depending on which one you want to contribute to), fork the rebar or pylon repository, and clone your fork into the same directory.** Otherwise, you won't be able to open a pull request with your changes (unless you're a Rebar/Pylon developer and have access to the Rebar/Pylon repositories). -See the [Pylon Master Project](master-project.md) page for more information about the master repository. +See the [The Parallel Dev Repo Project](master-project.md) page for more information about the master repository. ## Submitting your contributions -We generally welcome contributions for both Core and Base, but it's best check with the Pylon team before making any major changes, because we might already have something planned out that won't fit well with your changes. Hop on our Discord server and have a chat with us if you're interested in doing anything major, or have any questions about contributing :) +We generally welcome contributions for both Rebar and Pylon, but it's best check with the Pylon team before making any major changes, because we might already have something planned out that won't fit well with your changes. Hop on our Discord server and have a chat with us if you're interested in doing anything major, or have any questions about contributing :) Once you're done with your changes, open a pull request and give some information about what you did and why you did it. ## Tests -Pylon Core has a set of integration tests. Tests should only be added for critical functionality such as block storage and recipes. +Rebar has a set of integration tests. Tests should only be added for critical functionality such as block storage and recipes. ## Custom Dokka @@ -29,7 +29,7 @@ Pylon uses a custom version of Dokka to generate Javadocs. This is because the d 1. Clone the `pylonmc/dokka` repository: `git clone https://github.com/pylonmc/dokka` 2. Checkout the `pylon` branch: `git checkout pylon` 3. In the root directory, execute `./gradlew publishToMavenLocal -Pversion=2.1.0-pylon-SNAPSHOT`. Note that as Dokka is a very large project, the first build will take a long time. On Seggan's decent-ish laptop, the first run took about 10 minutes. Subsequent builds will be much faster as long s you don't delete the build cache. -4. Now, in the Pylon master project, execute `./gradlew :pylon-core:pylon-core:dokkaGenerate -PusePylonDokka=true`. The generated output will be under `pylon/pylon-core/pylon-core/build/dokka`. +4. Now, in the Pylon master project, execute `./gradlew :rebar:rebar:dokkaGenerate -PusePylonDokka=true`. The generated output will be under `pylon/rebar/rebar/build/dokka`. ## I'm stuck, what next? diff --git a/docs/en/documentation/contributing/master-project.md b/docs/en/documentation/contributing/master-project.md index d3b2560..43b112d 100644 --- a/docs/en/documentation/contributing/master-project.md +++ b/docs/en/documentation/contributing/master-project.md @@ -1,28 +1,29 @@ -# The Pylon Master Project +# The Parallel Dev Repo Project -Pylon has a master repository that contains both `pylon-core` and `pylon-base`. This allows you to run base using your very own home-baked version of core, which allows you to test new features much more easily. This is what the 'How to get started' section used. We recommend you make changes to both Base and Core using the master repository, and the rest of this guide will assume you're using it. +PylonMC has a repositry called: `parallel-dev-repo`. This allows you to run base using your very own home-baked version of core, which allows you to test new features much more easily. This is what the 'How to get started' section used. We recommend you make changes to both Pylon and Rebar using the repository, and the rest of this guide will assume you're using it. ## Project structure -The master project is structured as such: +The project is structured as such: ``` pylon/ - pylon-base/ - pylon-core/ - dokka-plugin/ - nms/ - pylon-core/ - test/ + src/ +rebar/ + dokka-plugin/ + nms/ + rebar/ + test/ ``` -`pylon-base` contains the Base addon for Pylon. `pylon-core` has four subprojects: `dokka-plugin`, `nms`, `pylon-core`, and `test`. `dokka-plugin` contains a custom Dokka plugin we use to help with formatting Javadocs. `nms` contains all the Pylon Core code that touches server internals. It is in a separate subproject to effectively isolate potentially unstable code from the rest of the project. `pylon-core` contains the main Pylon Core code, and `test` contains the integration tests for Pylon Core. + +`pylon` is the base addon for Rebar. `rebar` has four subprojects: `dokka-plugin`, `nms`, `rebar`, and `test`. `dokka-plugin` contains a custom Dokka plugin we use to help with formatting Javadocs. `nms` contains all the Rebar code that touches server internals. It is in a separate subproject to effectively isolate potentially unstable code from the rest of the project. `rebar` contains the main Rebar code, and `test` contains the integration tests for Rebar. ## Tasks The Pylon master project contains a few tasks that are useful for development: | Task | Alias | Description | |------------------------------|---------------------|------------------------------------------------------------------------------------------------------------| -| `runServer` | `runSnapshotServer` | Runs a Minecraft server with the current version of Pylon Base and Pylon Core | -| `:pylon-base:runServer` | `runStableServer` | Runs a Minecraft server with the latest stable version of Pylon Core and the current version of Pylon Base | -| `:pylon-core:test:runServer` | `runLiveTests` | Executes the integration tests for Pylon Core | +| `runServer` | `runSnapshotServer` | Runs a Minecraft server with the current version of Rebar and Pylon | +| `:pylon:runServer` | `runStableServer` | Runs a Minecraft server with the latest stable version of Rebar and the current version of Pylon | +| `:rebar:test:runServer` | `runLiveTests` | Executes the integration tests for Rebar | !!! danger If you are launching the tasks using the aliases from IntelliJ and attach the debugger, you will notice that it will not work. I have no idea why this happens. In order to successfully attach the debugger, you need to run the actual tasks, not the aliases. For example, instead of running `runSnapshotServer`, run `runServer`. \ No newline at end of file diff --git a/docs/en/documentation/reference/blocks/creating-new-blocks.md b/docs/en/documentation/reference/blocks/creating-new-blocks.md index 993fc0e..7baf76a 100644 --- a/docs/en/documentation/reference/blocks/creating-new-blocks.md +++ b/docs/en/documentation/reference/blocks/creating-new-blocks.md @@ -6,7 +6,7 @@ Adding a custom block requires 3 things: - A block class - A `NamespacedKey` that identifies your block -- A corresponding `PylonItem` (Not strictly needed, but recommended so players can place your block) +- A corresponding `RebarItem` (Not strictly needed, but recommended so players can place your block) ## Block classes