-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathEmptyTexture.java
More file actions
42 lines (32 loc) · 1.29 KB
/
EmptyTexture.java
File metadata and controls
42 lines (32 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package eu.midnightdust.customsplashscreen.texture;
import net.minecraft.client.resource.metadata.TextureResourceMetadata;
import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.ResourceTexture;
import net.minecraft.client.texture.TextureContents;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import java.io.IOException;
import java.io.InputStream;
public class EmptyTexture extends ResourceTexture {
// Empty texture used for hiding the default mojang logo when using other logo styles //
public EmptyTexture(Identifier location) {
super(location);
}
@Override
public TextureContents loadContents(ResourceManager resourceManager) {
try {
InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("empty.png");
TextureContents texture = null;
if( input != null ) {
try {
texture = new TextureContents(NativeImage.read(input), new TextureResourceMetadata(true, true));
} finally {
input.close();
}
}
return texture;
} catch (IOException var18) {
return TextureContents.createMissing();
}
}
}