Added comments to facilitate custom implementation of Instance

This commit is contained in:
themode 2020-10-24 20:11:26 +02:00
parent bd8df8bd5e
commit b511c12129
2 changed files with 9 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import net.minestom.server.network.packet.server.play.BossBarPacket;
import net.minestom.server.utils.MathUtils;
import net.minestom.server.utils.validate.Check;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
@ -51,6 +52,7 @@ public class BossBar implements Viewable {
* @param player the player to check the boss bars
* @return all the visible boss bars of the player, null if not any
*/
@Nullable
public static Set<BossBar> getBossBars(@NotNull Player player) {
return PLAYER_BOSSBAR_MAP.getOrDefault(player, null);
}

View File

@ -253,7 +253,10 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
* Used when a {@link Chunk} is not currently loaded in memory and need to be retrieved from somewhere else.
* Could be read from disk, or generated from scratch.
* <p>
* WARNING: it has to retrieve a chunk, this is not optional.
* Be sure to signal the chunk using {@link UpdateManager#signalChunkLoad(Instance, int, int)} and to cache
* that this chunk has been loaded.
* <p>
* WARNING: it has to retrieve a chunk, this is not optional and should execute the callback in all case.
*
* @param chunkX the chunk X
* @param chunkZ the chunk X
@ -264,6 +267,9 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
/**
* Called to generated a new {@link Chunk} from scratch.
* <p>
* Be sure to signal the chunk using {@link UpdateManager#signalChunkLoad(Instance, int, int)} and to cache
* that this chunk has been loaded.
* <p>
* This is where you can put your chunk generation code.
*
* @param chunkX the chunk X