Relight using starlight engine on Tuinity & perform heightmap updates (#1023)

* Relight using starlight engine on Tuinity

* Make use of invokeExact

* Cache MethodHandle

* Address some requested changes

* Remove random *

Co-authored-by: NotMyFault <mc.cache@web.de>

* Simplify and clean up sendChunk
Hopefully, that doesn't cause any issues

* Add naive HeightmapProcessor

* Make HeightmapProcessor more efficient

* Remove heightmap code from NMSRelighter

* Recognize fluid for waterlogged blocks

* Remove config option for heightmaps as they should always be updated

* Batch relighting for Starlight

* Dirty workaround for CharBlocks blocks NPE

* Revert "Dirty workaround for CharBlocks blocks NPE"

This reverts commit 737606a7
It only caused the heightmap to be wrong again and didn't help much with the original issue

* Adapt better chunk sending on older versions

* Adapt requested changes for HeightMapType

* Relight all changed chunks, batched
Also, address some requested changes

* Avoid deadlocks

* Clean up tuinity relighter and add some comments

* Minor changes to HeightmapProcessor

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: NotMyFault <mc.cache@web.de>
Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com>
This commit is contained in:
Hannes Greule
2021-05-13 17:29:11 +02:00
committed by GitHub
parent 46f1882496
commit ff728478c6
20 changed files with 653 additions and 263 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.platform;
import com.boydti.fawe.beta.implementation.lighting.RelighterFactory;
import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.internal.util.NonAbstractForCompatibility;
@ -29,6 +30,7 @@ import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.registry.Registries;
import org.enginehub.piston.CommandManager;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Locale;
@ -206,4 +208,13 @@ public interface Platform extends Keyed {
* @return A set of supported side effects
*/
Set<SideEffect> getSupportedSideEffects();
/**
* Get the {@link RelighterFactory} that can be used to obtain
* {@link com.boydti.fawe.beta.implementation.lighting.Relighter}s.
*
* @return the relighter factory to be used.
*/
@NotNull
RelighterFactory getRelighterFactory();
}

View File

@ -123,7 +123,9 @@ public final class BlockCategories {
public static BlockCategory get(String id) {
BlockCategory entry = BlockCategory.REGISTRY.get(id);
if (entry == null) {
return new BlockCategory(id);
BlockCategory blockCategory = new BlockCategory(id);
blockCategory.load();
return blockCategory;
}
return entry;
}