Skip to content

Advices on one-way glass #1

Description

@m1919810

I've seen your idea about one-way glass and I was curious about your impl
Now I'm here to give you some advice

  1. check the surrounding 32x32x32 blockType is absolutely expensive, you can check the slimefun BlockStorage (Slimefun official version use a map from loc to Config to record slimefun data, but I'm developing in CN version and we use chunkdata and block data, it's easier to check surrounding sf blocks)
  2. you can cache the location of all one-way glass , when update block, compare the cached locations and the player's location instead of searching blocks around player
  3. you can run this logic in block ticker, updating the surrounding player's blockType every 0.5s instead of listening playerMove, listening to playerMove is a costly behaviour because player move every gt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions