mirror of https://github.com/cabaletta/baritone
Clean up BaritoneResourcePack
This commit is contained in:
parent
863db53b24
commit
35cb592d09
|
@ -22,10 +22,7 @@ import net.minecraft.client.resources.data.IMetadataSection;
|
||||||
import net.minecraft.client.resources.data.MetadataSerializer;
|
import net.minecraft.client.resources.data.MetadataSerializer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -34,27 +31,26 @@ import java.util.Set;
|
||||||
* @author Brady
|
* @author Brady
|
||||||
* @since 12/15/2018
|
* @since 12/15/2018
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("NullableProblems")
|
||||||
public class BaritoneResourcePack implements IResourcePack {
|
public class BaritoneResourcePack implements IResourcePack {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getInputStream(@Nonnull ResourceLocation location) {
|
public InputStream getInputStream(ResourceLocation location) {
|
||||||
return getResourceStream(location);
|
return getResourceStream(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean resourceExists(@Nonnull ResourceLocation location) {
|
public boolean resourceExists(ResourceLocation location) {
|
||||||
return getResourceStream(location) != null;
|
return getResourceStream(location) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getResourceDomains() {
|
public Set<String> getResourceDomains() {
|
||||||
return Collections.singleton("baritone");
|
return Collections.singleton("baritone");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends IMetadataSection> T getPackMetadata(@Nonnull MetadataSerializer metadataSerializer, @Nonnull String metadataSectionName) throws IOException {
|
public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,13 +59,11 @@ public class BaritoneResourcePack implements IResourcePack {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
@Override
|
||||||
public String getPackName() {
|
public String getPackName() {
|
||||||
return "baritone";
|
return "baritone";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private InputStream getResourceStream(ResourceLocation location) {
|
private InputStream getResourceStream(ResourceLocation location) {
|
||||||
return BaritoneResourcePack.class.getResourceAsStream("/assets/" + location.getNamespace() + "/" + location.getPath());
|
return BaritoneResourcePack.class.getResourceAsStream("/assets/" + location.getNamespace() + "/" + location.getPath());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue