net.minecraft.block.Block.getBlockLayer()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中net.minecraft.block.Block.getBlockLayer()方法的一些代码示例,展示了Block.getBlockLayer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getBlockLayer()方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:getBlockLayer

Block.getBlockLayer介绍

暂无

代码示例

代码示例来源:origin: TheGreyGhost/MinecraftByExample

Block adjacentBlock = adjacentIBS.getBlock();
if (adjacentBlock != Blocks.AIR
  && adjacentBlock.getBlockLayer() == BlockRenderLayer.SOLID
  && adjacentBlock.isOpaqueCube(adjacentIBS)) {
 adjacentSolidBlocks.put(facing, adjacentIBS);

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void bakeModel() {
 long start = Profiler.instance.start();
 @Nonnull
 QuadCollector paintQuads = new QuadCollector();
 boolean hasPaintRendered = false;
 String cacheResult;
 if (block instanceof IBlockPaintableBlock && (!(block instanceof IWrenchHideablePaint) || !getYetaDisplayMode().isHideFacades())) {
  hasPaintRendered = PaintWrangler.wrangleBakedModel(world, pos, ((IBlockPaintableBlock) block).getPaintSource(state, world, pos), paintQuads);
 }
 if (!hasPaintRendered) {
  if (MinecraftForgeClient.getRenderLayer() == null || MinecraftForgeClient.getRenderLayer() == block.getBlockLayer()) {
   model = null;
   cacheResult = "relaying";
  } else {
   model = NULL;
   cacheResult = "none";
  }
 } else {
  model = new CollectedQuadBakedBlockModel(paintQuads);
  cacheResult = "paint only";
 }
 Profiler.instance.stop(start, state.getBlock().getLocalizedName() + " (bake, cache=" + cacheResult + ")");
}

代码示例来源:origin: SleepyTrousers/EnderIO

BlockRenderLayer layer = block.getBlockLayer();
ForgeHooksClient.setRenderLayer(layer);
List<BakedQuad> generalQuads = model.getQuads(state, null, 0);

代码示例来源:origin: SleepyTrousers/EnderIO

protected void bakeBlockLayer(QuadCollector quads) {
 if (renderMapper == nullRenderMapper) {
  IBakedModel missingModel = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
  for (BlockRenderLayer layer : quads.getBlockLayers()) {
   quads.addUnfriendlybakedModel(layer, missingModel, state, 0);
  }
 } else if (renderMapper instanceof IRenderMapper.IBlockRenderMapper.IRenderLayerAware) {
  for (BlockRenderLayer layer : quads.getBlockLayers()) {
   quads.addFriendlyBlockStates(layer, renderMapper.mapBlockRender(this, world, pos, layer, quads));
  }
 } else {
  BlockRenderLayer layer = block.getBlockLayer();
  quads.addFriendlyBlockStates(layer, renderMapper.mapBlockRender(this, world, pos, layer, quads));
  quads.addFriendlyBlockStates(BREAKING, renderMapper.mapBlockRender(this, world, pos, BREAKING, quads));
 }
}

代码示例来源:origin: Mine-and-blade-admin/Battlegear2

public static void renderItemAllPasses(EntityLivingBase livingBase, boolean inMainHand, ItemStack itemStack) {
  if (livingBase!=null)
    Minecraft.getMinecraft().getItemRenderer().renderItem(livingBase, itemStack, inMainHand ? ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND : ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND);
  else {
    GlStateManager.pushMatrix();
    boolean flag = Minecraft.getMinecraft().getRenderItem().shouldRenderItemIn3D(itemStack) && Block.getBlockFromItem(itemStack.getItem()).getBlockLayer() == BlockRenderLayer.TRANSLUCENT;
    if (flag)
    {
      GlStateManager.depthMask(false);
    }
    Minecraft.getMinecraft().getRenderItem().renderItem(itemStack, ItemCameraTransforms.TransformType.FIXED);
    if (flag)
    {
      GlStateManager.depthMask(true);
    }
    GlStateManager.popMatrix();
  }
}

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

final int pass = fluid.getBlock().getBlockLayer() == BlockRenderLayer.TRANSLUCENT ? 1 : 0;

相关文章

Block类方法