mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 23:51:36 +01:00
Add javadocs for Potion (#1763)
This commit is contained in:
parent
aebf72de90
commit
a9e319f961
@ -11,6 +11,14 @@ import java.util.Objects;
|
|||||||
import static net.minestom.server.network.NetworkBuffer.BYTE;
|
import static net.minestom.server.network.NetworkBuffer.BYTE;
|
||||||
import static net.minestom.server.network.NetworkBuffer.VAR_INT;
|
import static net.minestom.server.network.NetworkBuffer.VAR_INT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a potion effect that can be added to an {@link net.minestom.server.entity.Entity}.
|
||||||
|
*
|
||||||
|
* @param effect the potion effect
|
||||||
|
* @param amplifier the amplifier starting at 0 (level 1)
|
||||||
|
* @param duration the duration (in ticks) that the potion will last
|
||||||
|
* @param flags the flags of the potion, see {@link #flags()}
|
||||||
|
*/
|
||||||
public record Potion(@NotNull PotionEffect effect, byte amplifier,
|
public record Potion(@NotNull PotionEffect effect, byte amplifier,
|
||||||
int duration, byte flags) implements NetworkBuffer.Writer {
|
int duration, byte flags) implements NetworkBuffer.Writer {
|
||||||
/**
|
/**
|
||||||
@ -40,6 +48,11 @@ public record Potion(@NotNull PotionEffect effect, byte amplifier,
|
|||||||
*/
|
*/
|
||||||
public static final byte ICON_FLAG = 0x04;
|
public static final byte ICON_FLAG = 0x04;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new Potion with no flags.
|
||||||
|
*
|
||||||
|
* @see #Potion(PotionEffect, byte, int, byte)
|
||||||
|
*/
|
||||||
public Potion(@NotNull PotionEffect effect, byte amplifier, int duration) {
|
public Potion(@NotNull PotionEffect effect, byte amplifier, int duration) {
|
||||||
this(effect, amplifier, duration, (byte) 0);
|
this(effect, amplifier, duration, (byte) 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user