Add in simple texture management for mods using the stitcher. Scope with "{domain}:{texture}" to

get textures that are not at /textures/<item|block>/{texture}.png but /mods/{domain}/textures/<item|block>/{texture}.png
instead
This commit is contained in:
Christian 2013-03-03 14:11:31 -05:00
parent 72e013fb66
commit 59b8e5e93c
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,25 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java
@@ -66,15 +66,20 @@
public List func_94266_e(String par1Str)
{
+ return createNewTexture(par1Str, par1Str);
+ }
+ public List createNewTexture(String textureName, String textureFile)
+ {
+ String par1Str = textureFile;
ArrayList arraylist = new ArrayList();
ITexturePack itexturepack = Minecraft.getMinecraft().texturePackList.getSelectedTexturePack();
try
{
- BufferedImage bufferedimage = ImageIO.read(itexturepack.getResourceAsStream("/" + par1Str));
+ BufferedImage bufferedimage = ImageIO.read(itexturepack.getResourceAsStream("/" + textureFile));
int i = bufferedimage.getHeight();
int j = bufferedimage.getWidth();
- String s1 = this.func_98146_d(par1Str);
+ String s1 = textureName;
if (this.func_98147_a(par1Str, itexturepack))
{

View File

@ -0,0 +1,23 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
@@ -95,8 +95,18 @@
while (iterator.hasNext())
{
String s = (String)iterator.next();
- String s1 = this.field_94254_c + s + this.field_94251_d;
- List list = TextureManager.func_94267_b().func_94266_e(s1);
+ String s1;
+ if (s.indexOf(':')==-1)
+ {
+ s1 = this.field_94254_c + s + this.field_94251_d;
+ }
+ else
+ {
+ String domain = s.substring(0,s.indexOf(':'));
+ String file = s.substring(s.indexOf(':')+1);
+ s1 = "mods/"+domain +"/" + this.field_94254_c + file + this.field_94251_d;
+ }
+ List list = TextureManager.func_94267_b().createNewTexture(s, s1);
if (!list.isEmpty())
{