Skip to content

Commit d5d2bd4

Browse files
committed
feat: add decorated pot data
1 parent faefbd5 commit d5d2bd4

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.block.entity;
26+
27+
import org.spongepowered.api.data.Keys;
28+
import org.spongepowered.api.data.value.Value;
29+
import org.spongepowered.api.item.ItemType;
30+
31+
public interface DecoratedPot extends BlockEntity {
32+
33+
default Value.Mutable<ItemType> front() {
34+
return this.requireValue(Keys.POT_FRONT_DECORATION).asMutable();
35+
}
36+
37+
default Value.Mutable<ItemType> back() {
38+
return this.requireValue(Keys.POT_BACK_DECORATION).asMutable();
39+
}
40+
41+
42+
default Value.Mutable<ItemType> left() {
43+
return this.requireValue(Keys.POT_LEFT_DECORATION).asMutable();
44+
}
45+
46+
default Value.Mutable<ItemType> right() {
47+
return this.requireValue(Keys.POT_RIGHT_DECORATION).asMutable();
48+
}
49+
50+
}

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.spongepowered.api.block.entity.Banner;
3535
import org.spongepowered.api.block.entity.BlockEntity;
3636
import org.spongepowered.api.block.entity.CommandBlock;
37+
import org.spongepowered.api.block.entity.DecoratedPot;
3738
import org.spongepowered.api.block.entity.EndGateway;
3839
import org.spongepowered.api.block.entity.Jukebox;
3940
import org.spongepowered.api.block.entity.Lectern;
@@ -2605,6 +2606,34 @@ public final class Keys {
26052606
*/
26062607
public static final Key<Value<PortionType>> PORTION_TYPE = Keys.key(ResourceKey.sponge("portion_type"), PortionType.class);
26072608

2609+
/**
2610+
* The {@link ItemType decoration} for a {@link DecoratedPot}.
2611+
*
2612+
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
2613+
*/
2614+
public static final Key<Value<ItemType>> POT_FRONT_DECORATION = Keys.key(ResourceKey.sponge("pot_front_decoration"), ItemType.class);
2615+
2616+
/**
2617+
* The {@link ItemType decoration} for a {@link DecoratedPot}.
2618+
*
2619+
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
2620+
*/
2621+
public static final Key<Value<ItemType>> POT_LEFT_DECORATION = Keys.key(ResourceKey.sponge("pot_left_decoration"), ItemType.class);
2622+
2623+
/**
2624+
* The {@link ItemType decoration} for a {@link DecoratedPot}.
2625+
*
2626+
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
2627+
*/
2628+
public static final Key<Value<ItemType>> POT_RIGHT_DECORATION = Keys.key(ResourceKey.sponge("pot_right_decoration"), ItemType.class);
2629+
2630+
/**
2631+
* The {@link ItemType decoration} for a {@link DecoratedPot}.
2632+
*
2633+
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
2634+
*/
2635+
public static final Key<Value<ItemType>> POT_BACK_DECORATION = Keys.key(ResourceKey.sponge("pot_back_decoration"), ItemType.class);
2636+
26082637
/**
26092638
* The potential max speed of a {@link Minecart}.
26102639
*/

0 commit comments

Comments
 (0)