Skip to content

Commit a9b08cf

Browse files
committed
fixup! Add BlockState.getMaterial()
1 parent ef875a4 commit a9b08cf

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockState.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public BlockType getBlockType() {
7777
return this.blockType;
7878
}
7979

80-
@Override
8180
public BlockMaterial getMaterial() {
8281
return WorldEdit.getInstance().getPlatformManager()
8382
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);

worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BlockRegistry.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package com.sk89q.worldedit.world.registry;
2121

22+
import com.sk89q.worldedit.internal.util.NonAbstractForCompatibility;
2223
import com.sk89q.worldedit.registry.state.Property;
2324
import com.sk89q.worldedit.util.formatting.text.Component;
2425
import com.sk89q.worldedit.world.block.BlockState;
@@ -68,7 +69,13 @@ default String getName(BlockType blockType) {
6869
*
6970
* @param blockState the block state
7071
* @return the material, or null if the material information is not known
72+
* @apiNote This must be overridden by new subclasses. See {@link NonAbstractForCompatibility}
73+
* for details
7174
*/
75+
@NonAbstractForCompatibility(
76+
delegateName = "getMaterial",
77+
delegateParams = { BlockType.class }
78+
)
7279
@Nullable
7380
default BlockMaterial getMaterial(BlockState blockState) {
7481
return getMaterial(blockState.getBlockType());

0 commit comments

Comments
 (0)