本文整理汇总了Java中net.minecraft.client.renderer.block.model.ModelManager类的典型用法代码示例。如果您正苦于以下问题:Java ModelManager类的具体用法?Java ModelManager怎么用?Java ModelManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelManager类属于net.minecraft.client.renderer.block.model包,在下文中一共展示了ModelManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RenderItem
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public RenderItem(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_)
{
this.textureManager = p_i46552_1_;
this.modelManager = p_i46552_2_;
if (Reflector.ItemModelMesherForge_Constructor.exists())
{
this.itemModelMesher = (ItemModelMesher)Reflector.newInstance(Reflector.ItemModelMesherForge_Constructor, new Object[] {p_i46552_2_});
}
else
{
this.itemModelMesher = new ItemModelMesher(p_i46552_2_);
}
this.registerItems();
this.itemColors = p_i46552_3_;
}
示例2: renderModel
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
private void renderModel(EntityArtifactFrame entity)
{
BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
IBakedModel ibakedmodel;
if (!entity.getDisplayedItem().isEmpty() && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
{
//ModelResourceLocation mapModel = new ModelResourceLocation(new ResourceLocation("betterwithaddons",this.mapModel.getResourcePath()),this.mapModel.getVariant());
ibakedmodel = modelmanager.getModel(mapModel);
}
else
{
//ModelResourceLocation itemFrameModel = new ModelResourceLocation(new ResourceLocation("betterwithaddons",this.itemFrameModel.getResourcePath()),this.itemFrameModel.getVariant());
ibakedmodel = modelmanager.getModel(itemFrameModel);
}
//GlStateManager.pushMatrix();
//GlStateManager.translate(-0.5F, -0.5F, -0.5F);
blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: rebuildCache
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public void rebuildCache()
{
final ModelManager manager = this.getModelManager();
for (Map.Entry<Item, TIntObjectHashMap<ModelResourceLocation>> e : locations.entrySet())
{
TIntObjectHashMap<IBakedModel> mods = models.get(e.getKey());
if (mods != null)
{
mods.clear();
}
else
{
mods = new TIntObjectHashMap<IBakedModel>();
models.put(e.getKey(), mods);
}
final TIntObjectHashMap<IBakedModel> map = mods;
e.getValue().forEachEntry(new TIntObjectProcedure<ModelResourceLocation>()
{
@Override
public boolean execute(int meta, ModelResourceLocation location)
{
map.put(meta, manager.getModel(location));
return true;
}
});
}
}
示例4: RenderItem
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public RenderItem(TextureManager p_i46552_1_, ModelManager p_i46552_2_, ItemColors p_i46552_3_)
{
this.textureManager = p_i46552_1_;
this.itemModelMesher = new net.minecraftforge.client.ItemModelMesherForge(p_i46552_2_);
this.registerItems();
this.itemColors = p_i46552_3_;
}
示例5: getModel
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public Pair<IBakedModel, Matrix4f> getModel(ITurtleAccess turtle, TurtleSide side) {
final Minecraft mc = Minecraft.getMinecraft();
final ModelManager modelManager = mc.getRenderItem().getItemModelMesher().getModelManager();
// TODO: actual models
ModelResourceLocation location = new ModelResourceLocation(side == TurtleSide.Left? "computercraft:turtle_crafting_table_left" : "computercraft:turtle_crafting_table_right", "inventory");
return Pair.of(modelManager.getModel(location), null);
}
示例6: DankNullRenderItem
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public DankNullRenderItem(TextureManager textureManager, ModelManager modelManager, ItemColors colors, @Nonnull ItemStack dankNull, boolean useLg, ContainerDankNull container) {
super(textureManager, modelManager, colors);
this.useLg = useLg;
this.dankNull = dankNull;
this.container = container;
}
示例7: ItemModelMesher
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public ItemModelMesher(ModelManager modelManager)
{
this.modelManager = modelManager;
}
示例8: getModelManager
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public ModelManager getModelManager()
{
return this.modelManager;
}
示例9: BlockModelShapes
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public BlockModelShapes(ModelManager manager)
{
this.modelManager = manager;
this.registerAllBlocks();
}
示例10: doRender
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
BlockPos blockpos = entity.getHangingPosition();
double d0 = (double)blockpos.getX() - entity.posX + x;
double d1 = (double)blockpos.getY() - entity.posY + y;
double d2 = (double)blockpos.getZ() - entity.posZ + z;
GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D);
GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
IBakedModel ibakedmodel;
if (!entity.getDisplayedItem().func_190926_b() && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
{
ibakedmodel = modelmanager.getModel(this.mapModel);
}
else
{
ibakedmodel = modelmanager.getModel(this.itemFrameModel);
}
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
if (this.renderOutlines)
{
GlStateManager.enableColorMaterial();
GlStateManager.enableOutlineMode(this.getTeamColor(entity));
}
blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);
if (this.renderOutlines)
{
GlStateManager.disableOutlineMode();
GlStateManager.disableColorMaterial();
}
GlStateManager.popMatrix();
GlStateManager.translate(0.0F, 0.0F, 0.4375F);
this.renderItem(entity);
GlStateManager.popMatrix();
this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F));
}
示例11: makeModel
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的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;
}
}
示例12: getModelManager
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public static ModelManager getModelManager()
{
return minecraft.getRenderItem().modelManager;
}
示例13: getModelCull
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的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: onModelBake
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public static void onModelBake(ModelManager modelManager, IRegistry<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
{
MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader));
modelLoader.onPostBakeEvent(modelRegistry);
}
示例15: ModelBakeEvent
import net.minecraft.client.renderer.block.model.ModelManager; //导入依赖的package包/类
public ModelBakeEvent(ModelManager modelManager, IRegistry<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
{
this.modelManager = modelManager;
this.modelRegistry = modelRegistry;
this.modelLoader = modelLoader;
}