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


Java BlockPortal类代码示例

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


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

示例1: placePortalBlocks

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
private void placePortalBlocks(int zIn, int xIn, int yIn, int l5, int l2) {
	int j3;
	int k3;
	int l3;
	int x;
	int y;
	int z;

	IBlockState iblockstate = BlockTeletoryPortal.INSTANCE.getDefaultState().withProperty(BlockPortal.AXIS,
			l5 == 0 ? EnumFacing.Axis.Z : EnumFacing.Axis.X);

	for (j3 = 0; j3 < 4; ++j3) {
		for (k3 = 0; k3 < 4; ++k3) {
			for (l3 = -1; l3 < 4; ++l3) {
				x = xIn + (k3 - 1) * l5;
				y = yIn + l3;
				z = zIn + (k3 - 1) * l2;
				boolean flag1 = k3 == 0 || k3 == 3 || l3 == -1 || l3 == 3;
				this.world.setBlockState(new BlockPos(x, y, z), flag1 ? BlockEnder.INSTANCE.getDefaultState() : iblockstate, 2);
			}
		}

		for (k3 = 0; k3 < 4; ++k3) {
			for (l3 = -1; l3 < 4; ++l3) {
				x = xIn + (k3 - 1) * l5;
				y = yIn + l3;
				z = zIn + (k3 - 1) * l2;
				this.world.notifyNeighborsOfStateChange(new BlockPos(x, y, z), this.world.getBlockState(new BlockPos(x, y, z)).getBlock(), false);
			}
		}
	}
}
 
开发者ID:ToroCraft,项目名称:TeleToro,代码行数:33,代码来源:TeletoryTeleporter.java

示例2: setPortalState

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
/** Set the portal blocks in the frame */
public void setPortalState() {
	for (int i = 0; i < this.sizeX; ++i) {
		BlockPos blockpos = this.pos.offset(this.face1, i);
		for (int j = 0; j < this.sizeY; ++j) {
			this.world.setBlockState(blockpos.up(j), LCBlocks.underPortal.getDefaultState().withProperty(BlockPortal.AXIS, this.axis), 2);
		}
	}
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:10,代码来源:PortalUnderworld.java

示例3: func_150859_c

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
public void func_150859_c()
{
	for (int i = 0; i < field_150868_h; ++i)
	{
		BlockPos blockpos = field_150861_f.offset(field_150866_c, i);

		for (int j = 0; j < field_150862_g; ++j)
			world.setBlockState(blockpos.up(j), ACBlocks.omothol_gateway.getDefaultState().withProperty(BlockPortal.AXIS, axis), 2);
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:11,代码来源:BlockOmotholPortal.java

示例4: func_150859_c

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
public void func_150859_c()
{
	for (int i = 0; i < field_150868_h; ++i)
	{
		BlockPos blockpos = field_150861_f.offset(field_150866_c, i);

		for (int j = 0; j < field_150862_g; ++j)
			world.setBlockState(blockpos.up(j), ACBlocks.abyssal_gateway.getDefaultState().withProperty(BlockPortal.AXIS, axis), 2);
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:11,代码来源:BlockAbyssPortal.java

示例5: func_150859_c

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
public void func_150859_c()
{
	for (int i = 0; i < field_150868_h; ++i)
	{
		BlockPos blockpos = field_150861_f.offset(field_150866_c, i);

		for (int j = 0; j < field_150862_g; ++j)
			world.setBlockState(blockpos.up(j), ACBlocks.dreaded_gateway.getDefaultState().withProperty(BlockPortal.AXIS, axis), 2);
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:11,代码来源:BlockDreadlandsPortal.java

示例6: Size

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_)
{
    this.field_150867_a = p_i45415_1_;
    this.field_150865_b = p_i45415_5_;
    this.field_150863_d = BlockPortal.field_150001_a[p_i45415_5_][0];
    this.field_150866_c = BlockPortal.field_150001_a[p_i45415_5_][1];

    for (int i1 = p_i45415_3_; p_i45415_3_ > i1 - 21 && p_i45415_3_ > 0 && this.func_150857_a(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_)
    {
        ;
    }

    int j1 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1;

    if (j1 >= 0)
    {
        this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + j1 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + j1 * Direction.offsetZ[this.field_150863_d]);
        this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c);

        if (this.field_150868_h < 2 || this.field_150868_h > 21)
        {
            this.field_150861_f = null;
            this.field_150868_h = 0;
        }
    }

    if (this.field_150861_f != null)
    {
        this.field_150862_g = this.func_150858_a();
    }
}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:32,代码来源:BlockUstherPortal.java

示例7: tryToCreatePortal

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
/**
 * Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z
 */
public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
{
	byte b0 = 0;
	byte b1 = 0;
	if (getBlock(par1World, par2 - 1, par3, par4) == Blocks.coal_block
			|| getBlock(par1World, par2 + 1, par3, par4) == Blocks.coal_block)
	{
		b0 = 1;
	}
	if (getBlock(par1World, par2, par3, par4 - 1) == Blocks.coal_block
			|| getBlock(par1World, par2, par3, par4 + 1) == Blocks.coal_block)
	{
		b1 = 1;
	}
	if (b0 == b1)
	{
		return false;
	} else
	{
		if (getBlock(par1World, par2 - b0, par3, par4 - b1) == Blocks.air)
		{
			par2 -= b0;
			par4 -= b1;
		}
		int l;
		int i1;
		for (l = -1; l <= 2; ++l)
		{
			for (i1 = -1; i1 <= 3; ++i1)
			{
				boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;
				if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
				{
					Block j1 = getBlock(par1World, par2 + b0 * l, par3 + i1, par4 + b1 * l);
					if (flag)
					{
						if (j1 != Blocks.coal_block)
						{
							return false;
						}
					}
					/*
					 * else if (j1 != 0 && j1 != Main.TutorialFire.blockID) { return false; }
					 */
				}
			}
		}
		for (l = 0; l < 2; ++l)
		{
			for (i1 = 0; i1 < 3; ++i1)
			{
				IBlockState iblockstate = this.getDefaultState().withProperty(BlockPortal.AXIS,
						b0 == 0 ? EnumFacing.Axis.Z : EnumFacing.Axis.X);
				par1World.setBlockState(new BlockPos(par2 + b0 * l, par3 + i1, par4 + b1 * l), iblockstate, 3);
			}
		}
		return true;
	}
}
 
开发者ID:sokratis12GR,项目名称:MoreDimensions,代码行数:63,代码来源:CoalDimension.java

示例8: preInit

import net.minecraft.block.BlockPortal; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	tabAtlantis = new CreativeTabs("tabAtlantis") {public Item getTabIconItem() {return AtlantisMod.pearl;}};
	
	blockAtlantisPortal = (BlockPortal)(new BlockPortal()).setBlockName("blockAtlantisPortal").setBlockTextureName("portal");
	
	blockDeepSand = (new BlockFalling()).setHardness(0.5F).setStepSound(Block.soundTypeSand).setBlockName("blockDeepSand").setCreativeTab(AtlantisMod.tabAtlantis).setBlockTextureName("atlantismod:deep_sand");
	blockRottenPlanks = (new BlockRottenPlanks()).setHardness(1.5F).setStepSound(Block.soundTypeWood).setBlockName("rottenPlanks").setCreativeTab(AtlantisMod.tabAtlantis).setBlockTextureName("atlantismod:rotten_planks");

	pearl = (new Item()).setUnlocalizedName("pearl").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:pearl");
	atlantisWand = (ItemAtlantisWand)(new ItemAtlantisWand()).setUnlocalizedName("atlantisWand").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:portal_wand").setMaxStackSize(1);
	trident = (new ItemTrident(AtlantisMod.Trident)).setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:trident").setUnlocalizedName("trident").setMaxStackSize(1);
	atlantisEye = (new ItemAtlantisEye(2,1.2F,false)).setAlwaysEdible().setUnlocalizedName("atlantisEye").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:atlantis_eye").setMaxStackSize(16);
	scepter = (new Item()).setUnlocalizedName("scepter").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:scepter").setMaxStackSize(1);
	necklace = (ItemNecklaceArmor)(new ItemNecklaceArmor(AtlantisMod.NecklaceArmor,0,1)).setUnlocalizedName("necklace").setMaxDamage(10000).setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:necklace").setMaxStackSize(1);
	bubbleWand = (ItemBubbleWand)(new ItemBubbleWand()).setUnlocalizedName("bubbleWand").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:bubble_wand").setMaxStackSize(1);
	
	fishHead = (new Item()).setUnlocalizedName("fishHead").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:fish_head");
	
	blockPearl = (new BlockCompressed(MapColor.snowColor)).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName("blockPearl").setBlockTextureName("atlantismod:pearl_block").setCreativeTab(AtlantisMod.tabAtlantis);
	oreAtlanteum = (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setBlockName("oreAtlanteum").setBlockTextureName("atlantismod:atlanteum_ore").setCreativeTab(AtlantisMod.tabAtlantis);
	blockAtlanteum = (new BlockCompressed(MapColor.cyanColor)).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setBlockName("blockAtlanteum").setBlockTextureName("atlantismod:atlanteum_block").setCreativeTab(AtlantisMod.tabAtlantis);
	
	atlanteum = (new Item()).setUnlocalizedName("atlanteum").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:atlanteum");
	nuggetAtlanteum = (new Item()).setUnlocalizedName("nuggetAtlanteum").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:atlanteum_nugget");
	
	divingHelmet = (ItemDivingArmor)(new ItemDivingArmor(AtlantisMod.DivingSuit,0,0)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("divingHelmet").setTextureName("atlantismod:diving_helmet");
	scubaSuit = (ItemDivingArmor)(new ItemDivingArmor(AtlantisMod.DivingSuit,0,1)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("scubaSuit").setTextureName("atlantismod:scuba_suit");
	oxygenTank = (ItemDivingArmor)(new ItemDivingArmor(AtlantisMod.DivingSuit,0,2)).setMaxDamage(10000).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("oxygenTank").setTextureName("atlantismod:oxygen_tank");
	flippers = (ItemDivingArmor)(new ItemDivingArmor(AtlantisMod.DivingSuit,0,3)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("flippers").setTextureName("atlantismod:flippers");
	
	blockSeaweed = (new BlockSeaweed()).setHardness(0.0F).setStepSound(Block.soundTypeGrass).setBlockName("blockSeaweed").setBlockTextureName("atlantismod:seaweed");
	itemSeaweed = (new ItemSeaweed(AtlantisMod.blockSeaweed)).setUnlocalizedName("itemSeaweed").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:seaweed_item");

	blockCoralOrange = (new BlockCoral(itemCoralOrange)).setHardness(0.0F).setStepSound(Block.soundTypeGrass).setBlockName("blockCoralOrange").setBlockTextureName("atlantismod:orange_coral");
	blockCoralRed = (new BlockCoral(itemCoralRed)).setHardness(0.0F).setStepSound(Block.soundTypeGrass).setBlockName("blockCoralRed").setBlockTextureName("atlantismod:red_coral");
	blockCoralPurple = (new BlockCoral(itemCoralPurple)).setHardness(0.0F).setStepSound(Block.soundTypeGrass).setBlockName("blockCoralPurple").setBlockTextureName("atlantismod:purple_coral");
	blockCoralYellow = (new BlockCoral(itemCoralYellow)).setHardness(0.0F).setStepSound(Block.soundTypeGrass).setBlockName("blockCoralYellow").setBlockTextureName("atlantismod:yellow_coral");
	
	itemCoralOrange = (new ItemSeaweed(AtlantisMod.blockCoralOrange)).setUnlocalizedName("itemCoralOrange").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:orange_coral_item");
	itemCoralRed = (new ItemSeaweed(AtlantisMod.blockCoralRed)).setUnlocalizedName("itemCoralRed").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:red_coral_item");
	itemCoralPurple = (new ItemSeaweed(AtlantisMod.blockCoralPurple)).setUnlocalizedName("itemCoralPurple").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:purple_coral_item");
	itemCoralYellow = (new ItemSeaweed(AtlantisMod.blockCoralYellow)).setUnlocalizedName("itemCoralYellow").setCreativeTab(AtlantisMod.tabAtlantis).setTextureName("atlantismod:yellow_coral_item");
	
	pebble = (new BlockPebble()).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeGravel).setBlockName("pebble").setCreativeTab(AtlantisMod.tabAtlantis).setBlockTextureName("atlantismod:pebble");
	
	axePearl = (new ItemPearlAxe(AtlantisMod.PearlTool)).setUnlocalizedName("axePearl").setTextureName("atlantismod:pearl_axe").setCreativeTab(AtlantisMod.tabAtlantis);
	pickaxePearl = (new ItemPearlPickaxe(AtlantisMod.PearlTool)).setUnlocalizedName("pickaxePearl").setTextureName("atlantismod:pearl_pickaxe").setCreativeTab(AtlantisMod.tabAtlantis);
	hoePearl = (new ItemHoe(AtlantisMod.PearlTool)).setUnlocalizedName("hoePearl").setTextureName("atlantismod:pearl_hoe").setCreativeTab(AtlantisMod.tabAtlantis);
	shovelPearl = (new ItemSpade(AtlantisMod.PearlTool)).setUnlocalizedName("shovelPearl").setTextureName("atlantismod:pearl_shovel").setCreativeTab(AtlantisMod.tabAtlantis);
	swordPearl = (new ItemSword(AtlantisMod.PearlTool)).setUnlocalizedName("swordPearl").setTextureName("atlantismod:pearl_sword").setCreativeTab(AtlantisMod.tabAtlantis);
	
	axeAtlanteum = (new ItemAtlanteumAxe(AtlantisMod.AtlanteumTool)).setUnlocalizedName("axeAtlanteum").setTextureName("atlantismod:atlanteum_axe").setCreativeTab(AtlantisMod.tabAtlantis);
	pickaxeAtlanteum = (new ItemAtlanteumPickaxe(AtlantisMod.AtlanteumTool)).setUnlocalizedName("pickaxeAtlanteum").setTextureName("atlantismod:atlanteum_pickaxe").setCreativeTab(AtlantisMod.tabAtlantis);
	hoeAtlanteum = (new ItemHoe(AtlantisMod.AtlanteumTool)).setUnlocalizedName("hoeAtlanteum").setTextureName("atlantismod:atlanteum_hoe").setCreativeTab(AtlantisMod.tabAtlantis);
	shovelAtlanteum = (new ItemSpade(AtlantisMod.AtlanteumTool)).setUnlocalizedName("shovelAtlanteum").setTextureName("atlantismod:atlanteum_shovel").setCreativeTab(AtlantisMod.tabAtlantis);
	swordAtlanteum = (new ItemSword(AtlantisMod.AtlanteumTool)).setUnlocalizedName("swordAtlanteum").setTextureName("atlantismod:atlanteum_sword").setCreativeTab(AtlantisMod.tabAtlantis);
	
	helmetAtlanteum = (ItemAtlanteumArmor)(new ItemAtlanteumArmor(AtlantisMod.AtlanteumArmor,0,0)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("helmetAtlanteum").setTextureName("atlantismod:atlanteum_helmet");
	chestAtlanteum = (ItemAtlanteumArmor)(new ItemAtlanteumArmor(AtlantisMod.AtlanteumArmor,0,1)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("chestAtlanteum").setTextureName("atlantismod:atlanteum_chestplate");
	legsAtlanteum = (ItemAtlanteumArmor)(new ItemAtlanteumArmor(AtlantisMod.AtlanteumArmor,0,2)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("legsAtlanteum").setTextureName("atlantismod:atlanteum_leggings");
	bootsAtlanteum = (ItemAtlanteumArmor)(new ItemAtlanteumArmor(AtlantisMod.AtlanteumArmor,0,3)).setCreativeTab(AtlantisMod.tabAtlantis).setMaxStackSize(1).setUnlocalizedName("bootsAtlanteum").setTextureName("atlantismod:atlanteum_boots");
	
	atlantisOcean = (new BiomeGenAtlantisOcean(44)).setBiomeName("Atlantean Ocean").setHeight(new BiomeGenBase.Height(-1.9F, 0.1F));
	coralReef = (new BiomeGenCoralReef(45)).setBiomeName("Coral Reef").setHeight(new BiomeGenBase.Height(-1.9F, 0.1F));
	deepOcean = (new BiomeGenOcean(46)).setBiomeName("Deepest Ocean").setHeight(new BiomeGenBase.Height(-2.0F, 0.1F));
	darkOcean = (new BiomeGenTheDeep(47)).setBiomeName("Dark Ocean").setHeight(new BiomeGenBase.Height(-1.9F, 0.1F));
	
	biomes = new BiomeGenBase[]{AtlantisMod.atlantisOcean,AtlantisMod.coralReef,AtlantisMod.deepOcean};

	blockRottenPlanks.setHarvestLevel("pickaxe", 2);
	blockDeepSand.setHarvestLevel("shovel", 1);
	blockPearl.setHarvestLevel("pickaxe", 2);
	oreAtlanteum.setHarvestLevel("pickaxe", 2);
	blockAtlanteum.setHarvestLevel("pickaxe", 2);
	
	this.doRegister();
}
 
开发者ID:CodecademyMinecraftMods,项目名称:atlantis-mod,代码行数:79,代码来源:AtlantisMod.java


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