本文整理汇总了Java中net.minecraft.tileentity.TileEntityBanner.EnumBannerPattern方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityBanner.EnumBannerPattern方法的具体用法?Java TileEntityBanner.EnumBannerPattern怎么用?Java TileEntityBanner.EnumBannerPattern使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityBanner
的用法示例。
在下文中一共展示了TileEntityBanner.EnumBannerPattern方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInformation
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
/**
* allows items to add custom lines of information to the mouseover description
*/
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
if (nbttagcompound != null && nbttagcompound.hasKey("Patterns"))
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);
for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i)
{
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color"));
TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));
if (tileentitybanner$enumbannerpattern != null)
{
tooltip.add(StatCollector.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName()));
}
}
}
}
示例2: appendHoverTextFromTileEntityTag
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void appendHoverTextFromTileEntityTag(ItemStack stack, List<String> p_185054_1_)
{
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
if (nbttagcompound != null && nbttagcompound.hasKey("Patterns"))
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10);
for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i)
{
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color"));
TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));
if (tileentitybanner$enumbannerpattern != null)
{
p_185054_1_.add(I18n.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName()));
}
}
}
}
示例3: getResourceLocation
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
@Nullable
public ResourceLocation getResourceLocation(String id, List<TileEntityBanner.EnumBannerPattern> patternList, List<EnumDyeColor> colorList)
{
if (id.isEmpty())
{
return null;
}
else
{
id = this.cacheId + id;
BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(id);
if (bannertextures$cacheentry == null)
{
if (this.cacheMap.size() >= 256 && !this.freeCacheSlot())
{
return BannerTextures.BANNER_BASE_TEXTURE;
}
List<String> list = Lists.<String>newArrayList();
for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : patternList)
{
list.add(this.cacheResourceBase + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
}
bannertextures$cacheentry = new BannerTextures.CacheEntry();
bannertextures$cacheentry.textureLocation = new ResourceLocation(id);
Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, colorList));
this.cacheMap.put(id, bannertextures$cacheentry);
}
bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis();
return bannertextures$cacheentry.textureLocation;
}
}
示例4: getResourceLocation
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
@Nullable
public ResourceLocation getResourceLocation(String p_187478_1_, List<TileEntityBanner.EnumBannerPattern> p_187478_2_, List<EnumDyeColor> p_187478_3_)
{
if (p_187478_1_.isEmpty())
{
return null;
}
else
{
p_187478_1_ = this.cacheId + p_187478_1_;
BannerTextures.CacheEntry bannertextures$cacheentry = (BannerTextures.CacheEntry)this.cacheMap.get(p_187478_1_);
if (bannertextures$cacheentry == null)
{
if (this.cacheMap.size() >= 256 && !this.freeCacheSlot())
{
return BannerTextures.BANNER_BASE_TEXTURE;
}
List<String> list = Lists.<String>newArrayList();
for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : p_187478_2_)
{
list.add(this.cacheResourceBase + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
}
bannertextures$cacheentry = new BannerTextures.CacheEntry();
bannertextures$cacheentry.textureLocation = new ResourceLocation(p_187478_1_);
Minecraft.getMinecraft().getTextureManager().loadTexture(bannertextures$cacheentry.textureLocation, new LayeredColorMaskTexture(this.cacheResourceLocation, list, p_187478_3_));
this.cacheMap.put(p_187478_1_, bannertextures$cacheentry);
}
bannertextures$cacheentry.lastUseMillis = System.currentTimeMillis();
return bannertextures$cacheentry.textureLocation;
}
}
示例5: func_178463_a
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
private ResourceLocation func_178463_a(TileEntityBanner bannerObj)
{
String s = bannerObj.func_175116_e();
if (s.isEmpty())
{
return null;
}
else
{
TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s);
if (tileentitybannerrenderer$timedbannertexture == null)
{
if (DESIGNS.size() >= 256)
{
long i = System.currentTimeMillis();
Iterator<String> iterator = DESIGNS.keySet().iterator();
while (iterator.hasNext())
{
String s1 = (String)iterator.next();
TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture1 = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s1);
if (i - tileentitybannerrenderer$timedbannertexture1.systemTime > 60000L)
{
Minecraft.getMinecraft().getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.bannerTexture);
iterator.remove();
}
}
if (DESIGNS.size() >= 256)
{
return null;
}
}
List<TileEntityBanner.EnumBannerPattern> list1 = bannerObj.getPatternList();
List<EnumDyeColor> list = bannerObj.getColorList();
List<String> list2 = Lists.<String>newArrayList();
for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1)
{
list2.add("textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png");
}
tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture();
tileentitybannerrenderer$timedbannertexture.bannerTexture = new ResourceLocation(s);
Minecraft.getMinecraft().getTextureManager().loadTexture(tileentitybannerrenderer$timedbannertexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list));
DESIGNS.put(s, tileentitybannerrenderer$timedbannertexture);
}
tileentitybannerrenderer$timedbannertexture.systemTime = System.currentTimeMillis();
return tileentitybannerrenderer$timedbannertexture.bannerTexture;
}
}
示例6: getCraftingResult
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
/**
* Returns an Item that is the result of this recipe
*/
@Nullable
public ItemStack getCraftingResult(InventoryCrafting inv)
{
ItemStack itemstack = null;
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack1 = inv.getStackInSlot(i);
if (itemstack1 != null && itemstack1.getItem() == Items.BANNER)
{
itemstack = itemstack1.copy();
itemstack.stackSize = 1;
break;
}
}
TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = this.matchPatterns(inv);
if (tileentitybanner$enumbannerpattern != null)
{
int k = 0;
for (int j = 0; j < inv.getSizeInventory(); ++j)
{
ItemStack itemstack2 = inv.getStackInSlot(j);
int color = getColor(itemstack2);
if (color != -1)
{
k = color;
break;
}
}
NBTTagCompound nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
NBTTagList nbttaglist;
if (nbttagcompound1.hasKey("Patterns", 9))
{
nbttaglist = nbttagcompound1.getTagList("Patterns", 10);
}
else
{
nbttaglist = new NBTTagList();
nbttagcompound1.setTag("Patterns", nbttaglist);
}
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID());
nbttagcompound.setInteger("Color", k);
nbttaglist.appendTag(nbttagcompound);
}
return itemstack;
}