当前位置: 首页>>代码示例>>Java>>正文


Java Direction.offsetX方法代码示例

本文整理汇总了Java中net.minecraft.util.Direction.offsetX方法的典型用法代码示例。如果您正苦于以下问题:Java Direction.offsetX方法的具体用法?Java Direction.offsetX怎么用?Java Direction.offsetX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.util.Direction的用法示例。


在下文中一共展示了Direction.offsetX方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_147453_f

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_)
{
    for (int var5 = 0; var5 < 4; ++var5)
    {
        int var6 = p_147453_1_ + Direction.offsetX[var5];
        int var7 = p_147453_3_ + Direction.offsetZ[var5];
        Block var8 = this.getBlock(var6, p_147453_2_, var7);

        if (Blocks.unpowered_comparator.func_149907_e(var8))
        {
            var8.onNeighborBlockChange(this, var6, p_147453_2_, var7, p_147453_4_);
        }
        else if (var8.isNormalCube())
        {
            var6 += Direction.offsetX[var5];
            var7 += Direction.offsetZ[var5];
            Block var9 = this.getBlock(var6, p_147453_2_, var7);

            if (Blocks.unpowered_comparator.func_149907_e(var9))
            {
                var9.onNeighborBlockChange(this, var6, p_147453_2_, var7, p_147453_4_);
            }
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:World.java

示例2: func_150139_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_)
{
    int var6 = p_150139_1_ + Direction.offsetX[p_150139_5_];
    int var8 = p_150139_3_ + Direction.offsetZ[p_150139_5_];
    Block var9 = p_150139_0_.getBlock(var6, p_150139_2_, var8);
    boolean var10 = (p_150139_4_ & 2) == 2;
    int var11;

    if (var9 == Blocks.tripwire_hook)
    {
        var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8);
        int var13 = var11 & 3;
        return var13 == Direction.rotateOpposite[p_150139_5_];
    }
    else if (var9 == Blocks.tripwire)
    {
        var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8);
        boolean var12 = (var11 & 2) == 2;
        return var10 == var12;
    }
    else
    {
        return false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:BlockTripWire.java

示例3: func_149903_h

import net.minecraft.util.Direction; //导入方法依赖的package包/类
protected int func_149903_h(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_)
{
    int var6 = super.func_149903_h(p_149903_1_, p_149903_2_, p_149903_3_, p_149903_4_, p_149903_5_);
    int var7 = func_149895_l(p_149903_5_);
    int var8 = p_149903_2_ + Direction.offsetX[var7];
    int var9 = p_149903_4_ + Direction.offsetZ[var7];
    Block var10 = p_149903_1_.getBlock(var8, p_149903_3_, var9);

    if (var10.hasComparatorInputOverride())
    {
        var6 = var10.getComparatorInputOverride(p_149903_1_, var8, p_149903_3_, var9, Direction.rotateOpposite[var7]);
    }
    else if (var6 < 15 && var10.isNormalCube())
    {
        var8 += Direction.offsetX[var7];
        var9 += Direction.offsetZ[var7];
        var10 = p_149903_1_.getBlock(var8, p_149903_3_, var9);

        if (var10.hasComparatorInputOverride())
        {
            var6 = var10.getComparatorInputOverride(p_149903_1_, var8, p_149903_3_, var9, Direction.rotateOpposite[var7]);
        }
    }

    return var6;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:27,代码来源:BlockRedstoneComparator.java

示例4: doRender

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
 */
public void doRender(EntityItemFrame par1EntityItemFrame, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    double var10 = par1EntityItemFrame.posX - par2 - 0.5D;
    double var12 = par1EntityItemFrame.posY - par4 - 0.5D;
    double var14 = par1EntityItemFrame.posZ - par6 - 0.5D;
    int var16 = par1EntityItemFrame.field_146063_b + Direction.offsetX[par1EntityItemFrame.hangingDirection];
    int var17 = par1EntityItemFrame.field_146064_c;
    int var18 = par1EntityItemFrame.field_146062_d + Direction.offsetZ[par1EntityItemFrame.hangingDirection];
    GL11.glTranslated((double)var16 - var10, (double)var17 - var12, (double)var18 - var14);

    if (par1EntityItemFrame.getDisplayedItem() != null && par1EntityItemFrame.getDisplayedItem().getItem() == Items.filled_map)
    {
        this.func_147915_b(par1EntityItemFrame);
    }
    else
    {
        this.renderFrameItemAsBlock(par1EntityItemFrame);
    }

    this.func_82402_b(par1EntityItemFrame);
    GL11.glPopMatrix();
    this.func_147914_a(par1EntityItemFrame, par2 + (double)((float)Direction.offsetX[par1EntityItemFrame.hangingDirection] * 0.3F), par4 - 0.25D, par6 + (double)((float)Direction.offsetZ[par1EntityItemFrame.hangingDirection] * 0.3F));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:RenderItemFrame.java

示例5: doRender

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public void doRender(EntityItemFrame p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
    GL11.glPushMatrix();
    double d3 = p_76986_1_.posX - p_76986_2_ - 0.5D;
    double d4 = p_76986_1_.posY - p_76986_4_ - 0.5D;
    double d5 = p_76986_1_.posZ - p_76986_6_ - 0.5D;
    int i = p_76986_1_.field_146063_b + Direction.offsetX[p_76986_1_.hangingDirection];
    int j = p_76986_1_.field_146064_c;
    int k = p_76986_1_.field_146062_d + Direction.offsetZ[p_76986_1_.hangingDirection];
    GL11.glTranslated((double)i - d3, (double)j - d4, (double)k - d5);

    if (p_76986_1_.getDisplayedItem() != null && p_76986_1_.getDisplayedItem().getItem() == Items.filled_map)
    {
        this.func_147915_b(p_76986_1_);
    }
    else
    {
        this.renderFrameItemAsBlock(p_76986_1_);
    }

    this.func_82402_b(p_76986_1_);
    GL11.glPopMatrix();
    this.func_147914_a(p_76986_1_, p_76986_2_ + (double)((float)Direction.offsetX[p_76986_1_.hangingDirection] * 0.3F), p_76986_4_ - 0.25D, p_76986_6_ + (double)((float)Direction.offsetZ[p_76986_1_.hangingDirection] * 0.3F));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:25,代码来源:RenderItemFrame.java

示例6: func_72148_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5)
{
    int j1 = par1 + Direction.offsetX[par5];
    int k1 = par3 + Direction.offsetZ[par5];
    int l1 = par0IBlockAccess.getBlockId(j1, par2, k1);
    boolean flag = (par4 & 2) == 2;
    int i2;

    if (l1 == Block.tripWireSource.blockID)
    {
        i2 = par0IBlockAccess.getBlockMetadata(j1, par2, k1);
        int j2 = i2 & 3;
        return j2 == Direction.rotateOpposite[par5];
    }
    else if (l1 == Block.tripWire.blockID)
    {
        i2 = par0IBlockAccess.getBlockMetadata(j1, par2, k1);
        boolean flag1 = (i2 & 2) == 2;
        return flag == flag1;
    }
    else
    {
        return false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:BlockTripWire.java

示例7: func_72148_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public static boolean func_72148_a(IBlockAccess world, int x, int y, int z, int l, int i) {
	int j1 = x + Direction.offsetX[i];
       int k1 = z + Direction.offsetZ[i];
       Block l1 = world.getBlock(j1, y, k1);
       boolean flag = (l & 2) == 2;
       
       int i2;

       if (l1 == BlockLaserBeamSource.instance)
       {
       	i2 = world.getBlockMetadata(j1, y, k1);
           int j2 = i2 & 3;
           return j2 == Direction.rotateOpposite[i];
           //return true;
       }
       else if (l1 == BlockLaserBeam.instance)
       {
           i2 = world.getBlockMetadata(j1, y, k1);
           boolean flag1 = (i2 & 2) == 2;
           return flag == flag1;
       }
       else
       {
           return false;
       }
}
 
开发者ID:Draco18s,项目名称:Artifacts,代码行数:27,代码来源:BlockLaserBeam.java

示例8: Size

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_)
{
	this.worldObj = p_i45415_1_;
	this.field_150865_b = p_i45415_5_;
	this.field_150863_d = BlockEpicProportionsPortal.field_150001_a[p_i45415_5_][0];
	this.field_150866_c = BlockEpicProportionsPortal.field_150001_a[p_i45415_5_][1];

	for (int i1 = p_i45415_3_; p_i45415_3_ > i1 - 21 && p_i45415_3_ > 0 && this.getBlockMaterial(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_)
	{
		;
	}

	int j1 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1;

	if (j1 >= 0)
	{
		this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + j1 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + j1 * Direction.offsetZ[this.field_150863_d]);
		this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c);

		if (this.field_150868_h < 2 || this.field_150868_h > 21)
		{
			this.field_150861_f = null;
			this.field_150868_h = 0;
		}
	}

	if (this.field_150861_f != null)
	{
		this.field_150862_g = this.func_150858_a();
	}
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:32,代码来源:BlockEpicProportionsPortal.java

示例9: func_150853_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
protected int func_150853_a(int x, int y, int z, int p_150853_4_)
{
	int j1 = Direction.offsetX[p_150853_4_];
	int k1 = Direction.offsetZ[p_150853_4_];
	int i1;
	Block block;

	for (i1 = 0; i1 < 22; ++i1)
	{
		block = this.worldObj.getBlock(x + j1 * i1, y, z + k1 * i1);

		if (!this.getBlockMaterial(block))
		{
			break;
		}

		Block block1 = this.worldObj.getBlock(x + j1 * i1, y - 1, z + k1 * i1);

		if (block1 != Blocks.stone)
		{
			break;
		}
	}

	block = this.worldObj.getBlock(x + j1 * i1, y, z + k1 * i1);
	return block == Blocks.stone ? i1 : 0;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:28,代码来源:BlockEpicProportionsPortal.java

示例10: func_150859_c

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public void func_150859_c()
{
	for (int i = 0; i < this.field_150868_h; ++i)
	{
		int j = this.field_150861_f.posX + Direction.offsetX[this.field_150866_c] * i;
		int k = this.field_150861_f.posZ + Direction.offsetZ[this.field_150866_c] * i;

		for (int l = 0; l < this.field_150862_g; ++l)
		{
			int i1 = this.field_150861_f.posY + l;
			this.worldObj.setBlock(j, i1, k, BlockLoader.BlockEpicProportionsPortal, this.field_150865_b, 2);
		}
	}
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:15,代码来源:BlockEpicProportionsPortal.java

示例11: func_149903_h

import net.minecraft.util.Direction; //导入方法依赖的package包/类
protected int func_149903_h(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_)
{
    int var6 = func_149895_l(p_149903_5_);
    int var7 = p_149903_2_ + Direction.offsetX[var6];
    int var8 = p_149903_4_ + Direction.offsetZ[var6];
    int var9 = p_149903_1_.getIndirectPowerLevelTo(var7, p_149903_3_, var8, Direction.directionToFacing[var6]);
    return var9 >= 15 ? var9 : Math.max(var9, p_149903_1_.getBlock(var7, p_149903_3_, var8) == Blocks.redstone_wire ? p_149903_1_.getBlockMetadata(var7, p_149903_3_, var8) : 0);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:9,代码来源:BlockRedstoneDiode.java

示例12: Size

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_)
{
    this.field_150867_a = p_i45415_1_;
    this.field_150865_b = p_i45415_5_;
    this.field_150863_d = BlockPortal.field_150001_a[p_i45415_5_][0];
    this.field_150866_c = BlockPortal.field_150001_a[p_i45415_5_][1];

    for (int var6 = p_i45415_3_; p_i45415_3_ > var6 - 21 && p_i45415_3_ > 0 && this.func_150857_a(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_)
    {
        ;
    }

    int var7 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1;

    if (var7 >= 0)
    {
        this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + var7 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + var7 * Direction.offsetZ[this.field_150863_d]);
        this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c);

        if (this.field_150868_h < 2 || this.field_150868_h > 21)
        {
            this.field_150861_f = null;
            this.field_150868_h = 0;
        }
    }

    if (this.field_150861_f != null)
    {
        this.field_150862_g = this.func_150858_a();
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:32,代码来源:BlockPortal.java

示例13: func_150853_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
protected int func_150853_a(int p_150853_1_, int p_150853_2_, int p_150853_3_, int p_150853_4_)
{
    int var6 = Direction.offsetX[p_150853_4_];
    int var7 = Direction.offsetZ[p_150853_4_];
    int var5;
    Block var8;

    for (var5 = 0; var5 < 22; ++var5)
    {
        var8 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_, p_150853_3_ + var7 * var5);

        if (!this.func_150857_a(var8))
        {
            break;
        }

        Block var9 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_ - 1, p_150853_3_ + var7 * var5);

        if (var9 != Blocks.obsidian)
        {
            break;
        }
    }

    var8 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_, p_150853_3_ + var7 * var5);
    return var8 == Blocks.obsidian ? var5 : 0;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:28,代码来源:BlockPortal.java

示例14: func_150859_c

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public void func_150859_c()
{
    for (int var1 = 0; var1 < this.field_150868_h; ++var1)
    {
        int var2 = this.field_150861_f.posX + Direction.offsetX[this.field_150866_c] * var1;
        int var3 = this.field_150861_f.posZ + Direction.offsetZ[this.field_150866_c] * var1;

        for (int var4 = 0; var4 < this.field_150862_g; ++var4)
        {
            int var5 = this.field_150861_f.posY + var4;
            this.field_150867_a.setBlock(var2, var5, var3, Blocks.portal, this.field_150865_b, 2);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:15,代码来源:BlockPortal.java

示例15: func_150138_a

import net.minecraft.util.Direction; //导入方法依赖的package包/类
private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_)
{
    int var6 = 0;

    while (var6 < 2)
    {
        int var7 = 1;

        while (true)
        {
            if (var7 < 42)
            {
                int var8 = p_150138_2_ + Direction.offsetX[var6] * var7;
                int var9 = p_150138_4_ + Direction.offsetZ[var6] * var7;
                Block var10 = p_150138_1_.getBlock(var8, p_150138_3_, var9);

                if (var10 == Blocks.tripwire_hook)
                {
                    int var11 = p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9) & 3;

                    if (var11 == Direction.rotateOpposite[var6])
                    {
                        Blocks.tripwire_hook.func_150136_a(p_150138_1_, var8, p_150138_3_, var9, false, p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9), true, var7, p_150138_5_);
                    }
                }
                else if (var10 == Blocks.tripwire)
                {
                    ++var7;
                    continue;
                }
            }

            ++var6;
            break;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:38,代码来源:BlockTripWire.java


注:本文中的net.minecraft.util.Direction.offsetX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。