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


Java BlockStainedGlass类代码示例

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


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

示例1: searchForInventory

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private IInventory searchForInventory()
{
    for (int j = 1; j < 64; j++) {
        TileEntity foundte = worldObj.getTileEntity(getPos().add(0, j, 0));
        Block foundBlock = worldObj.getBlockState(getPos().add(0, j, 0)).getBlock();

        if (foundte != null && foundte instanceof IInventory) {
            this.foundInventory = getPos().add(0, j, 0);
            this.oldBlock = foundBlock;
            return (IInventory) foundte;
        } else if (foundte == null && !((foundBlock instanceof BlockGlass) || foundBlock instanceof BlockStainedGlass)) {
            this.foundInventory = null;
            this.oldBlock = null;
            return null;
        }
    }

    this.foundInventory = null;
    this.oldBlock = null;
    return null;
}
 
开发者ID:GamingsModding,项目名称:LittleThings-old,代码行数:22,代码来源:TileEntityItemElevator.java

示例2: CustomBlockProcessingHandled

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
@Override
protected Boolean CustomBlockProcessingHandled(StructureConfiguration configuration, BuildBlock block, World world, BlockPos originalPos, EnumFacing assumedNorth,
		Block foundBlock, IBlockState blockState, EntityPlayer player)
{
	if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS.getRegistryName().getResourceDomain())
			&& foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS.getRegistryName().getResourcePath()))
	{
		ProduceFarmConfiguration wareHouseConfiguration = (ProduceFarmConfiguration)configuration;
		
		blockState = blockState.withProperty(BlockStainedGlass.COLOR, wareHouseConfiguration.dyeColor);
		block.setBlockState(blockState);
		//this.placedBlocks.add(block);
		this.priorityOneBlocks.add(block);
		
		return true;
	}
	
	return false;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:20,代码来源:StructureProduceFarm.java

示例3: CustomBlockProcessingHandled

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
@Override
protected Boolean CustomBlockProcessingHandled(StructureConfiguration configuration, BuildBlock block, World world, BlockPos originalPos, EnumFacing assumedNorth,
		Block foundBlock, IBlockState blockState, EntityPlayer player)
{
	if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS.getRegistryName().getResourceDomain())
			&& foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS.getRegistryName().getResourcePath()))
	{
		WareHouseConfiguration wareHouseConfiguration = (WareHouseConfiguration)configuration;
		
		blockState = blockState.withProperty(BlockStainedGlass.COLOR, wareHouseConfiguration.dyeColor);
		block.setBlockState(blockState);
		this.priorityOneBlocks.add(block);
		
		return true;
	}
	
	return false;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:19,代码来源:StructureWarehouse.java

示例4: isFullCubeModel

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private static boolean isFullCubeModel(IBlockState p_isFullCubeModel_0_)
{
    if (p_isFullCubeModel_0_.isFullCube())
    {
        return true;
    }
    else
    {
        Block block = p_isFullCubeModel_0_.getBlock();
        return block instanceof BlockGlass ? true : block instanceof BlockStainedGlass;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:ConnectedTextures.java

示例5: updatePartials

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private void updatePartials()
{
    for (int j = 1; j < 64; j++) {
        BlockPos added = getPos().add(0, j, 0);
        if (worldObj.getBlockState(added).getBlock() instanceof BlockGlass || worldObj.getBlockState(added).getBlock() instanceof BlockStainedGlass)
            for (int i = 10; i >= 1; i--)
                worldObj.spawnParticle(EnumParticleTypes.PORTAL,
                        added.getX() + 0.5, added.getY() - 1 + i / 10, added.getZ() + 0.5,
                        0, 0.3, 0);
        else break;
    }
}
 
开发者ID:GamingsModding,项目名称:LittleThings-old,代码行数:13,代码来源:TileEntityItemElevator.java

示例6: registerVanillaVariantProps

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private static void registerVanillaVariantProps() {
	// TODO: omit similar blocks
	registerVariantProperty(BlockStone.VARIANT);
	registerVariantProperty(BlockPlanks.VARIANT);
	registerVariantProperty(BlockSapling.TYPE);
	registerVariantProperty(BlockDirt.VARIANT);
	registerVariantProperty(BlockSand.VARIANT);
	registerVariantProperty(BlockOldLog.VARIANT);
	registerVariantProperty(BlockNewLog.VARIANT);
	registerVariantProperty(BlockOldLeaf.VARIANT);
	registerVariantProperty(BlockNewLeaf.VARIANT);
	registerVariantProperty(BlockSandStone.TYPE);
	registerVariantProperty(BlockTallGrass.TYPE);
	registerVariantProperty(BlockPistonExtension.TYPE);
	registerVariantProperty(BlockColored.COLOR);
	registerVariantProperty(BlockPistonMoving.TYPE);
	registerVariantProperty(Blocks.YELLOW_FLOWER.getTypeProperty());
	registerVariantProperty(Blocks.RED_FLOWER.getTypeProperty());
	registerVariantProperty(BlockStoneSlab.VARIANT);
	registerVariantProperty(BlockWoodSlab.VARIANT);
	registerVariantProperty(BlockAnvil.DAMAGE);
	registerVariantProperty(BlockQuartz.VARIANT);
	registerVariantProperty(BlockCarpet.COLOR);
	registerVariantProperty(BlockDoublePlant.VARIANT);
	registerVariantProperty(BlockStainedGlass.COLOR);
	registerVariantProperty(BlockStainedGlassPane.COLOR);
	registerVariantProperty(BlockPrismarine.VARIANT);
	registerVariantProperty(BlockRedSandstone.TYPE);
	registerVariantProperty(BlockStoneSlabNew.VARIANT);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:31,代码来源:BlockPropertyRegistry.java

示例7: onItemUse

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float textureX, float textureY, float textureZ) {
   	if(!world.isRemote) {
   		if(world.getBlock(x, y, z) instanceof BlockColoured || world.getBlock(x, y, z) instanceof BlockColored || world.getBlock(x, y, z) instanceof BlockStainedGlass || world.getBlock(x, y, z) instanceof BlockStainedGlassPane) {
   			if(world.getBlockMetadata(x, y, z) != this.getDamage(itemstack)) {
   				world.setBlockMetadataWithNotify(x, y, z, this.getDamage(itemstack), 2);
   				player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
       			return true;
   			} else return false;
   		} else if(world.getBlock(x, y, z) instanceof BlockHardenedClay) {
   			world.setBlock(x, y, z, Blocks.stained_hardened_clay, this.getDamage(itemstack), 2);
   			player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
   			return true;
   		} else if(world.getBlock(x, y, z) instanceof BlockGlass) {
   			world.setBlock(x, y, z, Blocks.stained_glass, this.getDamage(itemstack), 2);
   			player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
   			return true;
   		} else if(world.getBlock(x, y, z) == Blocks.glass_pane) {
   			world.setBlock(x, y, z, Blocks.stained_glass_pane, this.getDamage(itemstack), 2);
   			player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
   			return true;
   		} else if(world.getBlock(x, y, z) instanceof BlockWood) {
   			world.setBlock(x, y, z, ModBlocks.woodColoured, this.getDamage(itemstack), 2);
   			player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
   			return true;
   		} else if(world.getBlock(x, y, z) == Blocks.brick_block) {
   			world.setBlock(x, y, z, ModBlocks.brickColoured, this.getDamage(itemstack), 2);
   			player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getContainerItem(itemstack));
   			return true;
   		}
   	}
   	return false;
   }
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:34,代码来源:ItemPaintbrush.java

示例8: CustomBlockProcessingHandled

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
@Override
protected Boolean CustomBlockProcessingHandled(StructureConfiguration configuration, BuildBlock block, World world, BlockPos originalPos,
		EnumFacing assumedNorth, Block foundBlock, IBlockState blockState, EntityPlayer player)
{
	HouseConfiguration houseConfig = (HouseConfiguration) configuration;

	if ((!houseConfig.addBed && foundBlock instanceof BlockBed) || (!houseConfig.addChest && foundBlock instanceof BlockChest)
			|| (!houseConfig.addTorches && foundBlock instanceof BlockTorch)
			|| (!houseConfig.addCraftingTable && (foundBlock instanceof BlockWorkbench || foundBlock instanceof BlockFurnace)))
	{
		// Don't place the block, returning true means that this has been
		// "handled"
		return true;
	}

	if (foundBlock instanceof BlockFurnace)
	{
		this.furnacePosition = block.getStartingPosition().getRelativePosition(
				originalPos,
				this.getClearSpace().getShape().getDirection(),
				configuration.houseFacing);
	}
	else if (foundBlock instanceof BlockTrapDoor && houseConfig.addMineShaft)
	{
		// The trap door will still be added, but the mine shaft may not be
		// built.
		this.trapDoorPosition = block.getStartingPosition().getRelativePosition(
				originalPos,
				this.getClearSpace().getShape().getDirection(),
				configuration.houseFacing);
	}
	else if (foundBlock instanceof BlockChest && this.chestPosition == null)
	{
		this.chestPosition = block.getStartingPosition().getRelativePosition(
				originalPos,
				this.getClearSpace().getShape().getDirection(),
				configuration.houseFacing);
	}
	else if (foundBlock instanceof BlockStandingSign)
	{
		this.signPosition = block.getStartingPosition().getRelativePosition(
				originalPos,
				this.getClearSpace().getShape().getDirection(),
				configuration.houseFacing);
	}

	if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS.getRegistryName().getResourceDomain())
			&& foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS.getRegistryName().getResourcePath()))
	{
		blockState = blockState.withProperty(BlockStainedGlass.COLOR, houseConfig.glassColor);
		block.setBlockState(blockState);
		this.priorityOneBlocks.add(block);

		return true;
	}
	else if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS_PANE.getRegistryName().getResourceDomain())
			&& foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS_PANE.getRegistryName().getResourcePath()))
	{
		block.setBlockState(foundBlock.getStateFromMeta(houseConfig.glassColor.getMetadata()));
		this.priorityOneBlocks.add(block);
		return true;
	}

	return false;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:66,代码来源:StructureAlternateStart.java

示例9: clay

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private static IBlockState clay(EnumDyeColor color) {
    if (color == null) return Blocks.hardened_clay.getDefaultState();
    return Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockStainedGlass.COLOR, color);
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:5,代码来源:BlockOreExtruder.java

示例10: updateSegmentColors

import net.minecraft.block.BlockStainedGlass; //导入依赖的package包/类
private void updateSegmentColors() {
  int i = this.pos.getX();
  int j = this.pos.getY();
  int k = this.pos.getZ();
  // int l = 5;
  this.beamSegments.clear();
  BeamSegment tileentitybeacon$beamsegment = new BeamSegment(EnumDyeColor.WHITE.getColorComponentValues());
  this.beamSegments.add(tileentitybeacon$beamsegment);
  boolean flag = true;
  BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
  for (int i1 = j + 1; i1 < 256; ++i1) {
    IBlockState iblockstate = this.world.getBlockState(blockpos$mutableblockpos.setPos(i, i1, k));
    float[] afloat;
    if (iblockstate.getBlock() == Blocks.STAINED_GLASS) {
      afloat = ((EnumDyeColor) iblockstate.getValue(BlockStainedGlass.COLOR)).getColorComponentValues();
    }
    else {
      if (iblockstate.getBlock() != Blocks.STAINED_GLASS_PANE) {
        if (iblockstate.getLightOpacity(world, blockpos$mutableblockpos) >= 15 && iblockstate.getBlock() != Blocks.BEDROCK) {
          this.beamSegments.clear();
          break;
        }
        float[] customColor = iblockstate.getBlock().getBeaconColorMultiplier(iblockstate, this.world, blockpos$mutableblockpos, getPos());
        if (customColor != null)
          afloat = customColor;
        else {
          tileentitybeacon$beamsegment.incrementHeight();
          continue;
        }
      }
      else
        afloat = ((EnumDyeColor) iblockstate.getValue(BlockStainedGlassPane.COLOR)).getColorComponentValues();
    }
    if (!flag) {
      afloat = new float[] { (tileentitybeacon$beamsegment.getColors()[0] + afloat[0]) / 2.0F, (tileentitybeacon$beamsegment.getColors()[1] + afloat[1]) / 2.0F, (tileentitybeacon$beamsegment.getColors()[2] + afloat[2]) / 2.0F };
    }
    if (Arrays.equals(afloat, tileentitybeacon$beamsegment.getColors())) {
      tileentitybeacon$beamsegment.incrementHeight();
    }
    else {
      tileentitybeacon$beamsegment = new BeamSegment(afloat);
      this.beamSegments.add(tileentitybeacon$beamsegment);
    }
    flag = false;
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:47,代码来源:TileEntityBeaconPotion.java


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