本文整理匯總了Java中net.minecraft.block.BlockDoor類的典型用法代碼示例。如果您正苦於以下問題:Java BlockDoor類的具體用法?Java BlockDoor怎麽用?Java BlockDoor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BlockDoor類屬於net.minecraft.block包,在下文中一共展示了BlockDoor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldExecute
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!super.shouldExecute())
{
return false;
}
else if (!this.theEntity.worldObj.getGameRules().getBoolean("mobGriefing"))
{
return false;
}
else
{
BlockDoor blockdoor = this.doorBlock;
return !BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition);
}
}
示例2: continueExecuting
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
double d0 = this.theEntity.getDistanceSq(this.doorPosition);
boolean flag;
if (this.breakingTime <= 240)
{
BlockDoor blockdoor = this.doorBlock;
if (!BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition) && d0 < 4.0D)
{
flag = true;
return flag;
}
}
flag = false;
return flag;
}
示例3: placeDoor
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
public static void placeDoor(World worldIn, BlockPos pos, EnumFacing facing, Block door)
{
BlockPos blockpos = pos.offset(facing.rotateY());
BlockPos blockpos1 = pos.offset(facing.rotateYCCW());
int i = (worldIn.getBlockState(blockpos1).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getBlockState(blockpos1.up()).getBlock().isNormalCube() ? 1 : 0);
int j = (worldIn.getBlockState(blockpos).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getBlockState(blockpos.up()).getBlock().isNormalCube() ? 1 : 0);
boolean flag = worldIn.getBlockState(blockpos1).getBlock() == door || worldIn.getBlockState(blockpos1.up()).getBlock() == door;
boolean flag1 = worldIn.getBlockState(blockpos).getBlock() == door || worldIn.getBlockState(blockpos.up()).getBlock() == door;
boolean flag2 = false;
if (flag && !flag1 || j > i)
{
flag2 = true;
}
BlockPos blockpos2 = pos.up();
IBlockState iblockstate = door.getDefaultState().withProperty(BlockDoor.FACING, facing).withProperty(BlockDoor.HINGE, flag2 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT);
worldIn.setBlockState(pos, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2);
worldIn.setBlockState(blockpos2, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2);
worldIn.notifyNeighborsOfStateChange(pos, door);
worldIn.notifyNeighborsOfStateChange(blockpos2, door);
}
示例4: addToNewDoorsList
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void addToNewDoorsList(BlockPos doorBlock)
{
EnumFacing enumfacing = BlockDoor.getFacing(this.worldObj, doorBlock);
EnumFacing enumfacing1 = enumfacing.getOpposite();
int i = this.countBlocksCanSeeSky(doorBlock, enumfacing, 5);
int j = this.countBlocksCanSeeSky(doorBlock, enumfacing1, i + 1);
if (i != j)
{
this.newDoors.add(new VillageDoorInfo(doorBlock, i < j ? enumfacing : enumfacing1, this.tickCounter));
}
}
示例5: setDungeon
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setDungeon()
{
this.floor = Blocks.planks.getDefaultState();
this.exterior = Blocks.cobblestone.getDefaultState();
this.wall = Blocks.cobblestone.getDefaultState();
this.light = Blocks.torch.getDefaultState();
this.goal = Blocks.gold_block.getDefaultState();
this.moat = Blocks.lava.getDefaultState();
this.moatContainer = Blocks.cobblestone.getDefaultState();
this.doorUpper = Blocks.oak_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.oak_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.stone_stairs.getDefaultState();
this.stairsPlatform = Blocks.cobblestone.getDefaultState();
this.ladder = Blocks.ladder.getDefaultState();
this.puzzleDoorUpper = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.lever.getDefaultState();
this.platform = Blocks.bookshelf.getDefaultState();
this.hint = Blocks.gold_ore.getDefaultState();
}
示例6: setPyramid
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setPyramid()
{
this.floor = Blocks.red_sandstone.getDefaultState();
this.exterior = Blocks.sandstone.getDefaultState();
this.wall = Blocks.sandstone.getDefaultState();
this.light = Blocks.torch.getDefaultState();
this.goal = Blocks.diamond_block.getDefaultState();
this.moat = Blocks.lava.getDefaultState();
this.moatContainer = Blocks.sandstone.getDefaultState();
this.doorUpper = Blocks.acacia_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.acacia_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.sandstone_stairs.getDefaultState();
this.stairsPlatform = Blocks.sandstone.getDefaultState();
this.ladder = Blocks.ladder.getDefaultState();
this.puzzleDoorUpper = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.lever.getDefaultState();
this.platform = Blocks.red_sandstone.getDefaultState();
this.hint = Blocks.diamond_ore.getDefaultState();
}
示例7: setIgloo
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setIgloo()
{
this.floor = Blocks.snow.getDefaultState();
this.exterior = Blocks.snow.getDefaultState();
this.wall = Blocks.packed_ice.getDefaultState();
this.light = Blocks.torch.getDefaultState();
this.goal = Blocks.redstone_block.getDefaultState();
this.moat = Blocks.water.getDefaultState();
this.moatContainer = Blocks.glowstone.getDefaultState();
this.doorUpper = Blocks.spruce_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.spruce_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.spruce_stairs.getDefaultState();
this.stairsPlatform = Blocks.packed_ice.getDefaultState();
this.ladder = Blocks.ladder.getDefaultState();
this.puzzleDoorUpper = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.lever.getDefaultState();
this.platform = Blocks.snow.getDefaultState();
this.hint = Blocks.redstone_ore.getDefaultState();
}
示例8: shouldExecute
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!super.shouldExecute())
{
return false;
}
else if (!this.theEntity.world.getGameRules().getBoolean("mobGriefing"))
{
return false;
}
else
{
BlockDoor blockdoor = this.doorBlock;
return !BlockDoor.isOpen(this.theEntity.world, this.doorPosition);
}
}
示例9: continueExecuting
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
double d0 = this.theEntity.getDistanceSq(this.doorPosition);
boolean flag;
if (this.breakingTime <= 240)
{
BlockDoor blockdoor = this.doorBlock;
if (!BlockDoor.isOpen(this.theEntity.world, this.doorPosition) && d0 < 4.0D)
{
flag = true;
return flag;
}
}
flag = false;
return flag;
}
示例10: test_spell_block_can_place_door
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
@Test
public void test_spell_block_can_place_door() throws Exception {
// Given:
mc().setBlock(lowerDoorPos, Blocks.AIR);
mc().setBlock(upperDoorPos, Blocks.AIR);
// When:
mc().executeCommand(
"/lua spell.pos = Vec3.from(%s,%s,%s); spell.block=Blocks.get('wooden_door'):withData({half='lower'}); spell:move('up'); spell.block=Blocks.get('wooden_door'):withData({half='upper'}); print('ok')",
posP1.getX(), posP1.getY(), posP1.getZ());
// Then:
ServerLog4jEvent act = mc().waitFor(ServerLog4jEvent.class);
assertThat(act.getMessage()).isEqualTo("ok");
IBlockState actLower = mc().getBlock(lowerDoorPos);
assertThat(actLower).isA(Blocks.OAK_DOOR).property(BlockDoor.HALF)
.isEqualTo(BlockDoor.EnumDoorHalf.LOWER);
IBlockState actUpper = mc().getBlock(upperDoorPos);
assertThat(actUpper).isA(Blocks.OAK_DOOR).property(BlockDoor.HALF)
.isEqualTo(BlockDoor.EnumDoorHalf.UPPER);
}
示例11: setDungeon
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setDungeon()
{
this.floor = Blocks.PLANKS.getDefaultState();
this.exterior = Blocks.COBBLESTONE.getDefaultState();
this.wall = Blocks.COBBLESTONE.getDefaultState();
this.light = Blocks.TORCH.getDefaultState();
this.goal = Blocks.GOLD_BLOCK.getDefaultState();
this.moat = Blocks.LAVA.getDefaultState();
this.moatContainer = Blocks.COBBLESTONE.getDefaultState();
this.doorUpper = Blocks.OAK_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.OAK_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.STONE_STAIRS.getDefaultState();
this.stairsPlatform = Blocks.COBBLESTONE.getDefaultState();
this.ladder = Blocks.LADDER.getDefaultState();
this.puzzleDoorUpper = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.LEVER.getDefaultState();
this.platform = Blocks.BOOKSHELF.getDefaultState();
this.hint = Blocks.GOLD_ORE.getDefaultState();
}
示例12: setPyramid
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setPyramid()
{
this.floor = Blocks.RED_SANDSTONE.getDefaultState();
this.exterior = Blocks.SANDSTONE.getDefaultState();
this.wall = Blocks.SANDSTONE.getDefaultState();
this.light = Blocks.TORCH.getDefaultState();
this.goal = Blocks.DIAMOND_BLOCK.getDefaultState();
this.moat = Blocks.LAVA.getDefaultState();
this.moatContainer = Blocks.SANDSTONE.getDefaultState();
this.doorUpper = Blocks.ACACIA_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.ACACIA_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.SANDSTONE_STAIRS.getDefaultState();
this.stairsPlatform = Blocks.SANDSTONE.getDefaultState();
this.ladder = Blocks.LADDER.getDefaultState();
this.puzzleDoorUpper = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.LEVER.getDefaultState();
this.platform = Blocks.RED_SANDSTONE.getDefaultState();
this.hint = Blocks.DIAMOND_ORE.getDefaultState();
}
示例13: setIgloo
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private void setIgloo()
{
this.floor = Blocks.SNOW.getDefaultState();
this.exterior = Blocks.SNOW.getDefaultState();
this.wall = Blocks.PACKED_ICE.getDefaultState();
this.light = Blocks.TORCH.getDefaultState();
this.goal = Blocks.REDSTONE_BLOCK.getDefaultState();
this.moat = Blocks.WATER.getDefaultState();
this.moatContainer = Blocks.GLOWSTONE.getDefaultState();
this.doorUpper = Blocks.SPRUCE_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.doorLower = Blocks.SPRUCE_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.stairs = Blocks.SPRUCE_STAIRS.getDefaultState();
this.stairsPlatform = Blocks.PACKED_ICE.getDefaultState();
this.ladder = Blocks.LADDER.getDefaultState();
this.puzzleDoorUpper = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
this.puzzleDoorLower = Blocks.IRON_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
this.trigger = Blocks.LEVER.getDefaultState();
this.platform = Blocks.SNOW.getDefaultState();
this.hint = Blocks.REDSTONE_ORE.getDefaultState();
}
示例14: playerLeftClick
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
@SubscribeEvent
public void playerLeftClick(PlayerInteractEvent.LeftClickBlock event) {
if (!event.getEntityPlayer().capabilities.isCreativeMode && event.getWorld().getBlockState(event.getPos()).getBlock() instanceof BlockDoor && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.WOOD) {
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_WOOD_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_WOOD_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_WOOD_PLACE, SoundCategory.BLOCKS, 1, 1);
}
if (!event.getEntityPlayer().capabilities.isCreativeMode && event.getWorld().getBlockState(event.getPos()).getBlock() instanceof BlockDoor && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.IRON) {
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
event.getWorld().playSound(null, event.getPos(), SoundEvents.BLOCK_METAL_PLACE, SoundCategory.BLOCKS, 1, 1);
}
}
示例15: findFuels
import net.minecraft.block.BlockDoor; //導入依賴的package包/類
private static void findFuels() {
afuels = new ArrayList<>();
Set<Item> efuels = excludedFuels();
for (ItemStack item : ItemList.items) {
Block block = Block.getBlockFromItem(item.getItem());
if (block instanceof BlockDoor) {
continue;
}
if (efuels.contains(item.getItem())) {
continue;
}
int burnTime = TileEntityFurnace.getItemBurnTime(item);
if (burnTime > 0) {
afuels.add(new FuelPair(item.copy(), burnTime));
}
}
}