本文整理汇总了Java中net.minecraftforge.client.MinecraftForgeClient.getRenderLayer方法的典型用法代码示例。如果您正苦于以下问题:Java MinecraftForgeClient.getRenderLayer方法的具体用法?Java MinecraftForgeClient.getRenderLayer怎么用?Java MinecraftForgeClient.getRenderLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.client.MinecraftForgeClient
的用法示例。
在下文中一共展示了MinecraftForgeClient.getRenderLayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
List<BakedQuad> quads = new ArrayList<>();
switch(MinecraftForgeClient.getRenderLayer()) {
case SOLID:
//Base
quads.addAll(QuadBuilder.withFormat(format)
.setFrom(0, 0, 0)
.setTo(16, 16, 16)
.addAll(base)
.bake()
);
break;
case CUTOUT_MIPPED:
//Overlay
quads.addAll(QuadBuilder.withFormat(format)
.setFrom(0, 0, 0)
.setTo(16, 16, 16)
.setHasBrightness(true)
.addAll(overlay)
.bake()
);
break;
}
return quads;
}
示例2: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
EnumFacing face = state.getValue(BlockDirectional.FACING);
List<BakedQuad> quads = new ArrayList<>();
switch(MinecraftForgeClient.getRenderLayer()) {
case SOLID:
//Base
addCube(quads, face, base, base, base, false);
break;
case CUTOUT_MIPPED:
//Overlay
addCube(quads, face, overlay[0], overlay[1], overlay[2], true);
break;
}
return quads;
}
示例3: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
{
IBakedModel model;
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
if(layer == null)
{
return quads.get(Optional.fromNullable(side));
}
else if(!models.containsKey(Optional.of(layer)))
{
model = missing;
}
else
{
model = models.get(Optional.of(layer));
}
// assumes that child model will handle this state properly. FIXME?
return model.getQuads(state, side, rand);
}
示例4: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
private void getQuads(ModelHolder holder, List<BakedQuad> quads)
{
if (holder.actualState.getRenderType() == EnumBlockRenderType.MODEL/* ||
holder.actualState.getRenderType() == EnumBlockRenderType.LIQUID*/)
{
BlockRenderLayer originalLayer = MinecraftForgeClient.getRenderLayer();
for (BlockRenderLayer layer : BlockRenderLayer.values())
{
if (holder.actualState.getBlock().canRenderInLayer(holder.actualState, layer))
{
ForgeHooksClient.setRenderLayer(layer);
for (final EnumFacing facing : EnumFacing.values())
{
quads.addAll(holder.model.getQuads(holder.extendedState, facing, 0));
}
quads.addAll(holder.model.getQuads(holder.extendedState, null, 0));
}
}
ForgeHooksClient.setRenderLayer(originalLayer);
}
}
示例5: isAmbientOcclusion
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public boolean isAmbientOcclusion()
{
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
if(layer == null) return true;
switch(layer)
{
case SOLID:
return !this.blockRenderMode.isSolidLayerFlatLighting;
case TRANSLUCENT:
return !this.blockRenderMode.isTranlucentLayerFlatLighting;
default:
return true;
}
}
示例6: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@SuppressWarnings("null")
@Override
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
IBlockAccess world = cachedWorld.get();
BlockPos pos = cachedPos.get();
IBlockState otherState = world.getBlockState(pos.down());
if (otherState != baseState && ConfigHandler.validBlocks.contains(otherState)) {
IBakedModel newBase = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(otherState);
if (newBase != null && !(newBase instanceof BlendedModel)) {
List<BakedQuad> quads = newBase.getQuads(state, side, rand);
if (MinecraftForgeClient.getRenderLayer() == BlockRenderLayer.CUTOUT) {
quads = quads.stream().map(q -> new BakedQuadRetextured(q, oreTexture)).collect(Collectors.toList());
}
return quads;
}
}
return base.getQuads(state, side, rand);
}
示例7: addFriendlybakedModel
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
/**
* Adds a baked model that is expected to behave to the quad lists for the given block layer. The block layer will be set when the model is asked for its
* quads.
*/
public void addFriendlybakedModel(BlockRenderLayer pass, IBakedModel model, @Nullable IBlockState state, long rand) {
if (model != null) {
BlockRenderLayer oldRenderLayer = MinecraftForgeClient.getRenderLayer();
ForgeHooksClient.setRenderLayer(pass);
List<BakedQuad> generalQuads = model.getQuads(state, null, rand);
if (!generalQuads.isEmpty()) {
addQuads(null, pass, generalQuads);
}
for (EnumFacing face : EnumFacing.values()) {
List<BakedQuad> faceQuads = model.getQuads(state, face, rand);
if (!faceQuads.isEmpty()) {
addQuads(face, pass, faceQuads);
}
}
ForgeHooksClient.setRenderLayer(oldRenderLayer);
}
}
示例8: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
List<BakedQuad> quads = new ArrayList<>();
EnumFacing facing = state.getValue(BlockDirectional.FACING);
switch(MinecraftForgeClient.getRenderLayer()) {
case SOLID:
//Base
QuadBuilder base_quads = QuadBuilder.withFormat(format)
.setFrom(3, 3, 3)
.setTo(13, 4, 13)
.addAll(0F, 9F, 7F, 7F, base)
.addFace(UP, 0F, 9F, 7F, 16F, base_)
.addFace(DOWN, 0F, 9F, 7F, 16F, base)
.rotate(facing, DOWN);
quads.addAll(base_quads.bake());
break;
case CUTOUT_MIPPED:
//Overlay
QuadBuilder overlay_quads = QuadBuilder.withFormat(format)
.setFrom(3, 3, 3)
.setTo(13, 4, 13)
.addAll(0F, 9F, 15F, 16F, overlay_front)
.addFace(DOWN, 0F, 9F, 7F, 16F, overlay_front)
.addFace(UP, 0F, 9F, 7F, 16F, overlay_back)
.setHasBrightness(true)
.rotate(facing, DOWN);
quads.addAll(overlay_quads.bake());
break;
}
return quads;
}
示例9: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
List<BakedQuad> quads = new ArrayList<>();
switch(MinecraftForgeClient.getRenderLayer()) {
case SOLID:
//Base
quads.addAll(QuadBuilder.withFormat(format)
.setFrom(0, 0, 0)
.setTo(16, 16, 16)
.addAll(base)
.bake()
);
break;
case CUTOUT_MIPPED:
//Overlay
int glyph = state.getValue(State.GLYPH);
quads.addAll(QuadBuilder.withFormat(format)
.setFrom(0, 0, 0)
.setTo(16, 16, 16)
.setHasBrightness(true)
.addAll(overlay[glyph])
.bake()
);
break;
}
return quads;
}
示例10: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
protected List<BakedQuad> getQuads(IBlockState state) {
List<BakedQuad> quads = new ArrayList<>();
EnumFacing facing = state.getValue(BlockDirectional.FACING);
switch(MinecraftForgeClient.getRenderLayer()) {
case SOLID:
QuadBuilder base_quads = QuadBuilder.withFormat(format)
.setFrom(2, 0, 2)
.setTo(14, 1, 14)
.addAll(2F, 14F, 2F, 2F, base)
.addFace(UP, 2F, 14F, 3F, 14F, base)
.addFace(DOWN, 2F, 14F, 2F, 14F, base)
.rotate(facing, DOWN);
quads.addAll(base_quads.bake());
break;
case CUTOUT_MIPPED:
boolean on = state.getValue(State.ACTIVE);
//Overlay
QuadBuilder overlay_quads = QuadBuilder.withFormat(format)
.setFrom(2, 0, 2)
.setTo(14, 1, 14)
.addAll(2F, 14F, 2F, 2F, on ? top_on : top_off)
.addFace(UP, 2F, 14F, 2F, 14F, on ? top_on : top_off)
.addFace(DOWN, 2F, 14F, 2F, 14F, on ? bottom_on : bottom_off)
.setHasBrightness(true)
.rotate(facing, DOWN);
quads.addAll(overlay_quads.bake());
break;
}
return quads;
}
示例11: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
{
FakeState renderState = state != null && state instanceof FakeState ? (FakeState)state : null;
if(side !=null)
{
return Collections.emptyList();
}
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
List<BakedQuad> quads = new ArrayList<BakedQuad>();
if(layer == BlockRenderLayer.CUTOUT || layer == BlockRenderLayer.TRANSLUCENT || renderStack !=null)addPipeQuads( renderState, quads );
return quads;
}
示例12: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public List<BakedQuad> getQuads(IBlockState state, @Nullable EnumFacing side, long rand) {
if (state.getBlock() != ModBlocks.blockDeath)
{
return standard.getQuads(state, side, rand);
}
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
IBlockState heldState = ((IExtendedBlockState) state).getValue(TMGStateProps.HELD_STATE);
IBlockAccess heldWorld = ((IExtendedBlockState) state).getValue(TMGStateProps.HELD_WORLD);
BlockPos heldPos = ((IExtendedBlockState) state).getValue(TMGStateProps.HELD_POS);
if (heldWorld == null || heldPos == null)
{
return ImmutableList.of();
}
if (heldState == null || heldState.getBlock() instanceof BlockDeath)
{
return ImmutableList.of();
}
else if (TombManyGravesConfigs.FORCE_DIRT_RENDER || heldState.getBlock() == Blocks.AIR || !heldState.getBlock().canRenderInLayer(heldState,layer) || heldState.getBlock().hasTileEntity(heldState))
{
IBlockState dirtState = Blocks.DIRT.getDefaultState();
return getActualModel(ModelHelper.getTextureFromBlockstate(dirtState).getIconName()).getQuads(dirtState, side, rand);
}
else
{
IBlockState actualState = heldState.getBlock().getActualState(heldState, new FakeBlockAccess(heldWorld), heldPos);
IBakedModel model = getActualModel(ModelHelper.getTextureFromBlockstate(actualState).getIconName());
return model.getQuads(actualState, side, rand);
}
}
示例13: renderGhostBlock
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
private void renderGhostBlock(final World fakeWorld, ModelHolder holder, final EntityPlayer player, final float partialTicks)
{
boolean existingModel = this.mc.world.isAirBlock(holder.pos) == false;
if (Configs.renderOverlapping == false && existingModel)
{
return;
}
IBlockState actualState = holder.actualState;
Block block = actualState.getBlock();
if (actualState.getRenderType() == EnumBlockRenderType.MODEL/* || actualState.getRenderType() == EnumBlockRenderType.LIQUID*/)
{
BlockRenderLayer originalLayer = MinecraftForgeClient.getRenderLayer();
for (BlockRenderLayer layer : BlockRenderLayer.values())
{
if (block.canRenderInLayer(actualState, layer))
{
this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
ForgeHooksClient.setRenderLayer(layer);
this.renderGhostBlock(fakeWorld, holder, player, layer, existingModel, partialTicks);
}
}
ForgeHooksClient.setRenderLayer(originalLayer);
}
}
示例14: getQuads
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
if (layer == null) {
layer = generalLayer;
}
return getLayerQuads(state, side, layer, rand);
}
示例15: get
import net.minecraftforge.client.MinecraftForgeClient; //导入方法依赖的package包/类
IBakedModel get(BarrelCacheInfo info) {
EnumWorldBlockLayer layer = isItem ? null : MinecraftForgeClient.getRenderLayer();
int layerIndex = layer == null ? NULL_INDEX : layer.ordinal();
Map<BarrelCacheInfo, IBakedModel> perLayer = modelCache.get(layerIndex);
IBakedModel ret = perLayer.get(info);
if (ret != null) return ret;
ret = build(info, layer);
if (NORELEASE.off) { // delete this if statement
perLayer.put(info, ret);
}
return ret;
}