當前位置: 首頁>>代碼示例>>Java>>正文


Java TileEntitySign.getBlockMetadata方法代碼示例

本文整理匯總了Java中net.minecraft.tileentity.TileEntitySign.getBlockMetadata方法的典型用法代碼示例。如果您正苦於以下問題:Java TileEntitySign.getBlockMetadata方法的具體用法?Java TileEntitySign.getBlockMetadata怎麽用?Java TileEntitySign.getBlockMetadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.tileentity.TileEntitySign的用法示例。


在下文中一共展示了TileEntitySign.getBlockMetadata方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSignRotate

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public @Nonnull Quat4f getSignRotate(final @Nonnull TileEntitySign tile) {
	// Vanilla Translate
	final Block block = tile.getBlockType();
	if (block==Blocks.standing_sign) {
		final float f2 = tile.getBlockMetadata()*360f/16f;
		return RotationMath.quatDeg(-f2, 0f, 1f, 0f);
	} else {
		final int j = tile.getBlockMetadata();
		float f3;
		switch (j) {
			case 2:
				f3 = 180f;
				break;
			case 4:
				f3 = 90f;
				break;
			case 5:
				f3 = -90f;
				break;
			default:
				f3 = 0f;
				break;
		}
		return RotationMath.quatDeg(-f3, 0f, 1f, 0f);
	}
}
 
開發者ID:Team-Fruit,項目名稱:SignPicture,代碼行數:27,代碼來源:CustomTileEntitySignRenderer.java

示例2: renderTileEntityAt

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntitySign p_147512_1_, double p_147512_2_, double p_147512_4_, double p_147512_6_, float p_147512_8_)
{
    Block var9 = p_147512_1_.getBlockType();
    GL11.glPushMatrix();
    float var10 = 0.6666667F;
    float var12;

    if (var9 == Blocks.standing_sign)
    {
        GL11.glTranslatef((float)p_147512_2_ + 0.5F, (float)p_147512_4_ + 0.75F * var10, (float)p_147512_6_ + 0.5F);
        float var11 = (float)(p_147512_1_.getBlockMetadata() * 360) / 16.0F;
        GL11.glRotatef(-var11, 0.0F, 1.0F, 0.0F);
        this.field_147514_c.signStick.showModel = true;
    }
    else
    {
        int var16 = p_147512_1_.getBlockMetadata();
        var12 = 0.0F;

        if (var16 == 2)
        {
            var12 = 180.0F;
        }

        if (var16 == 4)
        {
            var12 = 90.0F;
        }

        if (var16 == 5)
        {
            var12 = -90.0F;
        }

        GL11.glTranslatef((float)p_147512_2_ + 0.5F, (float)p_147512_4_ + 0.75F * var10, (float)p_147512_6_ + 0.5F);
        GL11.glRotatef(-var12, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.3125F, -0.4375F);
        this.field_147514_c.signStick.showModel = false;
    }

    this.bindTexture(field_147513_b);
    GL11.glPushMatrix();
    GL11.glScalef(var10, -var10, -var10);
    this.field_147514_c.renderSign();
    GL11.glPopMatrix();
    FontRenderer var17 = this.func_147498_b();
    var12 = 0.016666668F * var10;
    GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10);
    GL11.glScalef(var12, -var12, var12);
    GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12);
    GL11.glDepthMask(false);
    byte var13 = 0;

    for (int var14 = 0; var14 < p_147512_1_.field_145915_a.length; ++var14)
    {
        String var15 = p_147512_1_.field_145915_a[var14];

        if (var14 == p_147512_1_.field_145918_i)
        {
            var15 = "> " + var15 + " <";
            var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - p_147512_1_.field_145915_a.length * 5, var13);
        }
        else
        {
            var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - p_147512_1_.field_145915_a.length * 5, var13);
        }
    }

    GL11.glDepthMask(true);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glPopMatrix();
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:73,代碼來源:TileEntitySignRenderer.java

示例3: renderTileEntityAt

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntitySign p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_)
{
    Block block = p_147500_1_.getBlockType();
    GL11.glPushMatrix();
    float f1 = 0.6666667F;
    float f3;

    if (block == Blocks.standing_sign)
    {
        GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * f1, (float)p_147500_6_ + 0.5F);
        float f2 = (float)(p_147500_1_.getBlockMetadata() * 360) / 16.0F;
        GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
        this.field_147514_c.signStick.showModel = true;
    }
    else
    {
        int j = p_147500_1_.getBlockMetadata();
        f3 = 0.0F;

        if (j == 2)
        {
            f3 = 180.0F;
        }

        if (j == 4)
        {
            f3 = 90.0F;
        }

        if (j == 5)
        {
            f3 = -90.0F;
        }

        GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * f1, (float)p_147500_6_ + 0.5F);
        GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.3125F, -0.4375F);
        this.field_147514_c.signStick.showModel = false;
    }

    this.bindTexture(field_147513_b);
    GL11.glPushMatrix();
    GL11.glScalef(f1, -f1, -f1);
    this.field_147514_c.renderSign();
    GL11.glPopMatrix();
    FontRenderer fontrenderer = this.func_147498_b();
    f3 = 0.016666668F * f1;
    GL11.glTranslatef(0.0F, 0.5F * f1, 0.07F * f1);
    GL11.glScalef(f3, -f3, f3);
    GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3);
    GL11.glDepthMask(false);
    byte b0 = 0;

    for (int i = 0; i < p_147500_1_.signText.length; ++i)
    {
        String s = p_147500_1_.signText[i];

        if (i == p_147500_1_.lineBeingEdited)
        {
            s = "> " + s + " <";
            fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, i * 10 - p_147500_1_.signText.length * 5, b0);
        }
        else
        {
            fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, i * 10 - p_147500_1_.signText.length * 5, b0);
        }
    }

    GL11.glDepthMask(true);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glPopMatrix();
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:73,代碼來源:TileEntitySignRenderer.java

示例4: renderTileEntitySignAt

import net.minecraft.tileentity.TileEntitySign; //導入方法依賴的package包/類
public void renderTileEntitySignAt(TileEntitySign par1TileEntitySign, double par2, double par4, double par6, float par8)
{
    Block block = par1TileEntitySign.getBlockType();
    GL11.glPushMatrix();
    float f1 = 0.6666667F;
    float f2;

    if (block == Block.signPost)
    {
        GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * f1, (float)par6 + 0.5F);
        float f3 = (float)(par1TileEntitySign.getBlockMetadata() * 360) / 16.0F;
        GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F);
        this.modelSign.signStick.showModel = true;
    }
    else
    {
        int i = par1TileEntitySign.getBlockMetadata();
        f2 = 0.0F;

        if (i == 2)
        {
            f2 = 180.0F;
        }

        if (i == 4)
        {
            f2 = 90.0F;
        }

        if (i == 5)
        {
            f2 = -90.0F;
        }

        GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * f1, (float)par6 + 0.5F);
        GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.3125F, -0.4375F);
        this.modelSign.signStick.showModel = false;
    }

    this.bindTexture(field_110638_a);
    GL11.glPushMatrix();
    GL11.glScalef(f1, -f1, -f1);
    this.modelSign.renderSign();
    GL11.glPopMatrix();
    FontRenderer fontrenderer = this.getFontRenderer();
    f2 = 0.016666668F * f1;
    GL11.glTranslatef(0.0F, 0.5F * f1, 0.07F * f1);
    GL11.glScalef(f2, -f2, f2);
    GL11.glNormal3f(0.0F, 0.0F, -1.0F * f2);
    GL11.glDepthMask(false);
    byte b0 = 0;

    for (int j = 0; j < par1TileEntitySign.signText.length; ++j)
    {
        String s = par1TileEntitySign.signText[j];

        if (j == par1TileEntitySign.lineBeingEdited)
        {
            s = "> " + s + " <";
            fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, j * 10 - par1TileEntitySign.signText.length * 5, b0);
        }
        else
        {
            fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, j * 10 - par1TileEntitySign.signText.length * 5, b0);
        }
    }

    GL11.glDepthMask(true);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glPopMatrix();
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:73,代碼來源:TileEntitySignRenderer.java


注:本文中的net.minecraft.tileentity.TileEntitySign.getBlockMetadata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。