From d5d2bd4b4866245df9f5304c1aba65f8b536bc29 Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Sun, 27 Oct 2024 16:29:30 -0700 Subject: [PATCH] feat: add decorated pot data --- .../api/block/entity/DecoratedPot.java | 50 +++++++++++++++++++ .../java/org/spongepowered/api/data/Keys.java | 29 +++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/main/java/org/spongepowered/api/block/entity/DecoratedPot.java diff --git a/src/main/java/org/spongepowered/api/block/entity/DecoratedPot.java b/src/main/java/org/spongepowered/api/block/entity/DecoratedPot.java new file mode 100644 index 0000000000..1c2e1961dc --- /dev/null +++ b/src/main/java/org/spongepowered/api/block/entity/DecoratedPot.java @@ -0,0 +1,50 @@ +/* + * 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.block.entity; + +import org.spongepowered.api.data.Keys; +import org.spongepowered.api.data.value.Value; +import org.spongepowered.api.item.ItemType; + +public interface DecoratedPot extends BlockEntity { + + default Value.Mutable front() { + return this.requireValue(Keys.POT_FRONT_DECORATION).asMutable(); + } + + default Value.Mutable back() { + return this.requireValue(Keys.POT_BACK_DECORATION).asMutable(); + } + + + default Value.Mutable left() { + return this.requireValue(Keys.POT_LEFT_DECORATION).asMutable(); + } + + default Value.Mutable right() { + return this.requireValue(Keys.POT_RIGHT_DECORATION).asMutable(); + } + +} diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index 8e7dc0706b..076ccb29fb 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -34,6 +34,7 @@ import org.spongepowered.api.block.entity.Banner; import org.spongepowered.api.block.entity.BlockEntity; import org.spongepowered.api.block.entity.CommandBlock; +import org.spongepowered.api.block.entity.DecoratedPot; import org.spongepowered.api.block.entity.EndGateway; import org.spongepowered.api.block.entity.Jukebox; import org.spongepowered.api.block.entity.Lectern; @@ -2605,6 +2606,34 @@ public final class Keys { */ public static final Key> PORTION_TYPE = Keys.key(ResourceKey.sponge("portion_type"), PortionType.class); + /** + * The {@link ItemType decoration} for a {@link DecoratedPot}. + * + * @see Pottery Sherd + */ + public static final Key> POT_FRONT_DECORATION = Keys.key(ResourceKey.sponge("pot_front_decoration"), ItemType.class); + + /** + * The {@link ItemType decoration} for a {@link DecoratedPot}. + * + * @see Pottery Sherd + */ + public static final Key> POT_LEFT_DECORATION = Keys.key(ResourceKey.sponge("pot_left_decoration"), ItemType.class); + + /** + * The {@link ItemType decoration} for a {@link DecoratedPot}. + * + * @see Pottery Sherd + */ + public static final Key> POT_RIGHT_DECORATION = Keys.key(ResourceKey.sponge("pot_right_decoration"), ItemType.class); + + /** + * The {@link ItemType decoration} for a {@link DecoratedPot}. + * + * @see Pottery Sherd + */ + public static final Key> POT_BACK_DECORATION = Keys.key(ResourceKey.sponge("pot_back_decoration"), ItemType.class); + /** * The potential max speed of a {@link Minecart}. */