// Path: src/main/java/com/github/worldsender/mcanm/common/util/CallResolver.java
// public class CallResolver extends SecurityManager {
// 	public static final CallResolver INSTANCE = new CallResolver();
// 
// 	public Class<?>[] getCallingClasses() {
// 		return getClassContext();
// 	}
// 
// 	public Class<?> getCallingClass() {
// 		return getCallingClasses()[3];
// 	}
// }


import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import com.github.worldsender.mcanm.common.util.CallResolver;
package com.github.worldsender.mcanm.common.resource;



public class EmbeddedResourceLocation extends ResourceLocationAdapter {
	private static InputStream createStream(URL url) throws IOException {
		if (url == null) {
			throw new IOException("Couldn't open the stream");
		}
		return url.openStream();
	}

	private /* static */ class EmbeddedResource extends ResourceAdapter {
		public EmbeddedResource(URL url) throws IOException {
			super(EmbeddedResourceLocation.this, createStream(url));
		}
	}

	private final URL url;
	private final String name;

	public EmbeddedResourceLocation(String name) {
// Path: src/main/java/com/github/worldsender/mcanm/common/util/CallResolver.java
// public class CallResolver extends SecurityManager {
// 	public static final CallResolver INSTANCE = new CallResolver();
// 
// 	public Class<?>[] getCallingClasses() {
// 		return getClassContext();
// 	}
// 
// 	public Class<?> getCallingClass() {
// 		return getCallingClasses()[3];
// 	}
// }


// Path: src/main/java/com/github/worldsender/mcanm/common/resource/EmbeddedResourceLocation.java
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import com.github.worldsender.mcanm.common.util.CallResolver;

package com.github.worldsender.mcanm.common.resource;



public class EmbeddedResourceLocation extends ResourceLocationAdapter {
	private static InputStream createStream(URL url) throws IOException {
		if (url == null) {
			throw new IOException("Couldn't open the stream");
		}
		return url.openStream();
	}

	private /* static */ class EmbeddedResource extends ResourceAdapter {
		public EmbeddedResource(URL url) throws IOException {
			super(EmbeddedResourceLocation.this, createStream(url));
		}
	}

	private final URL url;
	private final String name;

	public EmbeddedResourceLocation(String name) {
		this(name, CallResolver.INSTANCE.getCallingClass().getClassLoader());