net.minecraft.client.Minecraft.getBlockRendererDispatcher()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(169)

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

Minecraft.getBlockRendererDispatcher介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

@Nonnull
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
  if((cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND
      || cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND)
      && ConfigHandler.lexicon3dModel)
    return Pair.of(this, null);
  IBakedModel original = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path2D);
  return original.handlePerspective(cameraTransformType);
}

代码示例来源:origin: Vazkii/Botania

@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
  IExtendedBlockState extendedState = (IExtendedBlockState) state;
  String subtileId = extendedState.getValue(BotaniaStateProps.SUBTILE_ID);
  IBakedModel model = bakedBlockModels.get(subtileId == null ? "" : subtileId);
  if(model == null)
    model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
  return model.getQuads(state, face, rand);
}

代码示例来源:origin: Vazkii/Botania

private void renderBlock(Block block) {
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(block.getDefaultState(), 1.0F);
  }
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
  if(type == RenderType.HEAD) {
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    GlStateManager.scale(0.5F, 0.5F, 0.5F);
    GlStateManager.translate(0, -1.5F, 0.5F);
    Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(ModBlocks.tinyPlanet.getDefaultState(), 1.0F);
  }
}

代码示例来源:origin: Vazkii/Botania

return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, side, rand);
  return mc.getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getModel(path).getQuads(state, side, rand);
} else if(heldState != null) {
    IBakedModel model = mc.getBlockRendererDispatcher().getBlockModelShapes().getModelForState(actual);

代码示例来源:origin: Vazkii/Botania

@Override
  public void render(@Nonnull TileCocoon cocoon, double d0, double d1, double d2, float f, int digProgress, float unused) {
    float rot = 0F;
    float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
    if(cocoon.timePassed % modval < 10) {
      float mod = (cocoon.timePassed + f) % modval;
      float v = mod / 5 * (float) Math.PI * 2;
      rot = (float) Math.sin(v) * (float) Math.log(cocoon.timePassed + f);
    }

    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.color(1F, 1F, 1F, 1F);
    GlStateManager.translate(d0, d1, d2 + 1);
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    GlStateManager.translate(0.5F, 0, 0F);
    GlStateManager.rotate(rot, 1F, 0F, 0F);
    GlStateManager.translate(-0.5F, 0, 0F);
    IBlockState state = cocoon.getWorld().getBlockState(cocoon.getPos());
    IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(state);
    Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, false);
    GlStateManager.color(1F, 1F, 1F);
    GlStateManager.enableRescaleNormal();
    GlStateManager.popMatrix();
  }
}

代码示例来源:origin: Vazkii/Botania

@Nonnull
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing face, long rand) {
  if(state.getBlock() != ModBlocks.floatingSpecialFlower && state.getBlock() != ModBlocks.floatingFlower)
    return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand);
  IExtendedBlockState realState = (IExtendedBlockState) state;
  IFloatingFlower.IslandType islandType = realState.getValue(BotaniaStateProps.ISLAND_TYPE);
  String identifier;
  if(state.getBlock() == ModBlocks.floatingSpecialFlower) {
    // Magic flower
    identifier = realState.getValue(BotaniaStateProps.SUBTILE_ID);
  } else {
    // Mundane flower
    identifier = MUNDANE_PREFIX + state.getValue(BotaniaStateProps.COLOR).getMetadata();
  }
  return getModel(islandType, identifier).getQuads(state, face, rand);
}

代码示例来源:origin: Vazkii/Botania

@Override
public void render(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress, float unused) {
  if(ConfigHandler.staticFloaters)
    return;
  if (tile != null)
    if (!tile.getWorld().isBlockLoaded(tile.getPos(), false))
      return;
  BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
  GlStateManager.pushMatrix();
  GlStateManager.color(1F, 1F, 1F, 1F);
  GlStateManager.translate(d0, d1, d2);
  double worldTime = ClientTickHandler.ticksInGame + t;
  if(tile.getWorld() != null)
    worldTime += new Random(tile.getPos().hashCode()).nextInt(1000);
  GlStateManager.translate(0.5F, 0, 0.5F);
  GlStateManager.rotate(-((float) worldTime * 0.5F), 0F, 1F, 0F);
  GlStateManager.translate(-0.5, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0.5);
  GlStateManager.rotate(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F);
  Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  IBlockState state = tile.getWorld().getBlockState(tile.getPos());
  state = state.getBlock().getExtendedState(state, tile.getWorld(), tile.getPos());
  IBakedModel model = brd.getBlockModelShapes().getModelManager().getModel(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory"));
  brd.getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, true);
  GlStateManager.popMatrix();
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );

代码示例来源:origin: Vazkii/Botania

private static void doRenderComponent(Multiblock mb, MultiblockComponent comp, BlockPos pos) {
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    IBlockState state = comp.getBlockState();
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    if(state == null)
      return;
    if(IMultiblockRenderHook.renderHooks.containsKey(state.getBlock())) {
      GlStateManager.color(1F, 1F, 1F, 1F);
      IMultiblockRenderHook renderHook = IMultiblockRenderHook.renderHooks.get(state.getBlock());
      if(renderHook.needsTranslate(state)) {
        GlStateManager.translate(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
      }
      renderHook.renderBlockForMultiblock(blockAccess, mb, state, comp);
    }
    else {
      BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
      GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ() + 1);
      GlStateManager.color(1, 1, 1, 1);
      brd.renderBlockBrightness(state, 1.0F);
    }
    GlStateManager.color(1F, 1F, 1F, 1F);
    GlStateManager.enableDepth();
    GlStateManager.popMatrix();
  }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

IBlockAccess facadeAccess = new FacadeBlockAccess( parentWorld, pos, side, blockState );
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();

代码示例来源:origin: Vazkii/Botania

Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F);
GlStateManager.translate(0, f + 0.001, 0);
GlStateManager.rotate(-90, 0, 1, 0);
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F);
GlStateManager.translate(0, 0.001, 0);
GlStateManager.rotate(-90, 0, 1, 0);
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F);
GlStateManager.translate(0, -0.001, 0.001);
GlStateManager.rotate(-90, 0, 1, 0);
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F);
GlStateManager.translate(-0.001, 0, -0.001);
GlStateManager.rotate(-90, 0, 1, 0);
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(carpet, 1.0F);

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );

代码示例来源:origin: Vazkii/Botania

if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
BlockPos pos = te.getPos();
IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();

代码示例来源:origin: Vazkii/Botania

private static void renderBlockAt(Block block, int meta, BlockPos pos) {
  IBlockState state = block.getStateFromMeta(meta);
  double renderPosX = Minecraft.getMinecraft().getRenderManager().renderPosX;
  double renderPosY = Minecraft.getMinecraft().getRenderManager().renderPosY;
  double renderPosZ = Minecraft.getMinecraft().getRenderManager().renderPosZ;
  GlStateManager.pushMatrix();
  GlStateManager.translate(-renderPosX, -renderPosY, -renderPosZ);
  GlStateManager.disableDepth();
  
  GlStateManager.pushMatrix();
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher();
  GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ() + 1);
  GlStateManager.color(1, 1, 1, 1);
  brd.renderBlockBrightness(state, 1.0F);
  GlStateManager.color(1F, 1F, 1F, 1F);
  GlStateManager.enableDepth();
  GlStateManager.popMatrix();
  GlStateManager.popMatrix();
}

代码示例来源:origin: Vazkii/Botania

int green = (color & 0xFF00) >> 8;
int blue = color & 0xFF;
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(pool == null ? ModBlocks.pool.getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, forceVariant) : pool.getWorld().getBlockState(pool.getPos()));
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(model, 1.0F, red / 255F, green / 255F, blue / 255F);

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

@Override
public @Nonnull TextureAtlasSprite getParticleTexture() {
 return particleTexture != null ? particleTexture
   : Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getParticleTexture();
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

@Override
public void doRender( final EntityTinyTNTPrimed tnt, final double x, final double y, final double z, final float unused, final float life )
  final BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
  GlStateManager.pushMatrix();
  GlStateManager.translate( (float) x, (float) y + 0.25F, (float) z );

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState( blockState );

相关文章