// Path: src/main/java/com/github/worldsender/mcanm/Proxy.java
// public interface Proxy {
// 	void preInit();
// 
// 	void init();
// 
// 	/**
// 	 * On a client, this will return a {@link MinecraftResourceLocation} that will get reloaded when a new texture pack
// 	 * is switched on. On the server, this returns a {@link EmbeddedResourceLocation} using the {@link ClassLoader} of
// 	 * the calling class.
// 	 * 
// 	 * @param resLoc
// 	 *            the resource location to load from. On the server the resource must be packed with the .jar
// 	 * @param context
// 	 *            when the resource is loaded on the server, it is attempted to load it from this class loader
// 	 * @return
// 	 */
// 	IResourceLocation getSidedResource(ResourceLocation resLoc, ClassLoader context);
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/resource/EmbeddedResourceLocation.java
// 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());
// 	}
// 
// 	public EmbeddedResourceLocation(String name, ClassLoader loader) {
// 		this(loader.getResource(name), name);
// 	}
// 
// 	public EmbeddedResourceLocation(URL url) {
// 		this(url, null);
// 	}
// 
// 	public EmbeddedResourceLocation(URL url, String resourceName) {
// 		this.url = url;
// 		this.name = resourceName;
// 	}
// 
// 	@Override
// 	public IResource open() throws IOException {
// 		return new EmbeddedResource(url);
// 	}
// 
// 	@Override
// 	public String getResourceName() {
// 		return url != null ? url.toString() : name != null ? name : "<unnamed resource>";
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((url == null) ? 0 : url.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj) {
// 			return true;
// 		}
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (!(obj instanceof EmbeddedResourceLocation)) {
// 			return false;
// 		}
// 		EmbeddedResourceLocation other = (EmbeddedResourceLocation) obj;
// 		if (url == null) {
// 			if (other.url != null) {
// 				return false;
// 			}
// 		} else if (!url.equals(other.url)) {
// 			return false;
// 		}
// 		return true;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/resource/IResourceLocation.java
// public interface IResourceLocation {
// 	/**
// 	 * For data that has no definite location, this is suitable (e.g. one-time streams)
// 	 */
// 	public static final IResourceLocation UNKNOWN_LOCATION = new IResourceLocation() {
// 		@Override
// 		public IResource open() throws IOException {
// 			throw new NoSuchFileException("Unknown location");
// 		}
// 
// 		@Override
// 		public String getResourceName() {
// 			return "<unknown resource>";
// 		}
// 
// 		@Override
// 		public boolean shouldCache() {
// 			return false;
// 		}
// 
// 		@Override
// 		public void registerReloadListener(Consumer<IResourceLocation> reloadListener) {
// 			reloadListener.accept(this);
// 			// Don't store it, this location won't change
// 		}
// 	};
// 
// 	/**
// 	 * Opens the resource location described by this resource location.
// 	 * 
// 	 * @return an empty optional if the resource is currently (expectedly) absent
// 	 * @throws IOException
// 	 *             if the resource is absent unexpectedly
// 	 */
// 	IResource open() throws IOException;
// 
// 	/**
// 	 * Registers a listener that is being fired every time this resource changes. What "changes" means is deliberately
// 	 * left unspecified but a good example would be whenever the {@link Minecraft#getResourceManager()} changes, for
// 	 * example when a new resource pack is loaded.<br>
// 	 * <b>The initial stick is considered a change already, so this method should also fire the listener once.</b>
// 	 * 
// 	 * @param reloadListener
// 	 */
// 	void registerReloadListener(Consumer<IResourceLocation> reloadListener);
// 
// 	/**
// 	 * A descriptive name of the resource, perhaps the path
// 	 * 
// 	 * @return
// 	 */
// 	String getResourceName();
// 
// 	/**
// 	 * Returns false if this resource should not be cached, e.g. it is a one-time stream. When a
// 	 * {@link IResourceLocation} may get cached, {@link #open()} should succeed multiple times and return the same data
// 	 * every time, until the resource is reloaded.
// 	 * 
// 	 * @return
// 	 */
// 	boolean shouldCache();
// 
// 	@Override
// 	boolean equals(Object obj);
// 
// 	@Override
// 	int hashCode();
// }


import com.github.worldsender.mcanm.Proxy;
import com.github.worldsender.mcanm.common.resource.EmbeddedResourceLocation;
import com.github.worldsender.mcanm.common.resource.IResourceLocation;
import net.minecraft.util.ResourceLocation;

package com.github.worldsender.mcanm.server;



public class ServerProxy implements Proxy {
	@Override
	public void preInit() {}

	@Override
	public void init() {}

	@Override
	public IResourceLocation getSidedResource(ResourceLocation resLoc, ClassLoader context) {
		String path = "assets/" + resLoc.getResourceDomain() + "/" + resLoc.getResourcePath();

// Path: src/main/java/com/github/worldsender/mcanm/Proxy.java
// public interface Proxy {
// 	void preInit();
// 
// 	void init();
// 
// 	/**
// 	 * On a client, this will return a {@link MinecraftResourceLocation} that will get reloaded when a new texture pack
// 	 * is switched on. On the server, this returns a {@link EmbeddedResourceLocation} using the {@link ClassLoader} of
// 	 * the calling class.
// 	 * 
// 	 * @param resLoc
// 	 *            the resource location to load from. On the server the resource must be packed with the .jar
// 	 * @param context
// 	 *            when the resource is loaded on the server, it is attempted to load it from this class loader
// 	 * @return
// 	 */
// 	IResourceLocation getSidedResource(ResourceLocation resLoc, ClassLoader context);
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/resource/EmbeddedResourceLocation.java
// 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());
// 	}
// 
// 	public EmbeddedResourceLocation(String name, ClassLoader loader) {
// 		this(loader.getResource(name), name);
// 	}
// 
// 	public EmbeddedResourceLocation(URL url) {
// 		this(url, null);
// 	}
// 
// 	public EmbeddedResourceLocation(URL url, String resourceName) {
// 		this.url = url;
// 		this.name = resourceName;
// 	}
// 
// 	@Override
// 	public IResource open() throws IOException {
// 		return new EmbeddedResource(url);
// 	}
// 
// 	@Override
// 	public String getResourceName() {
// 		return url != null ? url.toString() : name != null ? name : "<unnamed resource>";
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((url == null) ? 0 : url.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj) {
// 			return true;
// 		}
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (!(obj instanceof EmbeddedResourceLocation)) {
// 			return false;
// 		}
// 		EmbeddedResourceLocation other = (EmbeddedResourceLocation) obj;
// 		if (url == null) {
// 			if (other.url != null) {
// 				return false;
// 			}
// 		} else if (!url.equals(other.url)) {
// 			return false;
// 		}
// 		return true;
// 	}
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/resource/IResourceLocation.java
// public interface IResourceLocation {
// 	/**
// 	 * For data that has no definite location, this is suitable (e.g. one-time streams)
// 	 */
// 	public static final IResourceLocation UNKNOWN_LOCATION = new IResourceLocation() {
// 		@Override
// 		public IResource open() throws IOException {
// 			throw new NoSuchFileException("Unknown location");
// 		}
// 
// 		@Override
// 		public String getResourceName() {
// 			return "<unknown resource>";
// 		}
// 
// 		@Override
// 		public boolean shouldCache() {
// 			return false;
// 		}
// 
// 		@Override
// 		public void registerReloadListener(Consumer<IResourceLocation> reloadListener) {
// 			reloadListener.accept(this);
// 			// Don't store it, this location won't change
// 		}
// 	};
// 
// 	/**
// 	 * Opens the resource location described by this resource location.
// 	 * 
// 	 * @return an empty optional if the resource is currently (expectedly) absent
// 	 * @throws IOException
// 	 *             if the resource is absent unexpectedly
// 	 */
// 	IResource open() throws IOException;
// 
// 	/**
// 	 * Registers a listener that is being fired every time this resource changes. What "changes" means is deliberately
// 	 * left unspecified but a good example would be whenever the {@link Minecraft#getResourceManager()} changes, for
// 	 * example when a new resource pack is loaded.<br>
// 	 * <b>The initial stick is considered a change already, so this method should also fire the listener once.</b>
// 	 * 
// 	 * @param reloadListener
// 	 */
// 	void registerReloadListener(Consumer<IResourceLocation> reloadListener);
// 
// 	/**
// 	 * A descriptive name of the resource, perhaps the path
// 	 * 
// 	 * @return
// 	 */
// 	String getResourceName();
// 
// 	/**
// 	 * Returns false if this resource should not be cached, e.g. it is a one-time stream. When a
// 	 * {@link IResourceLocation} may get cached, {@link #open()} should succeed multiple times and return the same data
// 	 * every time, until the resource is reloaded.
// 	 * 
// 	 * @return
// 	 */
// 	boolean shouldCache();
// 
// 	@Override
// 	boolean equals(Object obj);
// 
// 	@Override
// 	int hashCode();
// }


// Path: src/main/java/com/github/worldsender/mcanm/server/ServerProxy.java
import com.github.worldsender.mcanm.Proxy;
import com.github.worldsender.mcanm.common.resource.EmbeddedResourceLocation;
import com.github.worldsender.mcanm.common.resource.IResourceLocation;
import net.minecraft.util.ResourceLocation;

package com.github.worldsender.mcanm.server;



public class ServerProxy implements Proxy {
	@Override
	public void preInit() {}

	@Override
	public void init() {}

	@Override
	public IResourceLocation getSidedResource(ResourceLocation resLoc, ClassLoader context) {
		String path = "assets/" + resLoc.getResourceDomain() + "/" + resLoc.getResourcePath();

		return new EmbeddedResourceLocation(path, context);
