-
Notifications
You must be signed in to change notification settings - Fork 4
Update usages #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update usages #32
Changes from all commits
13f8e60
d847a2d
e55e9dd
fbf6419
e657113
2fb61a9
9945c0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
| } | ||
|
Comment on lines
78
to
81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this code would need the @MultiHandler annotation to work, eg @MultiHandler(priorities = { EventPriority.NORMAL, EventPriority.MONITOR }). Should do any checks / cancelling at normal, setting stuff like fire ticks at monitor.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See this example from the watering can:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure this annotation is not needed...?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not for this one since they only need one priority, but if they're adding the event priority it is (at least I'm pretty sure)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
@@ -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) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing |
||
| 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); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
lijinhong11 marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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`. |
Uh oh!
There was an error while loading. Please reload this page.