Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Improve performance #18

Open
Rushmead opened this issue Feb 14, 2021 · 2 comments
Open

Improve performance #18

Rushmead opened this issue Feb 14, 2021 · 2 comments
Labels
enhancement New feature or request feedback-wanted Feedback wanted

Comments

@Rushmead
Copy link
Member

Currently the way that lights work is that every x amount of ticks it raytraces using the current pan / tilt to calculate the position for the light block to be placed.

It does this regardless of whether or not the light is powered or whether not it has actually moved. This should be changed so that it is only ray-tracing when powered and when there is a neighbouring block update to the illuminator block.

The light block (Illuminator) is also a ticking TileEntity, originally so that it can detect if the fixture creating the light has been destroyed. This is bad and could potentially cause performance problems. A solution is to have the block "decay" using block state and block updates, if the "decay" is 0, the block destroys itself. The fixture emitting the light should regularly update this "decay" value in order for the light to stay.

@Rushmead Rushmead added feedback-wanted Feedback wanted enhancement New feature or request labels Feb 14, 2021
@Rushmead
Copy link
Member Author

I have done the initial pass of this, see a7cdb87, however I can see some potential issues with this.

@FreneticScribbler
Copy link
Collaborator

Course, the biggest performance monster is likely all the lighting updates the illuminators generate, unless modern MC has fixed that being a lagfest?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feedback-wanted Feedback wanted
Projects
None yet
Development

No branches or pull requests

2 participants