Skip to content

Commit 7df5258

Browse files
committed
implement block data
1 parent 89fe83d commit 7df5258

11 files changed

Lines changed: 27 additions & 23 deletions

File tree

‎paper-api/src/main/java/org/bukkit/Material.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
import org.bukkit.block.data.type.SculkVein;
109109
import org.bukkit.block.data.type.SeaPickle;
110110
import org.bukkit.block.data.type.Shelf;
111+
import org.bukkit.block.data.type.ShelfMushroom;
111112
import org.bukkit.block.data.type.Sign;
112113
import org.bukkit.block.data.type.Skull;
113114
import org.bukkit.block.data.type.Slab;
@@ -1675,7 +1676,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
16751676
SEA_LANTERN(-1),
16761677
SEA_PICKLE(-1, SeaPickle.class),
16771678
SEAGRASS(-1),
1678-
SHELF_MUSHROOM(-1, Ageable.class),
1679+
SHELF_MUSHROOM(-1, ShelfMushroom.class),
16791680
SHORT_DRY_GRASS(-1),
16801681
SHORT_GRASS(-1),
16811682
SHROOMLIGHT(-1),
@@ -1741,7 +1742,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
17411742
STONE_SLAB(-1, Slab.class),
17421743
STONE_STAIRS(-1, Stairs.class),
17431744
STONECUTTER(-1, Directional.class),
1744-
STRAW_BED(-1, Directional.class),
1745+
STRAW_BED(-1, Bed.class),
17451746
STRIPPED_ACACIA_LOG(-1, Orientable.class),
17461747
STRIPPED_ACACIA_WOOD(-1, Orientable.class),
17471748
STRIPPED_BAMBOO_BLOCK(-1, Orientable.class),

‎paper-api/src/main/java/org/bukkit/block/BlockType.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
import org.bukkit.block.data.type.SculkVein;
103103
import org.bukkit.block.data.type.SeaPickle;
104104
import org.bukkit.block.data.type.Shelf;
105+
import org.bukkit.block.data.type.ShelfMushroom;
105106
import org.bukkit.block.data.type.Sign;
106107
import org.bukkit.block.data.type.Skull;
107108
import org.bukkit.block.data.type.Slab;
@@ -2187,7 +2188,7 @@ interface Typed<B extends BlockData> extends BlockType {
21872188

21882189
BlockType.Typed<BlockData> SEAGRASS = getBlockType("seagrass");
21892190

2190-
BlockType.Typed<Ageable> SHELF_MUSHROOM = getBlockType("shelf_mushroom");
2191+
BlockType.Typed<ShelfMushroom> SHELF_MUSHROOM = getBlockType("shelf_mushroom");
21912192

21922193
BlockType.Typed<BlockData> SHORT_DRY_GRASS = getBlockType("short_dry_grass");
21932194

@@ -2319,7 +2320,7 @@ interface Typed<B extends BlockData> extends BlockType {
23192320

23202321
BlockType.Typed<Directional> STONECUTTER = getBlockType("stonecutter");
23212322

2322-
BlockType.Typed<Directional> STRAW_BED = getBlockType("straw_bed");
2323+
BlockType.Typed<Bed> STRAW_BED = getBlockType("straw_bed");
23232324

23242325
BlockType.Typed<Orientable> STRIPPED_ACACIA_LOG = getBlockType("stripped_acacia_log");
23252326

‎paper-api/src/main/java/org/bukkit/block/data/type/Crafter.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public interface Crafter extends BlockData {
6464
* {@link org.bukkit.block.Orientation} instead. All references
6565
* to this enum will be redirected to that enum at runtime.
6666
*/
67-
@Deprecated
67+
@Deprecated(since = "1.21.5", forRemoval = true)
6868
public enum Orientation {
6969

7070
DOWN_EAST,

‎paper-api/src/main/java/org/bukkit/block/data/type/Jigsaw.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface Jigsaw extends BlockData {
3030
* {@link org.bukkit.block.Orientation} instead. All references
3131
* to this enum will be redirected to that enum at runtime.
3232
*/
33-
@Deprecated
33+
@Deprecated(since = "1.21.5", forRemoval = true)
3434
public enum Orientation {
3535

3636
DOWN_EAST,

‎paper-api/src/main/java/org/bukkit/block/data/type/MossyCarpet.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface MossyCarpet extends BlockData {
5050
* {@link org.bukkit.block.data.type.Wall.Height} instead. All references
5151
* to this enum will be redirected to that enum at runtime.
5252
*/
53-
@Deprecated
53+
@Deprecated(since = "1.21.5", forRemoval = true)
5454
public enum Height {
5555
/**
5656
* Not present.

‎paper-api/src/main/java/org/bukkit/block/data/type/PinkPetals.java‎

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.bukkit.block.data.type;
2+
3+
import org.bukkit.block.data.Ageable;
4+
import org.bukkit.block.data.Directional;
5+
6+
public interface ShelfMushroom extends Ageable, Directional {
7+
}

‎paper-generator/src/main/java/io/papermc/generator/Main.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public static CompletableFuture<Void> bootStrap(boolean withTags) {
108108
}).thenAccept(resources -> {
109109
resources.updateComponentsAndStaticRegistryTags();
110110
EXPERIMENTAL_TAGS = ExperimentalCollector.collectTags(resourceManager);
111-
System.out.println(EXPERIMENTAL_TAGS);
112111
});
113112
} else {
114113
EXPERIMENTAL_TAGS = Map.of();

‎paper-generator/src/main/java/io/papermc/generator/utils/BlockStateMapping.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public record BlockData(String implName, @Nullable Class<? extends org.bukkit.bl
136136
.put("UntintedParticleLeaves", "Leaves")
137137
.put("TintedParticleLeaves", "Leaves")
138138
.put("StandingSign", "Sign")
139+
.put("StrawBed", "Bed")
139140
.put("FenceGate", "Gate")
140141
.buildOrThrow();
141142

‎paper-server/src/generated/java/org/bukkit/craftbukkit/block/impl/CraftShelfMushroom.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
import net.minecraft.world.level.block.state.properties.EnumProperty;
1010
import net.minecraft.world.level.block.state.properties.IntegerProperty;
1111
import org.bukkit.block.BlockFace;
12-
import org.bukkit.block.data.Ageable;
12+
import org.bukkit.block.data.type.ShelfMushroom;
1313
import org.bukkit.craftbukkit.block.data.CraftBlockData;
1414
import org.jspecify.annotations.NullMarked;
1515

1616
@NullMarked
1717
@GeneratedClass
18-
public class CraftShelfMushroom extends CraftBlockData implements Ageable {
18+
public class CraftShelfMushroom extends CraftBlockData implements ShelfMushroom {
1919
private static final IntegerProperty AGE = ShelfMushroomBlock.AGE;
2020

2121
private static final EnumProperty<Direction> FACING = ShelfMushroomBlock.FACING;
@@ -39,16 +39,19 @@ public int getMaximumAge() {
3939
return AGE.max;
4040
}
4141

42+
@Override
4243
public BlockFace getFacing() {
4344
return this.get(FACING, BlockFace.class);
4445
}
4546

47+
@Override
4648
public void setFacing(final BlockFace blockFace) {
4749
Preconditions.checkArgument(blockFace != null, "blockFace cannot be null!");
4850
Preconditions.checkArgument(blockFace.isCartesian() && blockFace.getModY() == 0, "Invalid face, only cartesian horizontal face are allowed for this property!");
4951
this.set(FACING, blockFace);
5052
}
5153

54+
@Override
5255
public Set<BlockFace> getFaces() {
5356
return this.getValues(FACING, BlockFace.class);
5457
}

0 commit comments

Comments
 (0)