Skip to content

Commit 2c88ba5

Browse files
committed
feat: merge decorated pots
merges #2570 Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
2 parents 4d869f0 + d5d2bd4 commit 2c88ba5

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;
@@ -2612,6 +2613,34 @@ public final class Keys {
26122613
*/
26132614
public static final Key<Value<PortionType>> PORTION_TYPE = Keys.key(ResourceKey.sponge("portion_type"), PortionType.class);
26142615

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_FRONT_DECORATION = Keys.key(ResourceKey.sponge("pot_front_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_LEFT_DECORATION = Keys.key(ResourceKey.sponge("pot_left_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_RIGHT_DECORATION = Keys.key(ResourceKey.sponge("pot_right_decoration"), ItemType.class);
2636+
2637+
/**
2638+
* The {@link ItemType decoration} for a {@link DecoratedPot}.
2639+
*
2640+
* @see <a href="https://minecraft.wiki/w/Pottery_Sherd">Pottery Sherd</a>
2641+
*/
2642+
public static final Key<Value<ItemType>> POT_BACK_DECORATION = Keys.key(ResourceKey.sponge("pot_back_decoration"), ItemType.class);
2643+
26152644
/**
26162645
* The potential max speed of a {@link Minecart}.
26172646
*/

0 commit comments

Comments
 (0)