Conversation
| @Override | ||
| public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { | ||
| public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { | ||
| event.getRightClicked().setFireTicks(40); | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
See this example from the watering can:
@Override @MultiHandler(priorities = { EventPriority.NORMAL, EventPriority.MONITOR })
public void onUsedToClickBlock(@NotNull PlayerInteractEvent event, @NotNull EventPriority priority) {
if (!event.getAction().isRightClick() || event.useItemInHand() == Event.Result.DENY) {
return;
}
if (priority == EventPriority.NORMAL) {
event.setUseInteractedBlock(Event.Result.DENY);
return;
}
water(event.getClickedBlock().getRelative(BlockFace.UP), settings);
}
There was a problem hiding this comment.
I'm pretty sure this annotation is not needed...?
There was a problem hiding this comment.
I'm pretty sure this annotation is not needed...?
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)
There was a problem hiding this comment.
|
|
||
| @Override | ||
| public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event) { | ||
| public void onUsedToRightClickEntity(@NotNull PlayerInteractEntityEvent event, @NotNull EventPriority priority) { |
|
|
||
| ## How to get started | ||
|
|
||
| 1. Clone the `pylon` repository: `git clone https://github.com/pylonmc/pylon` (or use a GUI like Github Desktop) |
There was a problem hiding this comment.
This needs to be changed to parallel-dev-repo
One of the first questions will be 'how do I add my item to the guide.' I do not see the logic behind this |
Make a tutorial for that. but the idea is that I can copy paste the example into a new project and it will compile, and if we have PylonPages in there it won't |
Why would it not work in a new project because of PylonPages? The template includes Pylon as a dependency by default. The idea isn't 'that I can copy paste the example into a new project and it will compile' - most examples in the docs do not follow this at all. (Is this is implied somewhere? If so should be changed). The examples are mostly just to communicate ideas |
|
To clarify - sorry thought you were talking about the reference as you said to 'make a tutorial' then reread the above so disregard the 'the idea isn't...' part. But still should definitely compile with the template |
Some usages still not be changed or required to rewrite.