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


Java BlockSign类代码示例

本文整理汇总了Java中net.minecraft.block.BlockSign的典型用法代码示例。如果您正苦于以下问题:Java BlockSign类的具体用法?Java BlockSign怎么用?Java BlockSign使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: cleanPosters

import net.minecraft.block.BlockSign; //导入依赖的package包/类
int cleanPosters() {
    int ret = 0;
    for (EntityPoster poster : getPosters()) {
        if (!poster.isLocked()) continue;
        if (!ItemUtil.is(poster.getItem(), Core.registry.brokenTool)) continue;
        poster.setItem(null);
        poster.setLocked(false);
        poster.syncData();
        ret++;
        ICoordFunction clearSign = new ICoordFunction() {
            @Override
            public void handle(Coord here) {
                if (!(here.getBlock() instanceof BlockSign)) return;
                TileEntitySign sign = here.getTE(TileEntitySign.class);
                if (sign == null) return;
                for (int i = 0; i < sign.signText.length; i++) {
                    sign.signText[i] = new ChatComponentText("");
                }
                here.markBlockForUpdate();
            }
        };
        iterateSign(poster, clearSign);
    }
    return ret;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:26,代码来源:TileEntityLegendarium.java

示例2: checkBlockInteraction

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public static void checkBlockInteraction(Resident res, BlockPos bp, PlayerInteractEvent.Action action, Event ev) {
    if(!ev.isCancelable()) {
        return;
    }

    World world = MinecraftServer.getServer().worldServerForDimension(bp.getDim());
    Block block = world.getBlock(bp.getX(), bp.getY(), bp.getZ());

    // Bypass for SellSign
    if (block instanceof BlockSign) {
        TileEntity te = world.getTileEntity(bp.getX(), bp.getY(), bp.getZ());
        if(te instanceof TileEntitySign && SellSign.SellSignType.instance.isTileValid((TileEntitySign) te)) {
            return;
        }
    }

    for(SegmentBlock segment : segmentsBlock.get(block.getClass())) {
        if(!segment.shouldInteract(res, bp, action)) {
            ev.setCanceled(true);
        }
    }
}
 
开发者ID:MyEssentials,项目名称:MyTown2,代码行数:23,代码来源:ProtectionManager.java

示例3: getTileSignLooking

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public static @Nullable TileEntitySign getTileSignLooking() {
	if (MovePos.getBlock() instanceof BlockSign) {
		final TileEntity tile = MovePos.getTile();
		if (tile instanceof TileEntitySign)
			return (TileEntitySign) tile;
	}
	return null;
}
 
开发者ID:Team-Fruit,项目名称:SignPicture,代码行数:9,代码来源:Client.java

示例4: addBush

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public static void addBush() {
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockSign.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockAnvil.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockPressurePlate.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockLever.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockRailBase.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWire.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWireHook.class, EnumSnowType.MINUS_FULL);
}
 
开发者ID:Reoseah,项目名称:shifted-snow,代码行数:12,代码来源:ClassProviders.java

示例5: canGrabBlock

import net.minecraft.block.BlockSign; //导入依赖的package包/类
/**
 * Returns true if the whip can grapple the block at the position
 */
protected boolean canGrabBlock(Block block, BlockPos pos, EnumFacing face) {
	if (block instanceof IWhipBlock) {
		return ((IWhipBlock) block).canGrabBlock(getType(), getThrower(), worldObj, pos, face);
	}
	switch (getType()) {
	case WHIP_MAGIC:
		// this excludes things like dirt, most plants, etc.
		if (block instanceof BlockSandStone || block instanceof BlockHugeMushroom || 
				(block.getMaterial().blocksMovement() && block.getBlockHardness(worldObj, pos) > 1.0F)) {
			return true;
		} // otherwise, fall through to standard case:
	case WHIP_SHORT:
	case WHIP_LONG:
		int clear = 0;
		if (isSideClear(pos.east()) && isSideClear(pos.west())) {
			++clear;
		}
		if (isSideClear(pos.up()) && isSideClear(pos.down())) {
			++clear;
		}
		if (isSideClear(pos.south()) && isSideClear(pos.north())) {
			++clear;
		}
		return (clear > 1 && (block instanceof BlockFence || block instanceof BlockLog ||
				block instanceof BlockLever || block instanceof BlockSign ||
				block instanceof BlockLadder));
	}
	return false;
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:33,代码来源:EntityWhip.java

示例6: drawBlockDamageTexture

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public void drawBlockDamageTexture(Tessellator tessellatorIn, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks)
{
    double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;

    if (!this.damagedBlocks.isEmpty())
    {
        this.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        this.preRenderDamagedBlocks();
        worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
        worldRendererIn.setTranslation(-d0, -d1, -d2);
        worldRendererIn.markDirty();
        Iterator<DestroyBlockProgress> iterator = this.damagedBlocks.values().iterator();

        while (iterator.hasNext())
        {
            DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
            BlockPos blockpos = destroyblockprogress.getPosition();
            double d3 = (double)blockpos.getX() - d0;
            double d4 = (double)blockpos.getY() - d1;
            double d5 = (double)blockpos.getZ() - d2;
            Block block = this.theWorld.getBlockState(blockpos).getBlock();

            if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
            {
                if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
                {
                    iterator.remove();
                }
                else
                {
                    IBlockState iblockstate = this.theWorld.getBlockState(blockpos);

                    if (iblockstate.getBlock().getMaterial() != Material.air)
                    {
                        int i = destroyblockprogress.getPartialBlockDamage();
                        TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
                        BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
                        blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld);
                    }
                }
            }
        }

        tessellatorIn.draw();
        worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
        this.postRenderDamagedBlocks();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:51,代码来源:RenderGlobal.java

示例7: drawBlockDamageTexture

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public void drawBlockDamageTexture(Tessellator tessellatorIn, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks)
{
    double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;

    if (!this.damagedBlocks.isEmpty())
    {
        this.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        this.preRenderDamagedBlocks();
        worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
        worldRendererIn.setTranslation(-d0, -d1, -d2);
        worldRendererIn.markDirty();
        Iterator iterator = this.damagedBlocks.values().iterator();

        while (iterator.hasNext())
        {
            DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
            BlockPos blockpos = destroyblockprogress.getPosition();
            double d3 = (double)blockpos.getX() - d0;
            double d4 = (double)blockpos.getY() - d1;
            double d5 = (double)blockpos.getZ() - d2;
            Block block = this.theWorld.getBlockState(blockpos).getBlock();
            boolean flag;

            if (Reflector.ForgeTileEntity_canRenderBreaking.exists())
            {
                boolean flag1 = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;

                if (!flag1)
                {
                    TileEntity tileentity = this.theWorld.getTileEntity(blockpos);

                    if (tileentity != null)
                    {
                        flag1 = Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0]);
                    }
                }

                flag = !flag1;
            }
            else
            {
                flag = !(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull);
            }

            if (flag)
            {
                if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
                {
                    iterator.remove();
                }
                else
                {
                    IBlockState iblockstate = this.theWorld.getBlockState(blockpos);

                    if (iblockstate.getBlock().getMaterial() != Material.air)
                    {
                        int i = destroyblockprogress.getPartialBlockDamage();
                        TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
                        BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
                        blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld);
                    }
                }
            }
        }

        tessellatorIn.draw();
        worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
        this.postRenderDamagedBlocks();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:73,代码来源:RenderGlobal.java

示例8: drawBlockDamageTexture

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks)
{
    double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;

    if (!this.damagedBlocks.isEmpty())
    {
        this.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        this.preRenderDamagedBlocks();
        worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
        worldRendererIn.setTranslation(-d0, -d1, -d2);
        worldRendererIn.noColor();
        Iterator<DestroyBlockProgress> iterator = this.damagedBlocks.values().iterator();

        while (iterator.hasNext())
        {
            DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
            BlockPos blockpos = destroyblockprogress.getPosition();
            double d3 = (double)blockpos.getX() - d0;
            double d4 = (double)blockpos.getY() - d1;
            double d5 = (double)blockpos.getZ() - d2;
            Block block = this.theWorld.getBlockState(blockpos).getBlock();
            boolean flag;

            if (Reflector.ForgeTileEntity_canRenderBreaking.exists())
            {
                boolean flag1 = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;

                if (!flag1)
                {
                    TileEntity tileentity = this.theWorld.getTileEntity(blockpos);

                    if (tileentity != null)
                    {
                        flag1 = Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0]);
                    }
                }

                flag = !flag1;
            }
            else
            {
                flag = !(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull);
            }

            if (flag)
            {
                if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
                {
                    iterator.remove();
                }
                else
                {
                    IBlockState iblockstate = this.theWorld.getBlockState(blockpos);

                    if (iblockstate.getMaterial() != Material.AIR)
                    {
                        int i = destroyblockprogress.getPartialBlockDamage();
                        TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
                        BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
                        blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld);
                    }
                }
            }
        }

        tessellatorIn.draw();
        worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
        this.postRenderDamagedBlocks();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:73,代码来源:RenderGlobal.java

示例9: drawBlockDamageTexture

import net.minecraft.block.BlockSign; //导入依赖的package包/类
public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks)
{
    double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;

    if (!this.damagedBlocks.isEmpty())
    {
        this.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        this.preRenderDamagedBlocks();
        worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
        worldRendererIn.setTranslation(-d0, -d1, -d2);
        worldRendererIn.noColor();
        Iterator<DestroyBlockProgress> iterator = this.damagedBlocks.values().iterator();

        while (iterator.hasNext())
        {
            DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
            BlockPos blockpos = destroyblockprogress.getPosition();
            double d3 = (double)blockpos.getX() - d0;
            double d4 = (double)blockpos.getY() - d1;
            double d5 = (double)blockpos.getZ() - d2;
            Block block = this.theWorld.getBlockState(blockpos).getBlock();
            TileEntity te = this.theWorld.getTileEntity(blockpos);
            boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
            if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();

            if (!hasBreak)
            {
                if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
                {
                    iterator.remove();
                }
                else
                {
                    IBlockState iblockstate = this.theWorld.getBlockState(blockpos);

                    if (iblockstate.getMaterial() != Material.AIR)
                    {
                        int i = destroyblockprogress.getPartialBlockDamage();
                        TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i];
                        BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
                        blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld);
                    }
                }
            }
        }

        tessellatorIn.draw();
        worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
        this.postRenderDamagedBlocks();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:54,代码来源:RenderGlobal.java

示例10: drawBlockDamageTexture

import net.minecraft.block.BlockSign; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer vertexBuffer, Entity entityIn, float partialTicks, World world, List<BlockPos> blocks) {
   	double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * partialTicks;
   	double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * partialTicks;
   	double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * partialTicks;

   	TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
   	float curBlockDamageMP = ObfuscationReflectionHelper.getPrivateValue(PlayerControllerMP.class, Minecraft.getMinecraft().playerController, 4);
   	int progress = (int) (curBlockDamageMP * 10f) - 1; // 0-10

   	if(progress < 0) {
   		return;
   	}

   	renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
   	//preRenderDamagedBlocks BEGIN
   	GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0);
   	GlStateManager.enableBlend();
   	GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F);
   	GlStateManager.doPolygonOffset(-3.0F, -3.0F);
   	GlStateManager.enablePolygonOffset();
   	GlStateManager.alphaFunc(516, 0.1F);
   	GlStateManager.enableAlpha();
   	GlStateManager.pushMatrix();
   	//preRenderDamagedBlocks END

   	vertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
   	vertexBuffer.setTranslation(-d0, -d1, -d2);
   	vertexBuffer.noColor();

   	for(BlockPos blockpos : blocks) {
   		blockpos.getX();
   		blockpos.getY();
   		blockpos.getZ();
   		Block block = world.getBlockState(blockpos).getBlock();
   		TileEntity te = world.getTileEntity(blockpos);
   		boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest
   				|| block instanceof BlockSign || block instanceof BlockSkull;
   		if(!hasBreak) {
   			hasBreak = te != null && te.canRenderBreaking();
   		}

   		if(!hasBreak) {
   			IBlockState iblockstate = world.getBlockState(blockpos);

   			if(iblockstate.getBlock().getMaterial(iblockstate) != Material.AIR) {
   				TextureAtlasSprite textureatlassprite = RenderUtil.getSprite("minecraft:blocks/destroy_stage_"+progress)/*ClientProxy.destroyBlockIcons[progress]*/;
   				BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
   				blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, world);
   			}
   		}
   	}

   	tessellatorIn.draw();
   	vertexBuffer.setTranslation(0.0D, 0.0D, 0.0D);
   	// postRenderDamagedBlocks BEGIN
   	GlStateManager.disableAlpha();
   	GlStateManager.doPolygonOffset(0.0F, 0.0F);
   	GlStateManager.disablePolygonOffset();
   	GlStateManager.enableAlpha();
   	GlStateManager.depthMask(true);
   	GlStateManager.popMatrix();
   	// postRenderDamagedBlocks END
   }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:65,代码来源:ClientEventHandler.java


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