Skip to content
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

Path command extension #96

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Path command extension #96

wants to merge 11 commits into from

Conversation

Zacrain
Copy link
Contributor

@Zacrain Zacrain commented May 26, 2022

Hi samolego!

I've extended the path command with a few useful features which ease access for users who want to change the path easily via commands and not in an interactive manner. (For example I use this for automatic and dynamic changes of my Taterzen NPCs ingame.)

It is actually possible to mix both editing modes, i.e. you can enter the interactive editor and still use only commands for editing, but will get visual feedback (e.g. you add a node via commandline and the redstone block appears in the world accordingly).

I have also extended the documentation accordingly. See docs/getting_started/path.md.

Best regards

Zacrain

@@ -25,6 +25,11 @@ public BlockInteractEventImpl() {
*/
@Override
public InteractionResult interact(Player player, Level world, InteractionHand hand, BlockHitResult blockHitResult) {
return BlockEvent.onBlockInteract(player, world, blockHitResult.getBlockPos());
// check in if clause prevents crash (check for server side) on clients
// and prevents executing event handler twice (check for main hand)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor clarification: as player's npc will be null on client, it won't crash (at least it shouldn't :) ).

However, it will still double trigger (& it's clearer to check the side than relying on nulls).

@samolego
Copy link
Owner

Hi, thanks again!
Could you specify only the new commits to be merged though? There are still old ones from the #93 listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants