[Bleeding] Implement Metadata framework for Entities, Blocks, and Worlds
This commit is contained in:
@@ -9,6 +9,10 @@ import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.CraftChunk;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CraftBlockState implements BlockState {
|
||||
private final CraftWorld world;
|
||||
@@ -189,4 +193,20 @@ public class CraftBlockState implements BlockState {
|
||||
hash = 73 * hash + (this.data != null ? this.data.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
|
||||
chunk.getCraftWorld().getBlockMetadata().setMetadata(getBlock(), metadataKey, newMetadataValue);
|
||||
}
|
||||
|
||||
public List<MetadataValue> getMetadata(String metadataKey) {
|
||||
return chunk.getCraftWorld().getBlockMetadata().getMetadata(getBlock(), metadataKey);
|
||||
}
|
||||
|
||||
public boolean hasMetadata(String metadataKey) {
|
||||
return chunk.getCraftWorld().getBlockMetadata().hasMetadata(getBlock(), metadataKey);
|
||||
}
|
||||
|
||||
public void removeMetadata(String metadataKey, Plugin owningPlugin) {
|
||||
chunk.getCraftWorld().getBlockMetadata().removeMetadata(getBlock(), metadataKey, owningPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user