Fixed server crash
This commit is contained in:
parent
91a0d76f46
commit
b0c77d4d22
4 changed files with 74 additions and 67 deletions
|
@ -1,10 +1,15 @@
|
|||
package techreborn.client.texture;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.data.AnimationMetadataSection;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
|
@ -116,4 +121,21 @@ public class CasingConnectedTextureGenerator extends TextureAtlasSprite {
|
|||
this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F);
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta, String[] types) {
|
||||
if (iconRegister instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) iconRegister;
|
||||
String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum);
|
||||
System.out.println(name);
|
||||
TextureAtlasSprite texture = map.getTextureExtry(name);
|
||||
if (texture == null) {
|
||||
texture = new CasingConnectedTextureGenerator(name, types[meta], connectedTexture);
|
||||
map.setTextureEntry(name, texture);
|
||||
}
|
||||
return map.getTextureExtry(name);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package techreborn.client.texture;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.data.AnimationMetadataSection;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
|
@ -121,4 +124,20 @@ public class LesuConnectedTextureGenerator extends TextureAtlasSprite {
|
|||
this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) {
|
||||
if (iconRegister instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) iconRegister;
|
||||
String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + texNum);
|
||||
System.out.println(name);
|
||||
TextureAtlasSprite texture = map.getTextureExtry(name);
|
||||
if (texture == null) {
|
||||
texture = new LesuConnectedTextureGenerator(name, "lesu", connectedTexture);
|
||||
map.setTextureEntry(name, texture);
|
||||
}
|
||||
return map.getTextureExtry(name);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue