本文整理汇总了Java中net.minecraft.util.IIcon类的典型用法代码示例。如果您正苦于以下问题:Java IIcon类的具体用法?Java IIcon怎么用?Java IIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IIcon类属于net.minecraft.util包,在下文中一共展示了IIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
private void renderIcon(IIcon icon) {
Tessellator tessellator = Tessellator.instance;
float minU = icon.getMinU();
float maxU = icon.getMaxU();
float minV = icon.getMinV();
float maxV = icon.getMaxV();
OpenGLHelper.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
OpenGLHelper.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(-0.5F, -0.25F, 0.0D, minU, maxV);
tessellator.addVertexWithUV(0.5F, -0.25F, 0.0D, maxU, maxV);
tessellator.addVertexWithUV(0.5F, 0.75F, 0.0D, maxU, minV);
tessellator.addVertexWithUV(-0.5F, 0.75F, 0.0D, minU, minV);
tessellator.draw();
}
示例2: isValidItemState
import net.minecraft.util.IIcon; //导入依赖的package包/类
/**
* Resolve item state validity
* @param meta Item metadata
* @return Is item state valid
*/
@SuppressWarnings({"ConstantConditions"})
public boolean isValidItemState(int meta) {
if (!isValid()) {
return false;
}
try {
IIcon sprite = item.getIconFromDamage(meta);
return sprite != null &&
sprite.getIconName() != null &&
!sprite.getIconName().equalsIgnoreCase("") &&
!sprite.getIconName().equalsIgnoreCase("missingno");
} catch (Throwable ignored) {
return false;
}
}
示例3: getTextures
import net.minecraft.util.IIcon; //导入依赖的package包/类
private static String getTextures(Block block, int damage) {
List<String> allTextures = new ArrayList<String>();
String[] sides = new String[]{"top", "bottom", "north", "south", "east", "west"};
for (int index = 0; index < sides.length; index++) {
try {
IIcon icon = block.getIcon(index, damage);
if (icon != null) {
allTextures.add(icon.getIconName());
}
} catch (Exception e) {
System.out.println(String.format("Unable to get texture for block %s side %s",
block.getLocalizedName(), index));
allTextures.add("EXCEPTION");
}
}
if (allTextures.isEmpty()) {
return "empty";
}
return String.join(",", allTextures);
}
示例4: getIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
if (meta == 0 && side == 3)
{
return front;
}
if (side == 1)
{
return top;
}
return side != meta ? this.blockIcon : front;
}
示例5: postStitch
import net.minecraft.util.IIcon; //导入依赖的package包/类
@SubscribeEvent
public void postStitch(TextureStitchEvent.Post event)
{
IIcon[] icons;
if(replaceLava)
{
icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_lava);
icons[0] = newTextures[2];
icons[1] = newTextures[3];
icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.lava);
icons[0] = newTextures[2];
icons[1] = newTextures[3];
}
if(replaceWater)
{
icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_water);
icons[0] = newTextures[0];
icons[1] = newTextures[1];
icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.water);
icons[0] = newTextures[0];
icons[1] = newTextures[1];
}
}
示例6: getIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int i, int par2) {
if (i == 0)
return gor;
else if (i == 1)
return dol;
else if (i == 2)
return st1;
else if (i == 3)
return st2;
else if (i == 4)
return st4;
else if (i == 5)
return st3;
else
return gor;
}
示例7: addBlockHitEffects
import net.minecraft.util.IIcon; //导入依赖的package包/类
public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, IIcon icon, EffectRenderer effectRenderer)
{
float border = 0.1F;
Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2*border);
diff.x*=world.rand.nextDouble();
diff.y*=world.rand.nextDouble();
diff.z*=world.rand.nextDouble();
Vector3 pos = diff.add(bounds.min).add(border);
if (side == 0)
diff.y = bounds.min.y - border;
if (side == 1)
diff.y = bounds.max.y + border;
if (side == 2)
diff.z = bounds.min.z - border;
if (side == 3)
diff.z = bounds.max.z + border;
if (side == 4)
diff.x = bounds.min.x - border;
if (side == 5)
diff.x = bounds.max.x + border;
effectRenderer.addEffect(
new EntityDigIconFX(world, pos.x, pos.y, pos.z, 0, 0, 0, icon)
.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
示例8: handleStich
import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void handleStich(final TextureStitchEvent.Pre event) {
if (event.map.getTextureType() != 0) {
return;
}
TConIntegration.bedrock.setIcons(event.map.registerIcon("TConIntegration.bedrock"));
TextureAtlasSprite sprite = new TextureBedrockLava("extrautils:bedrockFluid", "lava_still");
event.map.setTextureEntry("extrautils:bedrockFluid", sprite);
if (TConIntegration.bedrock != null) {
TConIntegration.bedrock.setIcons((IIcon)sprite);
}
sprite = new TextureBedrockLava("extrautils:bedrockFluid_flowing", "lava_flow");
if (event.map.setTextureEntry("extrautils:bedrockFluid_flowing", sprite) && TConIntegration.bedrock != null) {
TConIntegration.bedrock.setFlowingIcon((IIcon)sprite);
}
sprite = new TextureUnstableLava("extrautils:unstableFluid", "water_still");
event.map.setTextureEntry("extrautils:unstableFluid", sprite);
if (TConIntegration.unstable != null) {
TConIntegration.unstable.setIcons((IIcon)sprite);
}
sprite = new TextureUnstableLava("extrautils:unstableFluid_flowing", "water_flow");
if (event.map.setTextureEntry("extrautils:unstableFluid_flowing", sprite) && TConIntegration.unstable != null) {
TConIntegration.unstable.setFlowingIcon((IIcon)sprite);
}
}
示例9: getIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2)
{
if (par2 >= BlockAirLockFrame.METADATA_AIR_LOCK_CONTROLLER)
{
if (par1 == ForgeDirection.UP.ordinal() || par1 == ForgeDirection.DOWN.ordinal())
{
return this.airLockIcons[0];
}
return this.airLockIcons[7];
}
else
{
return this.airLockIcons[0];
}
}
示例10: getIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
public IIcon getIcon(int side, int meta) {
switch (meta) {
case 1:
return OnePlayerIcon;
case 2:
return TwoPlayersIcon;
case 3:
return ThreePlayersIcon;
case 4:
return FourPlayersIcon;
default:
return LobbyIcon;
}
}
示例11: renderInventoryBlock
import net.minecraft.util.IIcon; //导入依赖的package包/类
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, IIcon icon) {
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
示例12: setIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void setIcon(int index, IIcon icon) {
if (icons == null)
icons = new IIcon[types.length];
icons[index] = icon;
}
示例13: registerBlockIcons
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
if (icons == null)
icons = new IIcon[types.length];
for (int i = 1; i < types.length; i++)
if ("".equals(types[i]))
icons[i] = reg.registerIcon(getTextureName());
else
icons[i] = reg.registerIcon(getTextureName() + "_" + types[i]);
}
示例14: registerBlockIcons
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
icons = new IIcon[types.length];
for (int i = 0; i < types.length; i++)
if ("".equals(types[i]))
icons[i] = reg.registerIcon(getTextureName());
else
icons[i] = reg.registerIcon(getTextureName() + "_" + types[i]);
}
示例15: getIcon
import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if (meta < 0 || meta >= icons.length)
meta = 0;
return icons[meta];
}