All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spongepowered.api.entity.living.animal.Cat Maven / Gradle / Ivy

The newest version!
/*
 * This file is part of SpongeAPI, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered 
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.api.entity.living.animal;

import org.spongepowered.api.data.Keys;
import org.spongepowered.api.data.type.CatType;
import org.spongepowered.api.data.type.DyeColor;
import org.spongepowered.api.data.value.Value;
import org.spongepowered.api.entity.living.monster.Phantom;

import java.util.Optional;

/**
 * Represents a Cat, meow.
 */
public interface Cat extends TameableAnimal {

    /**
     * {@link Keys#CAT_TYPE}
     *
     * @return The type of cat
     * @see org.spongepowered.api.data.type.CatTypes
     */
    default Value.Mutable catType() {
        return this.requireValue(Keys.CAT_TYPE).asMutable();
    }

    /**
     * {@link Keys#IS_LYING_DOWN}
     *
     * 

In vanilla, a cat lies down near its owner when the owner goes to * sleep.

* * @return Whether this cat is lying down */ default Value.Mutable lyingDown() { return this.requireValue(Keys.IS_LYING_DOWN).asMutable(); } /** * {@link Keys#IS_RELAXED} * *

In vanilla, a cat relaxes before lying down.

* * @return Whether this cat is relaxed */ default Value.Mutable relaxed() { return this.requireValue(Keys.IS_RELAXED).asMutable(); } /** * {@link Keys#DYE_COLOR} * * @return The collar color */ default Value.Mutable collarColor() { return this.requireValue(Keys.DYE_COLOR).asMutable(); } /** * {@link Keys#IS_PURRING} * *

In vanilla, a cat purrs every so many ticks when lying down or relaxed. * Otherwise it will also pur if it is currently breeding.

* * @return Whether this cat is purring */ default Value.Mutable purring() { return this.requireValue(Keys.IS_PURRING).asMutable(); } /** * {@link Keys#IS_BEGGING_FOR_FOOD} * *

In vanilla, a cat begs for food every so many ticks * if {@link TameableAnimal#owner()} returns {@link Optional#isPresent()}.

* * @return Whether this cat is purring */ default Value.Mutable beggingForFood() { return this.requireValue(Keys.IS_BEGGING_FOR_FOOD).asMutable(); } /** * {@link Keys#IS_HISSING} * *

In vanilla, a cat hisses when a {@link Phantom} is detected near it.

* * @return Whether this cat is hissing */ default Value.Mutable hissing() { return this.requireValue(Keys.IS_HISSING).asMutable(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy