mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Expose a way of switching between ItemType and BlockType for ItemBlocks.
This commit is contained in:
@ -19,15 +19,15 @@
|
||||
|
||||
package com.sk89q.worldedit.world.registry;
|
||||
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockMaterial;
|
||||
import com.sk89q.worldedit.blocks.type.BlockState;
|
||||
import com.sk89q.worldedit.blocks.type.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.registry.state.State;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Provides information on blocks and provides methods to create them.
|
||||
*/
|
||||
@ -45,11 +45,11 @@ public interface BlockRegistry {
|
||||
/**
|
||||
* Get the material for the given block.
|
||||
*
|
||||
* @param block the block
|
||||
* @param id the block
|
||||
* @return the material, or null if the material information is not known
|
||||
*/
|
||||
@Nullable
|
||||
BlockMaterial getMaterial(BaseBlock block);
|
||||
BlockMaterial getMaterial(String id);
|
||||
|
||||
/**
|
||||
* Get an unmodifiable map of states for this block.
|
||||
|
@ -19,16 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.world.registry;
|
||||
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockMaterial;
|
||||
import com.sk89q.worldedit.blocks.type.BlockState;
|
||||
import com.sk89q.worldedit.blocks.type.BlockStateHolder;
|
||||
import com.sk89q.worldedit.blocks.type.BlockTypes;
|
||||
import com.sk89q.worldedit.world.registry.state.State;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* A block registry that uses {@link BundledBlockData} to serve information
|
||||
* about blocks.
|
||||
@ -43,8 +43,8 @@ public class BundledBlockRegistry implements BlockRegistry {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockMaterial getMaterial(BaseBlock block) {
|
||||
return BundledBlockData.getInstance().getMaterialById(block.getBlockType().getId());
|
||||
public BlockMaterial getMaterial(String id) {
|
||||
return BundledBlockData.getInstance().getMaterialById(id);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Reference in New Issue
Block a user