Skip to content

Commit

Permalink
feat: add decorated pot data
Browse files Browse the repository at this point in the history
  • Loading branch information
gabizou committed Oct 27, 2024
1 parent faefbd5 commit d5d2bd4
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/main/java/org/spongepowered/api/block/entity/DecoratedPot.java
Original file line number Diff line number Diff line change
@@ -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.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<ItemType> front() {
return this.requireValue(Keys.POT_FRONT_DECORATION).asMutable();
}

default Value.Mutable<ItemType> back() {
return this.requireValue(Keys.POT_BACK_DECORATION).asMutable();
}


default Value.Mutable<ItemType> left() {
return this.requireValue(Keys.POT_LEFT_DECORATION).asMutable();
}

default Value.Mutable<ItemType> right() {
return this.requireValue(Keys.POT_RIGHT_DECORATION).asMutable();
}

}
29 changes: 29 additions & 0 deletions src/main/java/org/spongepowered/api/data/Keys.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2605,6 +2606,34 @@ public final class Keys {
*/
public static final Key<Value<PortionType>> PORTION_TYPE = Keys.key(ResourceKey.sponge("portion_type"), PortionType.class);

/**
* The {@link ItemType decoration} for a {@link DecoratedPot}.
*
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
*/
public static final Key<Value<ItemType>> POT_FRONT_DECORATION = Keys.key(ResourceKey.sponge("pot_front_decoration"), ItemType.class);

/**
* The {@link ItemType decoration} for a {@link DecoratedPot}.
*
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
*/
public static final Key<Value<ItemType>> POT_LEFT_DECORATION = Keys.key(ResourceKey.sponge("pot_left_decoration"), ItemType.class);

/**
* The {@link ItemType decoration} for a {@link DecoratedPot}.
*
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
*/
public static final Key<Value<ItemType>> POT_RIGHT_DECORATION = Keys.key(ResourceKey.sponge("pot_right_decoration"), ItemType.class);

/**
* The {@link ItemType decoration} for a {@link DecoratedPot}.
*
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
*/
public static final Key<Value<ItemType>> POT_BACK_DECORATION = Keys.key(ResourceKey.sponge("pot_back_decoration"), ItemType.class);

/**
* The potential max speed of a {@link Minecart}.
*/
Expand Down

0 comments on commit d5d2bd4

Please sign in to comment.