mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-14 12:11:27 +01:00
Add potion constructor without flags, style
This commit is contained in:
parent
064146b4fd
commit
74e00bc70c
@ -8,8 +8,8 @@ import net.minestom.server.utils.binary.BinaryWriter;
|
||||
import net.minestom.server.utils.binary.Writeable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public record Potion(PotionEffect effect, byte amplifier, int duration, byte flags)
|
||||
implements Writeable {
|
||||
public record Potion(@NotNull PotionEffect effect, byte amplifier,
|
||||
int duration, byte flags) implements Writeable {
|
||||
/**
|
||||
* A flag indicating that this Potion is ambient (it came from a beacon).
|
||||
*
|
||||
@ -37,6 +37,10 @@ public record Potion(PotionEffect effect, byte amplifier, int duration, byte fla
|
||||
*/
|
||||
public static final byte ICON_FLAG = 0x04;
|
||||
|
||||
public Potion(@NotNull PotionEffect effect, byte amplifier, int duration) {
|
||||
this(effect, amplifier, duration, (byte) 0);
|
||||
}
|
||||
|
||||
public Potion(BinaryReader reader) {
|
||||
this(PotionEffect.fromId(reader.readVarInt()), reader.readByte(),
|
||||
reader.readVarInt(), reader.readByte());
|
||||
@ -56,6 +60,7 @@ public record Potion(PotionEffect effect, byte amplifier, int duration, byte fla
|
||||
|
||||
/**
|
||||
* Returns whether this Potion is ambient (it came from a beacon) or not.
|
||||
*
|
||||
* @return <code>true</code> if the Potion is ambient
|
||||
*/
|
||||
public boolean isAmbient() {
|
||||
@ -64,6 +69,7 @@ public record Potion(PotionEffect effect, byte amplifier, int duration, byte fla
|
||||
|
||||
/**
|
||||
* Returns whether this Potion has particles or not.
|
||||
*
|
||||
* @return <code>true</code> if the Potion has particles
|
||||
*/
|
||||
public boolean hasParticles() {
|
||||
@ -72,6 +78,7 @@ public record Potion(PotionEffect effect, byte amplifier, int duration, byte fla
|
||||
|
||||
/**
|
||||
* Returns whether this Potion has an icon or not.
|
||||
*
|
||||
* @return <code>true</code> if the Potion has an icon
|
||||
*/
|
||||
public boolean hasIcon() {
|
||||
|
Loading…
Reference in New Issue
Block a user