Skip to content

Commit

Permalink
Using ByteDataStream:1.2 & Added 'of' method for TextureProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
trychen committed Jan 29, 2019
1 parent 88c15cc commit 910e64f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ configurations {
}

dependencies {
embed ('com.github.trychen:ByteDataStream:2bbcdbd6c5') {
embed ('com.github.trychen:ByteDataStream:1.2-SNAPSHOT') {
exclude group: 'org.ow2.asm'
exclude group: 'com.github.Mouse0w0'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G

# Mod Properties
mod_id = Pangu
mod_version = 1.5.0
mod_version = 1.5.1
mod_group = cn.mccraft.pangu
mod_core_plugin = cn.mccraft.pangu.core.asm.PanguPlugin

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/mccraft/pangu/core/PanguCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Mod(
modid = PanguCore.ID,
name = "Pangu Core",
version = "1.5.0",
version = "1.5.1",
useMetadata = true,
acceptedMinecraftVersions = "[1.12.2,1.13)"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

import net.minecraft.util.ResourceLocation;

import java.net.MalformedURLException;

public interface TextureProvider {
ResourceLocation getTexture();

static TextureProvider of(String path, ResourceLocation missing) {
if (path.startsWith("http://") || path.startsWith("https://")) {
try {
return new RemoteImage(path, missing);
} catch (MalformedURLException e) {
}
} else if (path.startsWith("local:")) {
return new BuiltinImage(new ResourceLocation(path));
}

return null;
}
}

0 comments on commit 910e64f

Please sign in to comment.