Skip to content

Commit

Permalink
SQUAWK (Add Parrot)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashike authored and stephan-gh committed Jun 9, 2017
1 parent 685c0d7 commit acb44bc
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -134,6 +134,7 @@ sortClassFields {
add 'main', 'org.spongepowered.api.data.type.LogAxes'
add 'main', 'org.spongepowered.api.data.type.NotePitches'
add 'main', 'org.spongepowered.api.data.type.OcelotTypes'
add 'main', 'org.spongepowered.api.data.type.ParrotVariants'
add 'main', 'org.spongepowered.api.data.type.PickupRules'
add 'main', 'org.spongepowered.api.data.type.PistonTypes'
add 'main', 'org.spongepowered.api.data.type.PlantTypes'
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/spongepowered/api/CatalogTypes.java
Expand Up @@ -213,6 +213,8 @@ public final class CatalogTypes {

public static final Class<OcelotType> OCELOT_TYPE = OcelotType.class;

public static final Class<ParrotVariant> PARROT_VARIANT = ParrotVariant.class;

public static final Class<ParticleOption> PARTICLE_OPTION = ParticleOption.class;

public static final Class<ParticleType> PARTICLE_TYPE = ParticleType.class;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/spongepowered/api/data/key/Keys.java
Expand Up @@ -57,6 +57,7 @@
import org.spongepowered.api.entity.living.animal.Horse;
import org.spongepowered.api.entity.living.animal.Llama;
import org.spongepowered.api.entity.living.animal.Mule;
import org.spongepowered.api.entity.living.animal.Parrot;
import org.spongepowered.api.entity.living.animal.RideableHorse;
import org.spongepowered.api.entity.living.animal.SkeletonHorse;
import org.spongepowered.api.entity.living.animal.ZombieHorse;
Expand Down Expand Up @@ -1468,6 +1469,13 @@ public final class Keys {
*/
public static final Key<Value<Boolean>> OPEN = KeyFactory.fake("OPEN");

/**
* Represents the {@link ParrotVariant variant} of a {@link Parrot}.
*
* @see ParrotData#type()
*/
public static final Key<Value<ParrotVariant>> PARROT_VARIANT = KeyFactory.fake("PARROT_VARIANT");

/**
* Represents the {@link Key} for the amount of ticks a {@link Furnace} has
* already been burning with the current fuel item.
Expand Down
@@ -0,0 +1,38 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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.data.manipulator.immutable.entity;

import org.spongepowered.api.data.manipulator.immutable.ImmutableVariantData;
import org.spongepowered.api.data.manipulator.mutable.entity.ParrotData;
import org.spongepowered.api.data.type.ParrotVariant;
import org.spongepowered.api.entity.living.animal.Parrot;

/**
* A type of {@link ImmutableVariantData} for {@link ParrotVariant}s belonging
* to an {@link Parrot}.
*/
public interface ImmutableParrotData extends ImmutableVariantData<ParrotVariant, ImmutableParrotData, ParrotData> {

}
@@ -0,0 +1,38 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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.data.manipulator.mutable.entity;

import org.spongepowered.api.data.manipulator.immutable.entity.ImmutableParrotData;
import org.spongepowered.api.data.manipulator.mutable.VariantData;
import org.spongepowered.api.data.type.ParrotVariant;
import org.spongepowered.api.entity.living.animal.Parrot;

/**
* A type of {@link VariantData} for {@link ParrotVariant}s belonging
* to an {@link Parrot}.
*/
public interface ParrotData extends VariantData<ParrotVariant, ParrotData, ImmutableParrotData> {

}
37 changes: 37 additions & 0 deletions src/main/java/org/spongepowered/api/data/type/ParrotVariant.java
@@ -0,0 +1,37 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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.data.type;

import org.spongepowered.api.CatalogType;
import org.spongepowered.api.entity.living.animal.Parrot;
import org.spongepowered.api.util.annotation.CatalogedBy;

/**
* Represents the variant of a {@link Parrot}.
*/
@CatalogedBy(ParrotVariants.class)
public interface ParrotVariant extends CatalogType {

}
50 changes: 50 additions & 0 deletions src/main/java/org/spongepowered/api/data/type/ParrotVariants.java
@@ -0,0 +1,50 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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.data.type;

import org.spongepowered.api.util.generator.dummy.DummyObjectProvider;

/**
* An enumeration of known vanilla {@link OcelotType}s.

This comment has been minimized.

Copy link
@VapidLinus

VapidLinus Jun 10, 2017

This says "OcelotType"

This comment has been minimized.

Copy link
@Deamon5550

Deamon5550 Jun 10, 2017

Contributor

Post this to #1000 please

This comment has been minimized.

Copy link
@kashike

kashike Jun 10, 2017

Author Contributor

x

This comment has been minimized.

Copy link
@parlough

parlough Jun 10, 2017

Contributor

SQUAWK

*/
public final class ParrotVariants {

// SORTFIELDS:ON

public static final ParrotVariant BLUE = DummyObjectProvider.createFor(ParrotVariant.class, "BLUE");

public static final ParrotVariant CYAN = DummyObjectProvider.createFor(ParrotVariant.class, "CYAN");

public static final ParrotVariant GRAY = DummyObjectProvider.createFor(ParrotVariant.class, "GRAY");

public static final ParrotVariant GREEN = DummyObjectProvider.createFor(ParrotVariant.class, "GREEN");

public static final ParrotVariant RED = DummyObjectProvider.createFor(ParrotVariant.class, "RED");

// SORTFIELDS:OFF

private ParrotVariants() {
}
}
@@ -0,0 +1,57 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* 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.key.Keys;
import org.spongepowered.api.data.manipulator.mutable.entity.ParrotData;
import org.spongepowered.api.data.type.ParrotVariant;
import org.spongepowered.api.data.value.mutable.Value;

/**
* Represents a parrot.
*/
public interface Parrot extends Animal {

/**
* Gets a copy of the current {@link ParrotData} being represented by
* this {@link Parrot}.
*
* @return A copy of the current parrot data
*/
default ParrotData getParrotData() {
return this.get(ParrotData.class).get();
}

/**
* Gets the {@link Value} for the {@link ParrotVariant} of this
* {@link Parrot}.
*
* @return The parrot variant value
*/
default Value<ParrotVariant> variant() {
return this.getValue(Keys.PARROT_VARIANT).get();
}

}

0 comments on commit acb44bc

Please sign in to comment.