Skip to content

Plugin node#109

Open
rilendorf wants to merge 10 commits intoHimbeerserverDE:mainfrom
ev2-1:plugin_node
Open

Plugin node#109
rilendorf wants to merge 10 commits intoHimbeerserverDE:mainfrom
ev2-1:plugin_node

Conversation

@rilendorf
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.

@rilendorf rilendorf marked this pull request as ready for review May 25, 2022 21:19
@rilendorf rilendorf requested a review from HimbeerserverDE May 25, 2022 21:19
@rilendorf
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)

@rilendorf rilendorf 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