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


Java Blocks.sponge方法代码示例

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


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

示例1: 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

示例2: buildTemple

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public static void buildTemple(World world, int x, int y, int z) {
	if (world.isRemote)
		return;

	for (Entry<WorldCoord, Integer> entry : OceanMonument.getMap().entrySet()) {
		WorldCoord pos = entry.getKey();
		int value = entry.getValue();

		Block block = null;
		int meta = 0;
		switch (value) {
			case 0:
			case 1:
			case 2:
				block = ModBlocks.prismarine;
				meta = value;
				break;
			case 3:
				block = ModBlocks.sea_lantern;
				break;
			case 4:
				block = Blocks.gold_block;
				break;
			case 5:
				block = EtFuturum.enableSponge ? ModBlocks.sponge : Blocks.sponge;
				meta = 1;
				break;
			case 6:
				block = Blocks.water;
				break;
		}

		if (block != null)
			world.setBlock(pos.x + x, pos.y + y, pos.z + z, block, meta, 2);
	}

	for (int i = 0; i < 7; i++) {
		generatePillar(world, x + 5 * i + 4 * i, y, z, ModBlocks.prismarine, 1);
		generatePillar(world, x, y, z + 5 * i + 4 * i, ModBlocks.prismarine, 1);
		generatePillar(world, x + 54, y, z + 5 * i + 4 * i, ModBlocks.prismarine, 1);
		if (i != 3)
			generatePillar(world, x + 5 * i + 4 * i, y, z + 54, ModBlocks.prismarine, 1);
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:45,代码来源:OceanMonument.java


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