Added features to MetaBlock

This commit is contained in:
Francesco Macagno 2015-08-22 15:50:41 -07:00
parent 6538fb4929
commit aa6de6177c

View file

@ -4,7 +4,7 @@ import java.util.HashMap;
import net.minecraft.block.Block;
public class MetaBlock {
public class MetaBlock implements Comparable {
private static final int MAX_METADATA = 16;//I think this is 16?
@ -48,5 +48,14 @@ public class MetaBlock {
return block[metadata];
}
@Override
public int compareTo(Object o) {
return block.getUnlocalizedName().compareTo(((MetaBlock) o).block.getUnlocalizedName());
}
@Override
public String toString() {
return block.getUnlocalizedName() + ":" + metadata;
}
}