Info related to chunk load/unload signal, required to create an instance implementation

This commit is contained in:
themode 2020-10-13 04:31:03 +02:00
parent f1dccfacc3
commit f62117dbe0
2 changed files with 16 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import net.minestom.server.chat.ColoredText;
import net.minestom.server.entity.EntityManager;
import net.minestom.server.entity.Player;
import net.minestom.server.instance.Instance;
import net.minestom.server.instance.InstanceManager;
import net.minestom.server.network.ConnectionManager;
import net.minestom.server.network.packet.server.play.KeepAlivePacket;
import net.minestom.server.thread.PerGroupChunkProvider;
@ -134,6 +135,8 @@ public final class UpdateManager {
/**
* Signal the {@link ThreadProvider} that an instance has been created.
* <p>
* WARNING: should be automatically done by the {@link InstanceManager}.
*
* @param instance the instance
*/
@ -145,6 +148,8 @@ public final class UpdateManager {
/**
* Signal the {@link ThreadProvider} that an instance has been deleted.
* <p>
* WARNING: should be automatically done by the {@link InstanceManager}.
*
* @param instance the instance
*/
@ -155,7 +160,9 @@ public final class UpdateManager {
}
/**
* Signal the {@link ThreadProvider} that a chunk has been loaded
* Signal the {@link ThreadProvider} that a chunk has been loaded.
* <p>
* WARNING: should be automatically done by the {@link Instance} implementation.
*
* @param instance the instance of the chunk
* @param chunkX the chunk X
@ -168,7 +175,9 @@ public final class UpdateManager {
}
/**
* Signal the {@link ThreadProvider} that a chunk has been unloaded
* Signal the {@link ThreadProvider} that a chunk has been unloaded.
* <p>
* WARNING: should be automatically done by the {@link Instance} implementation.
*
* @param instance the instance of the chunk
* @param chunkX the chunk X

View File

@ -41,7 +41,11 @@ import java.util.function.Consumer;
* Instances are what are called "worlds" in Minecraft
* <p>
* An instance has entities and chunks, each instance contains its own entity list but the
* chunk implementation has to be defined, see {@link InstanceContainer}
* chunk implementation has to be defined, see {@link InstanceContainer}.
* <p>
* WARNING: when making your own implementation, for chunks and entities within it,
* you need to be sure to signal the {@link UpdateManager} of the changes using
* {@link UpdateManager#signalChunkLoad(Instance, int, int)} and {@link UpdateManager#signalChunkUnload(Instance, int, int)}.
*/
public abstract class Instance implements BlockModifier, EventHandler, DataContainer {