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


Java Blocks.stained_glass方法代碼示例

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


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

示例1: shouldSideBeRendered

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (this == Blocks.glass || this == Blocks.stained_glass)
    {
        if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
        {
            return true;
        }

        if (block == this)
        {
            return false;
        }
    }

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:21,代碼來源:BlockBreakable.java

示例2: generateFile

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public static void generateFile(World world, int x, int y, int z, String path) {
	try {
		BufferedWriter bw = new BufferedWriter(new FileWriter(new File(path)));

		for (int i = 0; i < 58; i++)
			for (int j = 0; j < 31 - 9; j++)
				for (int k = 0; k < 58; k++) {
					Block b = world.getBlock(x + i, y + j, z + k);
					int meta = world.getBlockMetadata(x + i, y + j, z + k);

					String s = "(" + i + ", " + j + ", " + k + ") - ";
					if (b == ModBlocks.prismarine)
						s += meta;
					else if (b == ModBlocks.sea_lantern)
						s += 3;
					else if (b == Blocks.gold_block)
						s += 4;
					else if (b == Blocks.sponge)
						s += 5;
					else if (b == Blocks.stained_glass)
						s += 6;
					else
						s = null;

					if (s != null) {
						bw.write(s);
						bw.newLine();
					}
				}

		bw.close();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:36,代碼來源:OceanMonument.java

示例3: canPlaceOn

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
private boolean canPlaceOn(World worldIn, BlockPos pos)
{
    if (World.doesBlockHaveSolidTopSurface(worldIn, pos))
    {
        return true;
    }
    else
    {
        Block block = worldIn.getBlockState(pos).getBlock();
        return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:BlockTorch.java

示例4: canPlaceOn

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
private boolean canPlaceOn(World worldIn, BlockPos pos) {
	if (World.doesBlockHaveSolidTopSurface(worldIn, pos)) {
		return true;
	} else {
		Block block = worldIn.getBlockState(pos).getBlock();
		return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall
				|| block == Blocks.stained_glass;
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:BlockTorch.java

示例5: canPaneConnectToBlock

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:BlockPane.java

示例6: updateSegments

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
private void updateSegments() {
	int x = xCoord;
	int y = yCoord;
	int z = zCoord;
	segments.clear();
	TileEntityNewBeacon.BeamSegment beamsegment = new TileEntityNewBeacon.BeamSegment(EntitySheep.fleeceColorTable[0]);
	segments.add(beamsegment);
	boolean flag = true;

	for (int i = y + 1; i < worldObj.getActualHeight(); i++) {
		Block iblockstate = worldObj.getBlock(x, i, z);
		float[] colours;

		if (iblockstate == Blocks.stained_glass)
			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		else {
			if (iblockstate != Blocks.stained_glass_pane) {
				if (iblockstate.getLightOpacity() >= 15) {
					segments.clear();
					break;
				}

				beamsegment.func_177262_a();
				continue;
			}

			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		}

		if (!flag)
			colours = new float[] { (beamsegment.func_177263_b()[0] + colours[0]) / 2.0F, (beamsegment.func_177263_b()[1] + colours[1]) / 2.0F, (beamsegment.func_177263_b()[2] + colours[2]) / 2.0F };

		if (Arrays.equals(colours, beamsegment.func_177263_b()))
			beamsegment.func_177262_a();
		else {
			beamsegment = new TileEntityNewBeacon.BeamSegment(colours);
			segments.add(beamsegment);
		}

		flag = false;
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:43,代碼來源:TileEntityNewBeacon.java


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