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


Java BlockCarpet类代码示例

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


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

示例1: Volkswagen

import net.minecraft.block.BlockCarpet; //导入依赖的package包/类
public Volkswagen() {
    super("Volkswagen", 0xFFFFFF, ModuleCategory.TWEAKS);
    setHidden(true);

    listeners.add(new Listener<BlockBB>() {
        @Override
        public void call(BlockBB event) {
            String serverIP = getServerIP();

            if (serverIP == null) {
                return;
            }

            if (serverIP.toLowerCase().contains("ihaq.ca")) {
                if (new CuboidRegion(new Vec3(835, 5, 154), new Vec3(825, 5, 128)).contains(new Vec3(event.getX(), event.getY(), event.getZ()))) {
                    if (event.getBlock() instanceof BlockCarpet) {
                        event.setBoundingBox(null);
                    }
                }
            }
        }
    });


    setState(true);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:27,代码来源:Volkswagen.java

示例2: placeHut

import net.minecraft.block.BlockCarpet; //导入依赖的package包/类
public static void placeHut(final World world, BlockPos startpos, int[][][] data, IBlockState[] states, Random rand) {
  for (int pass = 0; pass <= 1; pass++) {
    for (int y = 0; y < data.length; y++) {
      for (int x = 0; x < 6; x++) {
        for (int z = 0; z < 6; z++) {
          BlockPos pos = startpos.add(x + 5, -y + 5, z + 5);
          if (data[y][z][x] != -1) {
            IBlockState state = states[data[y][z][x]];
            if (state == null || (pass == 0 && (state.getBlock() instanceof BlockCarpet || state.getBlock() instanceof BlockSapling))) {
              world.setBlockToAir(pos);
            } else if (state.getBlock() instanceof BlockFalling) {
              while (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && !world.isAirBlock(new BlockPos(pos.getX(), 0, pos.getZ()))) {
                world.setBlockState(pos, state);
                world.immediateBlockTick(pos, state, rand);
              }
            } else if (!(state.getBlock() instanceof BlockSlab)
                || (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos).getMaterial() != Material.WATER)) {
              world.setBlockState(pos, state);
            }
          }
        }
      }
    }
  }
}
 
开发者ID:HenryLoenwind,项目名称:TravelHut,代码行数:26,代码来源:WorldGenHandler.java

示例3: create

import net.minecraft.block.BlockCarpet; //导入依赖的package包/类
public static void create() {
  sandstone = Blocks.SANDSTONE.getDefaultState();
  bedrock = Blocks.BEDROCK.getDefaultState();
  slabs = Blocks.STONE_SLAB.getDefaultState().withProperty(BlockStoneSlab.VARIANT, BlockStoneSlab.EnumType.SAND).withProperty(BlockSlab.HALF,
      BlockSlab.EnumBlockHalf.TOP);
  lowslabs = Blocks.STONE_SLAB.getDefaultState().withProperty(BlockStoneSlab.VARIANT, BlockStoneSlab.EnumType.SAND).withProperty(BlockSlab.HALF,
      BlockSlab.EnumBlockHalf.BOTTOM);
  sand = Blocks.SAND.getDefaultState();
  obsidian = Blocks.OBSIDIAN.getDefaultState();

  portalLN = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.LEFT).withProperty(BlockHutPortal.FACING,
      EnumFacing.NORTH);
  portalLE = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.LEFT).withProperty(BlockHutPortal.FACING,
      EnumFacing.EAST);
  portalLS = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.LEFT).withProperty(BlockHutPortal.FACING,
      EnumFacing.SOUTH);
  portalLW = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.LEFT).withProperty(BlockHutPortal.FACING,
      EnumFacing.WEST);
  portalRN = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.RIGHT).withProperty(BlockHutPortal.FACING,
      EnumFacing.NORTH);
  portalRE = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.RIGHT).withProperty(BlockHutPortal.FACING,
      EnumFacing.EAST);
  portalRS = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.RIGHT).withProperty(BlockHutPortal.FACING,
      EnumFacing.SOUTH);
  portalRW = TravelHutMod.blockHutPortal.getDefaultState().withProperty(BlockHutPortal.TYPE, BlockHutPortal.Type.RIGHT).withProperty(BlockHutPortal.FACING,
      EnumFacing.WEST);

  carpet0 = Blocks.CARPET.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.SILVER);
  carpet1 = Blocks.CARPET.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.BLUE);
  carpet2 = Blocks.CARPET.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.RED);
  carpet3 = Blocks.CARPET.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.YELLOW);
  carpet4 = Blocks.CARPET.getDefaultState().withProperty(net.minecraft.block.BlockCarpet.COLOR, EnumDyeColor.GREEN);

  dirt = Blocks.DIRT.getDefaultState();

  sapling = Blocks.SAPLING.getDefaultState();

  MinecraftForge.EVENT_BUS.register(WorldGenHandler.class);
}
 
开发者ID:HenryLoenwind,项目名称:TravelHut,代码行数:40,代码来源:WorldGenHandler.java

示例4: getTarget

import net.minecraft.block.BlockCarpet; //导入依赖的package包/类
static BlockPos getTarget(World worldIn, BlockPos startpos, EnumFacing direction, int offset) {
  BlockPos target = startpos.offset(direction, offset * 16 - 4);
  target = new BlockPos(target.getX(), 250, target.getZ());
  if (!worldIn.isBlockLoaded(target)) {
    final int chunkX = target.getX() >> 4;
    final int chunkZ = target.getZ() >> 4;
    Chunk chunk = worldIn.getChunkFromChunkCoords(chunkX, chunkZ);
    if (!chunk.isTerrainPopulated()) {
      worldIn.getChunkFromChunkCoords(chunkX + 1, chunkZ);
      worldIn.getChunkFromChunkCoords(chunkX, chunkZ + 1);
      worldIn.getChunkFromChunkCoords(chunkX + 1, chunkZ + 1);
      worldIn.getChunkFromChunkCoords(chunkX - 1, chunkZ);
      worldIn.getChunkFromChunkCoords(chunkX, chunkZ - 1);
      worldIn.getChunkFromChunkCoords(chunkX - 1, chunkZ - 1);
    }
  }
  final Block landingBlock = Config.generateBedrock.getBoolean() ? Blocks.BEDROCK : Blocks.OBSIDIAN;
  while (worldIn.getBlockState(target).getBlock() != landingBlock) {
    target = target.down();
    if (target.getY() < 0) {
      return null;
    }
  }
  if (!(worldIn.isAirBlock(target.up()) || worldIn.getBlockState(target.up()).getBlock() instanceof BlockCarpet) || !worldIn.isAirBlock(target.up(2))) {
    return null;
  }
  return target;
}
 
开发者ID:HenryLoenwind,项目名称:TravelHut,代码行数:29,代码来源:TeleportHandler.java

示例5: registerVanillaVariantProps

import net.minecraft.block.BlockCarpet; //导入依赖的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

示例6: shouldSideBeRendered

import net.minecraft.block.BlockCarpet; //导入依赖的package包/类
@Override
public boolean shouldSideBeRendered(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos, @Nonnull EnumFacing side) {
  return super.shouldSideBeRendered(state, worldIn, pos, side)
      && !(side.getAxis() != EnumFacing.Axis.Y && worldIn.getBlockState(pos.offset(side)).getBlock() instanceof BlockCarpet);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:6,代码来源:BlockPaintedCarpet.java


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