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

Plugin node #109

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Plugin node #109

wants to merge 10 commits into from

Conversation

DerZombiiie
Copy link
Collaborator

Pluginapi to overwrite node interactions
Use cases: obvious

Please keep in mind that this is not finished yet, I just want to have it as a PR to discuss

@HimbeerserverDE HimbeerserverDE marked this pull request as draft May 18, 2022 04:58
@HimbeerserverDE
Copy link
Owner

Mark it as ready for review when you're done.

@DerZombiiie DerZombiiie marked this pull request as ready for review May 25, 2022 21:19
@DerZombiiie
Copy link
Collaborator Author

This aims to overwrite node interaction for specific nodes, specified by Itemstring.

This is done by...

  • implementing a BlkData Handler to handle ToCltBlkData packets using RegisterBlkDataHandler
  • implementing a itemstring -> nodeid / param0 cache for specific nodes (RegisterCacheNode)
  • and then by handling interact packages and checking if the node interacted with is registered by some NodeHandler.

Some other functions that are a thing:

  • GetMapCache which returns a copy of the map cache (map[[3]int16][4096]mt.Content)
  • IsCached which returns true, if a node is cached
  • RegisterCachedNode which tells the ms to save when the specified itemstring is defined
  • GetNodeId which returns all nodeid's corresponding to a cached itemstring (map[mt.Content]bool)

@DerZombiiie DerZombiiie added the plugin The issue is related to the plugin loader or API label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin The issue is related to the plugin loader or API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants