net.minestom.server.condition.DataPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.condition;
import net.kyori.adventure.nbt.BinaryTag;
import net.minestom.server.utils.nbt.BinaryTagSerializer;
import org.jetbrains.annotations.NotNull;
public interface DataPredicate {
record Noop(BinaryTag content) implements DataPredicate {
}
public static final BinaryTagSerializer NBT_TYPE = new BinaryTagSerializer() {
@Override
public @NotNull BinaryTag write(@NotNull DataPredicate value) {
return ((Noop) value).content;
}
@Override
public @NotNull DataPredicate read(@NotNull BinaryTag tag) {
return new Noop(tag);
}
};
}