From 4900537a824b1c98b47befdd8d135788c0f54cbe Mon Sep 17 00:00:00 2001 From: bdew Date: Tue, 12 May 2015 10:19:37 +0300 Subject: [PATCH] /oredistribution - Fixed meta detection with some ores (e.g. lapis) --- src/net/bdew/lib/CommandOreDistribution.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/net/bdew/lib/CommandOreDistribution.scala b/src/net/bdew/lib/CommandOreDistribution.scala index 1043442..beb1e62 100644 --- a/src/net/bdew/lib/CommandOreDistribution.scala +++ b/src/net/bdew/lib/CommandOreDistribution.scala @@ -70,12 +70,10 @@ object CommandOreDistribution extends CommandBase { z <- startZ - radius to startZ + radius if !world.isAirBlock(x, y, z) } { - val block = world.getBlock(x, y, z) - val item = Item.getItemFromBlock(block) - val damage = block.getDamageValue(world, x, y, z) - for (ore <- ores.get((item, damage))) { + val key = (Item.getItemFromBlock(world.getBlock(x, y, z)), world.getBlockMetadata(x, y, z)) + for (ore <- ores.get(key)) { distribution(ore) += 1 - kinds(ore) += ((item, damage)) + kinds(ore) += key } }