本文整理汇总了Java中net.minecraft.client.renderer.block.model.IBakedModel.getQuads方法的典型用法代码示例。如果您正苦于以下问题:Java IBakedModel.getQuads方法的具体用法?Java IBakedModel.getQuads怎么用?Java IBakedModel.getQuads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.block.model.IBakedModel
的用法示例。
在下文中一共展示了IBakedModel.getQuads方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dbgModel
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public static void dbgModel(IBakedModel p_dbgModel_0_)
{
if (p_dbgModel_0_ != null)
{
Config.dbg("Model: " + p_dbgModel_0_ + ", ao: " + p_dbgModel_0_.isAmbientOcclusion() + ", gui3d: " + p_dbgModel_0_.isGui3d() + ", builtIn: " + p_dbgModel_0_.isBuiltInRenderer() + ", particle: " + p_dbgModel_0_.getParticleTexture());
EnumFacing[] aenumfacing = EnumFacing.VALUES;
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List list = p_dbgModel_0_.getQuads((IBlockState)null, enumfacing, 0L);
dbgQuads(enumfacing.getName(), list, " ");
}
List list1 = p_dbgModel_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L);
dbgQuads("General", list1, " ");
}
}
示例2: duplicateModel
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public static IBakedModel duplicateModel(IBakedModel p_duplicateModel_0_)
{
List list = duplicateQuadList(p_duplicateModel_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L));
EnumFacing[] aenumfacing = EnumFacing.VALUES;
Map<EnumFacing, List<BakedQuad>> map = new HashMap();
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List list1 = p_duplicateModel_0_.getQuads((IBlockState)null, enumfacing, 0L);
List list2 = duplicateQuadList(list1);
map.put(enumfacing, list2);
}
SimpleBakedModel simplebakedmodel = new SimpleBakedModel(list, map, p_duplicateModel_0_.isAmbientOcclusion(), p_duplicateModel_0_.isGui3d(), p_duplicateModel_0_.getParticleTexture(), p_duplicateModel_0_.getItemCameraTransforms(), p_duplicateModel_0_.getOverrides());
return simplebakedmodel;
}
示例3: getQuads
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的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: renderModel
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
private static void renderModel(IBakedModel model, VertexFormat fmt)
{
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder worldrenderer = tessellator.getBuffer();
worldrenderer.begin(GL11.GL_QUADS, fmt);
for (BakedQuad bakedquad : model.getQuads(null, null, 0))
{
worldrenderer.addVertexData(bakedquad.getVertexData());
}
tessellator.draw();
}
示例5: renderModelSmooth
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public boolean renderModelSmooth(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);
for (EnumFacing enumfacing : EnumFacing.VALUES)
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)) && (!Hacks.findMod(XRay.class).isEnabled() || !XRay.xrayBlocks.contains(stateIn.getBlock())))
{
list = BlockModelCustomizer.getRenderQuads(list, worldIn, stateIn, posIn, enumfacing, rand, renderenv);
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list, renderenv);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
list1 = BlockModelCustomizer.getRenderQuads(list1, worldIn, stateIn, posIn, (EnumFacing)null, rand, renderenv);
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list1, renderenv);
flag = true;
}
return flag;
}
示例6: renderModelFlat
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
RenderEnv renderenv = buffer.getRenderEnv(worldIn, stateIn, posIn);
for (EnumFacing enumfacing : EnumFacing.VALUES)
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
list = BlockModelCustomizer.getRenderQuads(list, worldIn, stateIn, posIn, enumfacing, rand, renderenv);
this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, renderenv);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
list1 = BlockModelCustomizer.getRenderQuads(list1, worldIn, stateIn, posIn, (EnumFacing)null, rand, renderenv);
this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, renderenv);
flag = true;
}
return flag;
}
示例7: getLeavesModel
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public static IBakedModel getLeavesModel(IBakedModel p_getLeavesModel_0_)
{
if (!Config.isTreesSmart())
{
return p_getLeavesModel_0_;
}
else
{
List list = p_getLeavesModel_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L);
return list == generalQuadsCullAcacia ? modelLeavesDoubleAcacia : (list == generalQuadsCullBirch ? modelLeavesDoubleBirch : (list == generalQuadsCullDarkOak ? modelLeavesDoubleDarkOak : (list == generalQuadsCullJungle ? modelLeavesDoubleJungle : (list == generalQuadsCullOak ? modelLeavesDoubleOak : (list == generalQuadsCullSpruce ? modelLeavesDoubleSpruce : p_getLeavesModel_0_)))));
}
}
示例8: renderModelSmooth
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public boolean renderModelSmooth(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
float[] afloat = new float[EnumFacing.values().length * 2];
BitSet bitset = new BitSet(3);
BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = new BlockModelRenderer.AmbientOcclusionFace();
for (EnumFacing enumfacing : EnumFacing.values())
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
this.renderQuadsSmooth(worldIn, stateIn, posIn, buffer, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
}
return flag;
}
示例9: renderModelFlat
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public boolean renderModelFlat(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = false;
BitSet bitset = new BitSet(3);
for (EnumFacing enumfacing : EnumFacing.values())
{
List<BakedQuad> list = modelIn.getQuads(stateIn, enumfacing, rand);
if (!list.isEmpty() && (!checkSides || stateIn.shouldSideBeRendered(worldIn, posIn, enumfacing)))
{
int i = stateIn.getPackedLightmapCoords(worldIn, posIn.offset(enumfacing));
this.renderQuadsFlat(worldIn, stateIn, posIn, i, false, buffer, list, bitset);
flag = true;
}
}
List<BakedQuad> list1 = modelIn.getQuads(stateIn, (EnumFacing)null, rand);
if (!list1.isEmpty())
{
this.renderQuadsFlat(worldIn, stateIn, posIn, -1, true, buffer, list1, bitset);
flag = true;
}
return flag;
}
示例10: makeModel
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
public static IBakedModel makeModel(String p_makeModel_0_, TextureAtlasSprite p_makeModel_1_, TextureAtlasSprite p_makeModel_2_)
{
if (p_makeModel_1_ != null && p_makeModel_2_ != null)
{
ModelManager modelmanager = Config.getModelManager();
if (modelmanager == null)
{
return null;
}
else
{
ModelResourceLocation modelresourcelocation = new ModelResourceLocation(p_makeModel_0_, "normal");
IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);
if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel())
{
IBakedModel ibakedmodel1 = ModelUtils.duplicateModel(ibakedmodel);
EnumFacing[] aenumfacing = EnumFacing.VALUES;
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List<BakedQuad> list = ibakedmodel1.getQuads((IBlockState)null, enumfacing, 0L);
replaceTexture(list, p_makeModel_1_, p_makeModel_2_);
}
List<BakedQuad> list1 = ibakedmodel1.getQuads((IBlockState)null, (EnumFacing)null, 0L);
replaceTexture(list1, p_makeModel_1_, p_makeModel_2_);
return ibakedmodel1;
}
else
{
return null;
}
}
}
else
{
return null;
}
}
示例11: getNeighbourIcon
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
private static TextureAtlasSprite getNeighbourIcon(IBlockAccess p_getNeighbourIcon_0_, IBlockState p_getNeighbourIcon_1_, BlockPos p_getNeighbourIcon_2_, IBlockState p_getNeighbourIcon_3_, int p_getNeighbourIcon_4_)
{
p_getNeighbourIcon_3_ = p_getNeighbourIcon_3_.getBlock().getActualState(p_getNeighbourIcon_3_, p_getNeighbourIcon_0_, p_getNeighbourIcon_2_);
IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(p_getNeighbourIcon_3_);
if (ibakedmodel == null)
{
return null;
}
else
{
EnumFacing enumfacing = getFacing(p_getNeighbourIcon_4_);
List list = ibakedmodel.getQuads(p_getNeighbourIcon_3_, enumfacing, 0L);
if (Config.isBetterGrass())
{
list = BetterGrass.getFaceQuads(p_getNeighbourIcon_0_, p_getNeighbourIcon_3_, p_getNeighbourIcon_2_, enumfacing, list);
}
if (list.size() > 0)
{
BakedQuad bakedquad1 = (BakedQuad)list.get(0);
return bakedquad1.getSprite();
}
else
{
List list1 = ibakedmodel.getQuads(p_getNeighbourIcon_3_, (EnumFacing)null, 0L);
for (int i = 0; i < list1.size(); ++i)
{
BakedQuad bakedquad = (BakedQuad)list1.get(i);
if (bakedquad.getFace() == enumfacing)
{
return bakedquad.getSprite();
}
}
return null;
}
}
}
示例12: getGeneralQuadsSafe
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
private static List getGeneralQuadsSafe(IBakedModel p_getGeneralQuadsSafe_0_)
{
return p_getGeneralQuadsSafe_0_ == null ? null : p_getGeneralQuadsSafe_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L);
}
示例13: getModelCull
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
static IBakedModel getModelCull(String p_getModelCull_0_, List p_getModelCull_1_)
{
ModelManager modelmanager = Config.getModelManager();
if (modelmanager == null)
{
return null;
}
else
{
ResourceLocation resourcelocation = new ResourceLocation("blockstates/" + p_getModelCull_0_ + "_leaves.json");
if (Config.getDefiningResourcePack(resourcelocation) != Config.getDefaultResourcePack())
{
return null;
}
else
{
ResourceLocation resourcelocation1 = new ResourceLocation("models/block/" + p_getModelCull_0_ + "_leaves.json");
if (Config.getDefiningResourcePack(resourcelocation1) != Config.getDefaultResourcePack())
{
return null;
}
else
{
ModelResourceLocation modelresourcelocation = new ModelResourceLocation(p_getModelCull_0_ + "_leaves", "normal");
IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation);
if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel())
{
List list = ibakedmodel.getQuads((IBlockState)null, (EnumFacing)null, 0L);
if (list.size() == 0)
{
return ibakedmodel;
}
else if (list.size() != 6)
{
return null;
}
else
{
for (Object bakedquad : list)
{
List list1 = ibakedmodel.getQuads((IBlockState)null, ((BakedQuad) bakedquad).getFace(), 0L);
if (list1.size() > 0)
{
return null;
}
list1.add(bakedquad);
}
list.clear();
p_getModelCull_1_.add(p_getModelCull_0_ + "_leaves");
return ibakedmodel;
}
}
else
{
return null;
}
}
}
}
}
示例14: getModelDoubleFace
import net.minecraft.client.renderer.block.model.IBakedModel; //导入方法依赖的package包/类
private static IBakedModel getModelDoubleFace(IBakedModel p_getModelDoubleFace_0_)
{
if (p_getModelDoubleFace_0_ == null)
{
return null;
}
else if (p_getModelDoubleFace_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L).size() > 0)
{
Config.warn("SmartLeaves: Model is not cube, general quads: " + p_getModelDoubleFace_0_.getQuads((IBlockState)null, (EnumFacing)null, 0L).size() + ", model: " + p_getModelDoubleFace_0_);
return p_getModelDoubleFace_0_;
}
else
{
EnumFacing[] aenumfacing = EnumFacing.VALUES;
for (int i = 0; i < aenumfacing.length; ++i)
{
EnumFacing enumfacing = aenumfacing[i];
List<BakedQuad> list = p_getModelDoubleFace_0_.getQuads((IBlockState)null, enumfacing, 0L);
if (list.size() != 1)
{
Config.warn("SmartLeaves: Model is not cube, side: " + enumfacing + ", quads: " + list.size() + ", model: " + p_getModelDoubleFace_0_);
return p_getModelDoubleFace_0_;
}
}
IBakedModel ibakedmodel = ModelUtils.duplicateModel(p_getModelDoubleFace_0_);
List[] alist = new List[aenumfacing.length];
for (int k = 0; k < aenumfacing.length; ++k)
{
EnumFacing enumfacing1 = aenumfacing[k];
List<BakedQuad> list1 = ibakedmodel.getQuads((IBlockState)null, enumfacing1, 0L);
BakedQuad bakedquad = (BakedQuad)list1.get(0);
BakedQuad bakedquad1 = new BakedQuad((int[])bakedquad.getVertexData().clone(), bakedquad.getTintIndex(), bakedquad.getFace(), bakedquad.getSprite());
int[] aint = bakedquad1.getVertexData();
int[] aint1 = (int[])aint.clone();
int j = aint.length / 4;
System.arraycopy(aint, 0 * j, aint1, 3 * j, j);
System.arraycopy(aint, 1 * j, aint1, 2 * j, j);
System.arraycopy(aint, 2 * j, aint1, 1 * j, j);
System.arraycopy(aint, 3 * j, aint1, 0 * j, j);
System.arraycopy(aint1, 0, aint, 0, aint1.length);
list1.add(bakedquad1);
}
return ibakedmodel;
}
}