int w;
AnimationMetadataSection animation;
try {
IResource iresource = manager.getResource(getBlockResource(name));
IResource iresourceBase = manager.getResource(getBlockResource(base));
// load the ore texture
ore_image[0] = ImageIO.read(iresource.getInputStream());
// load animation
animation = (AnimationMetadataSection) iresource.getMetadata("animation");
// load the stone texture
stone_image = ImageIO.read(iresourceBase.getInputStream());
w = ore_image[0].getWidth();
if (stone_image.getWidth() != w) {
List resourcePacks = manager.getAllResources(getBlockResource(base));
for (int i = resourcePacks.size() - 1; i >= 0; --i) {
IResource resource = (IResource) resourcePacks.get(i);
stone_image = ImageIO.read(resource.getInputStream());
if (stone_image.getWidth() == w)
break;
}
}