Skip to content

Commit 910e64f

Browse files
committed
Using ByteDataStream:1.2 & Added 'of' method for TextureProvider
1 parent 88c15cc commit 910e64f

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ configurations {
6363
}
6464

6565
dependencies {
66-
embed ('com.github.trychen:ByteDataStream:2bbcdbd6c5') {
66+
embed ('com.github.trychen:ByteDataStream:1.2-SNAPSHOT') {
6767
exclude group: 'org.ow2.asm'
6868
exclude group: 'com.github.Mouse0w0'
6969
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
44

55
# Mod Properties
66
mod_id = Pangu
7-
mod_version = 1.5.0
7+
mod_version = 1.5.1
88
mod_group = cn.mccraft.pangu
99
mod_core_plugin = cn.mccraft.pangu.core.asm.PanguPlugin
1010

src/main/java/cn/mccraft/pangu/core/PanguCore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@Mod(
1919
modid = PanguCore.ID,
2020
name = "Pangu Core",
21-
version = "1.5.0",
21+
version = "1.5.1",
2222
useMetadata = true,
2323
acceptedMinecraftVersions = "[1.12.2,1.13)"
2424
)

src/main/java/cn/mccraft/pangu/core/util/image/TextureProvider.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
import net.minecraft.util.ResourceLocation;
44

5+
import java.net.MalformedURLException;
6+
57
public interface TextureProvider {
68
ResourceLocation getTexture();
9+
10+
static TextureProvider of(String path, ResourceLocation missing) {
11+
if (path.startsWith("http://") || path.startsWith("https://")) {
12+
try {
13+
return new RemoteImage(path, missing);
14+
} catch (MalformedURLException e) {
15+
}
16+
} else if (path.startsWith("local:")) {
17+
return new BuiltinImage(new ResourceLocation(path));
18+
}
19+
20+
return null;
21+
}
722
}

0 commit comments

Comments
 (0)