Java 类net.minecraft.client.renderer.block.model.ItemModelGenerator 实例源码
项目:BaseClient
文件:CustomItemProperties.java
public void updateModel(TextureMap p_updateModel_1_, ItemModelGenerator p_updateModel_2_)
{
String[] astring = this.getModelTextures();
boolean flag = this.isUseTint();
this.model = makeBakedModel(p_updateModel_1_, p_updateModel_2_, astring, flag);
if (this.type == 1 && this.mapTextures != null)
{
for (String s : this.mapTextures.keySet())
{
String s1 = (String)this.mapTextures.get(s);
String s2 = StrUtils.removePrefix(s, "texture.");
if (s2.startsWith("bow") || s2.startsWith("fishing_rod"))
{
String[] astring1 = new String[] {s1};
IBakedModel ibakedmodel = makeBakedModel(p_updateModel_1_, p_updateModel_2_, astring1, flag);
if (this.mapModels == null)
{
this.mapModels = new HashMap();
}
this.mapModels.put(s2, ibakedmodel);
}
}
}
}
项目:BaseClient
文件:CustomItemProperties.java
private static IBakedModel makeBakedModel(TextureMap p_makeBakedModel_0_, ItemModelGenerator p_makeBakedModel_1_, String[] p_makeBakedModel_2_, boolean p_makeBakedModel_3_)
{
ModelBlock modelblock = makeModelBlock(p_makeBakedModel_2_);
ModelBlock modelblock1 = p_makeBakedModel_1_.makeItemModel(p_makeBakedModel_0_, modelblock);
IBakedModel ibakedmodel = bakeModel(p_makeBakedModel_0_, modelblock1, p_makeBakedModel_3_);
return ibakedmodel;
}
项目:Backmemed
文件:CustomItemProperties.java
public void updateModel(TextureMap p_updateModel_1_, ItemModelGenerator p_updateModel_2_)
{
String[] astring = this.getModelTextures();
boolean flag = this.isUseTint();
this.model = makeBakedModel(p_updateModel_1_, p_updateModel_2_, astring, flag);
if (this.type == 1 && this.mapTextures != null)
{
for (String s : this.mapTextures.keySet())
{
String s1 = (String)this.mapTextures.get(s);
String s2 = StrUtils.removePrefix(s, "texture.");
if (s2.startsWith("bow") || s2.startsWith("fishing_rod"))
{
String[] astring1 = new String[] {s1};
IBakedModel ibakedmodel = makeBakedModel(p_updateModel_1_, p_updateModel_2_, astring1, flag);
if (this.mapModels == null)
{
this.mapModels = new HashMap();
}
String s3 = "item/" + s2;
this.mapModels.put(s3, ibakedmodel);
}
}
}
}
项目:Backmemed
文件:CustomItemProperties.java
private static IBakedModel makeBakedModel(TextureMap p_makeBakedModel_0_, ItemModelGenerator p_makeBakedModel_1_, String[] p_makeBakedModel_2_, boolean p_makeBakedModel_3_)
{
String[] astring = new String[p_makeBakedModel_2_.length];
for (int i = 0; i < astring.length; ++i)
{
String s = p_makeBakedModel_2_[i];
astring[i] = StrUtils.removePrefix(s, "textures/");
}
ModelBlock modelblock = makeModelBlock(astring);
ModelBlock modelblock1 = p_makeBakedModel_1_.makeItemModel(p_makeBakedModel_0_, modelblock);
IBakedModel ibakedmodel = bakeModel(p_makeBakedModel_0_, modelblock1, p_makeBakedModel_3_);
return ibakedmodel;
}
项目:DecompiledMinecraft
文件:ModelBakery.java
private Set<ResourceLocation> getItemsTextureLocations()
{
Set<ResourceLocation> set = Sets.<ResourceLocation>newHashSet();
for (ResourceLocation resourcelocation : this.itemLocations.values())
{
ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);
if (modelblock != null)
{
set.add(new ResourceLocation(modelblock.resolveTextureName("particle")));
if (this.hasItemModel(modelblock))
{
for (String s : ItemModelGenerator.LAYERS)
{
ResourceLocation resourcelocation2 = new ResourceLocation(modelblock.resolveTextureName(s));
if (modelblock.getRootModel() == MODEL_COMPASS && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameCompass(resourcelocation2.toString());
}
else if (modelblock.getRootModel() == MODEL_CLOCK && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameClock(resourcelocation2.toString());
}
set.add(resourcelocation2);
}
}
else if (!this.isCustomRenderer(modelblock))
{
for (BlockPart blockpart : modelblock.getElements())
{
for (BlockPartFace blockpartface : blockpart.mapFaces.values())
{
ResourceLocation resourcelocation1 = new ResourceLocation(modelblock.resolveTextureName(blockpartface.texture));
set.add(resourcelocation1);
}
}
}
}
}
return set;
}
项目:BaseClient
文件:ModelBakery.java
private Set<ResourceLocation> getItemsTextureLocations()
{
Set<ResourceLocation> set = Sets.<ResourceLocation>newHashSet();
for (ResourceLocation resourcelocation : this.itemLocations.values())
{
ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);
if (modelblock != null)
{
set.add(new ResourceLocation(modelblock.resolveTextureName("particle")));
if (this.hasItemModel(modelblock))
{
for (String s : ItemModelGenerator.LAYERS)
{
ResourceLocation resourcelocation2 = new ResourceLocation(modelblock.resolveTextureName(s));
if (modelblock.getRootModel() == MODEL_COMPASS && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameCompass(resourcelocation2.toString());
}
else if (modelblock.getRootModel() == MODEL_CLOCK && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameClock(resourcelocation2.toString());
}
set.add(resourcelocation2);
}
}
else if (!this.isCustomRenderer(modelblock))
{
for (BlockPart blockpart : modelblock.getElements())
{
for (BlockPartFace blockpartface : blockpart.mapFaces.values())
{
ResourceLocation resourcelocation1 = new ResourceLocation(modelblock.resolveTextureName(blockpartface.texture));
set.add(resourcelocation1);
}
}
}
}
}
return set;
}
项目:BaseClient
文件:ModelBakery.java
private Set<ResourceLocation> getItemsTextureLocations()
{
Set<ResourceLocation> set = Sets.<ResourceLocation>newHashSet();
for (ResourceLocation resourcelocation : this.itemLocations.values())
{
ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);
if (modelblock != null)
{
set.add(new ResourceLocation(modelblock.resolveTextureName("particle")));
if (this.hasItemModel(modelblock))
{
for (String s : ItemModelGenerator.LAYERS)
{
ResourceLocation resourcelocation2 = new ResourceLocation(modelblock.resolveTextureName(s));
if (modelblock.getRootModel() == MODEL_COMPASS && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameCompass(resourcelocation2.toString());
}
else if (modelblock.getRootModel() == MODEL_CLOCK && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2))
{
TextureAtlasSprite.setLocationNameClock(resourcelocation2.toString());
}
set.add(resourcelocation2);
}
}
else if (!this.isCustomRenderer(modelblock))
{
for (BlockPart blockpart : modelblock.getElements())
{
for (BlockPartFace blockpartface : blockpart.mapFaces.values())
{
ResourceLocation resourcelocation1 = new ResourceLocation(modelblock.resolveTextureName(blockpartface.texture));
set.add(resourcelocation1);
}
}
}
}
}
return set;
}