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


Java BlockPos.ORIGIN属性代码示例

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


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

示例1: updateVillageRadiusAndCenter

private void updateVillageRadiusAndCenter()
{
    int i = this.villageDoorInfoList.size();

    if (i == 0)
    {
        this.center = BlockPos.ORIGIN;
        this.villageRadius = 0;
    }
    else
    {
        this.center = new BlockPos(this.centerHelper.getX() / i, this.centerHelper.getY() / i, this.centerHelper.getZ() / i);
        int j = 0;

        for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList)
        {
            j = Math.max(villagedoorinfo.getDistanceToDoorBlockSq(this.center), j);
        }

        this.villageRadius = Math.max(32, (int)Math.sqrt((double)j) + 1);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:Village.java

示例2: update

@Override
public void update()
{
    Entity ent = Minecraft.getMinecraft().getRenderViewEntity();
    if(ent != null)
    {
        BlockPos closest = BlockPos.ORIGIN;
        double dist = 1000000D;
        for(TileEntityGlassBase base : placement.activeBlocks)
        {
            double d0 = ent.posX - (base.getPos().getX() + 0.5D);
            double d1 = ent.posY + ent.getEyeHeight() - (base.getPos().getY() + 0.5D);
            double d2 = ent.posZ - (base.getPos().getZ() + 0.5D);
            double dista = (double)MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
            if(dista < dist)
            {
                dist = dista;
                closest = base.getPos();
            }
        }
        if(dist != 1000000D)
        {
            this.xPosF = (float)closest.getX() + 0.5F;
            this.yPosF = (float)closest.getY() + 0.5F;
            this.zPosF = (float)closest.getZ() + 0.5F;
        }
    }
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:28,代码来源:SoundGlassAmbience.java

示例3: AnvilContainer

@SideOnly(Side.CLIENT)
public AnvilContainer(InventoryPlayer playerInv, World worldIn, AnvilTileEntity ate) {
	this(playerInv, worldIn, BlockPos.ORIGIN,ate);
	
}
 
开发者ID:trigg,项目名称:Firma,代码行数:5,代码来源:AnvilContainer.java

示例4: addPos

public BlockPos addPos()
{
	return BlockPos.ORIGIN;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:4,代码来源:HarshenStructure.java

示例5: HarshenTemplate

protected HarshenTemplate(ResourceLocation location) {
	String s = location.getResourceDomain();
       String s1 = location.getResourcePath();
       InputStream stream = null;
       boolean flag;
       try
       {
       	stream = getClass().getResourceAsStream("/assets/" + HarshenCastle.MODID + "/structures/" + s1 + ".nbt");
           NBTTagCompound compound = CompressedStreamTools.readCompressed(stream);
           if (!compound.hasKey("DataVersion", 99))
           {
           	compound.setInteger("DataVersion", 500);
           }
           Template template = new Template();
           DataFixer fixer;
           try
           {
           	fixer = Minecraft.getMinecraft().getDataFixer();
           }
           catch (Throwable e) {
			fixer = FMLServerHandler.instance().getDataFixer();
		}
           template.read(fixer.process(FixTypes.STRUCTURE, compound));
           this.blocks.clear();
           NBTTagList nbttaglist = compound.getTagList("size", 3);
           this.size = new BlockPos(nbttaglist.getIntAt(0), nbttaglist.getIntAt(1), nbttaglist.getIntAt(2));
           NBTTagList nbttaglist4 = compound.getTagList("pos", 3);
           if(nbttaglist4.hasNoTags())
           	this.pos = BlockPos.ORIGIN;
           else
               this.pos = new BlockPos(nbttaglist4.getIntAt(0), nbttaglist4.getIntAt(1), nbttaglist4.getIntAt(2));
           BasicPalette template$basicpalette = new BasicPalette();
           NBTTagList nbttaglist1 = compound.getTagList("palette", 10);

           for (int i = 0; i < nbttaglist1.tagCount(); ++i)
           {
               template$basicpalette.addMapping(NBTUtil.readBlockState(nbttaglist1.getCompoundTagAt(i)), i);
           }

           NBTTagList nbttaglist3 = compound.getTagList("blocks", 10);
           for (int j = 0; j < nbttaglist3.tagCount(); ++j)
           {
               NBTTagCompound nbttagcompound = nbttaglist3.getCompoundTagAt(j);
               NBTTagList nbttaglist2 = nbttagcompound.getTagList("pos", 3);
               BlockPos blockpos = new BlockPos(nbttaglist2.getIntAt(0), nbttaglist2.getIntAt(1), nbttaglist2.getIntAt(2));
               IBlockState iblockstate = template$basicpalette.stateFor(nbttagcompound.getInteger("state"));
               NBTTagCompound nbttagcompound1;

               if (nbttagcompound.hasKey("nbt"))
               {
                   nbttagcompound1 = nbttagcompound.getCompoundTag("nbt");
               }
               else
               {
                   nbttagcompound1 = null;
               }

               if(!(iblockstate.getBlock() instanceof BlockStructure))
               	this.blocks.add(new Template.BlockInfo(blockpos, iblockstate, nbttagcompound1));
           }
       }
       catch (Throwable var10)
       {
       }
       finally
       {
           IOUtils.closeQuietly(stream);
       }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:69,代码来源:HarshenTemplate.java

示例6: onClientTick

@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
    if(event.phase == TickEvent.Phase.END)
    {
        Minecraft mc = Minecraft.getMinecraft();
        if(mc.world != null)
        {
            if(!clickedPos.equals(BlockPos.ORIGIN))
            {
                TileEntity te = mc.world.getTileEntity(clickedPos);
                if(te instanceof TileEntityGlassBase && ((TileEntityGlassBase)te).active && mc.playerController.getIsHittingBlock())
                {

                    TileEntityGlassBase base = (TileEntityGlassBase)te;
                    if(base.fadeoutTime < TileEntityGlassBase.FADEOUT_TIME - TileEntityGlassBase.PROPAGATE_TIME)
                    {
                        base.fadeoutTime = TileEntityGlassBase.FADEOUT_TIME;
                        base.fadePropagate = TileEntityGlassBase.PROPAGATE_TIME;
                        base.fadeDistance = 2;
                        base.fadePropagate();
                    }
                }
                else
                {
                    clickedPos = BlockPos.ORIGIN;
                }
            }
            Iterator<Map.Entry<String, Integer>> ite = terminalPlacementCreationTimeout.entrySet().iterator();
            while(ite.hasNext())
            {
                Map.Entry<String, Integer> e = ite.next();
                e.setValue(e.getValue() - 1);
                if(e.getValue() < 0)
                {
                    ite.remove();
                }
            }
        }
    }
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:41,代码来源:EventHandlerClient.java

示例7: readObjectNoData

private void readObjectNoData() throws ObjectStreamException
{
	this.dim = 0;
	this.pos = BlockPos.ORIGIN;
}
 
开发者ID:V0idWa1k3r,项目名称:VoidApi,代码行数:5,代码来源:DimBlockPos.java

示例8: onRender

@Override
public void onRender(float partialTicks)
{
	if(currentBlock == null)
		return;
	
	// GL settings
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glLineWidth(2);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	
	GL11.glPushMatrix();
	GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
		-TileEntityRendererDispatcher.staticPlayerY,
		-TileEntityRendererDispatcher.staticPlayerZ);
	
	AxisAlignedBB box = new AxisAlignedBB(BlockPos.ORIGIN);
	float p = prevProgress + (progress - prevProgress) * partialTicks;
	float red = p * 2F;
	float green = 2 - red;
	
	GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
		currentBlock.getZ());
	if(p < 1)
	{
		GL11.glTranslated(0.5, 0.5, 0.5);
		GL11.glScaled(p, p, p);
		GL11.glTranslated(-0.5, -0.5, -0.5);
	}
	
	GL11.glColor4f(red, green, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(red, green, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	
	GL11.glPopMatrix();
	
	// GL resets
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:48,代码来源:NukerMod.java

示例9: getPosition

/**
 * Get the position in the world. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return
 * the coordinates 0, 0, 0
 */
public BlockPos getPosition()
{
    return BlockPos.ORIGIN;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:MinecraftServer.java

示例10: ContainerRepair

public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player)
{
    this(playerInventory, worldIn, BlockPos.ORIGIN, player);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:ContainerRepair.java

示例11: ContainerEnchantment

public ContainerEnchantment(InventoryPlayer playerInv, World worldIn)
{
    this(playerInv, worldIn, BlockPos.ORIGIN);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:ContainerEnchantment.java

示例12: GuiCrafting

public GuiCrafting(InventoryPlayer playerInv, World worldIn)
{
    this(playerInv, worldIn, BlockPos.ORIGIN);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:GuiCrafting.java

示例13: PacketNetherBrickOvenFuelLevel

public PacketNetherBrickOvenFuelLevel()
{
	pos = BlockPos.ORIGIN;

	fluidStack = null;
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:6,代码来源:PacketNetherBrickOvenFuelLevel.java

示例14: ContainerRepair

@SideOnly(Side.CLIENT)
public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player)
{
    this(playerInventory, worldIn, BlockPos.ORIGIN, player);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:ContainerRepair.java

示例15: ContainerEnchantment

@SideOnly(Side.CLIENT)
public ContainerEnchantment(InventoryPlayer playerInv, World worldIn)
{
    this(playerInv, worldIn, BlockPos.ORIGIN);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:ContainerEnchantment.java


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