本文整理汇总了Java中net.minecraft.item.Item.hasCustomProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Item.hasCustomProperties方法的具体用法?Java Item.hasCustomProperties怎么用?Java Item.hasCustomProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.Item
的用法示例。
在下文中一共展示了Item.hasCustomProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemModelWithOverrides
import net.minecraft.item.Item; //导入方法依赖的package包/类
public IBakedModel getItemModelWithOverrides(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entitylivingbaseIn)
{
IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
Item item = stack.getItem();
if (Config.isCustomItems() && item != null && item.hasCustomProperties())
{
this.modelLocation = ibakedmodel.getOverrides().applyOverride(stack, worldIn, entitylivingbaseIn);
}
if (Reflector.ForgeItemOverrideList_handleItemState.exists())
{
return (IBakedModel)Reflector.call(ibakedmodel.getOverrides(), Reflector.ForgeItemOverrideList_handleItemState, new Object[] {ibakedmodel, stack, worldIn, entitylivingbaseIn});
}
else if (item != null && item.hasCustomProperties())
{
ResourceLocation resourcelocation = ibakedmodel.getOverrides().applyOverride(stack, worldIn, entitylivingbaseIn);
return resourcelocation == null ? ibakedmodel : this.itemModelMesher.getModelManager().getModel(new ModelResourceLocation(resourcelocation, "inventory"));
}
else
{
return ibakedmodel;
}
}
示例2: loadItemModels
import net.minecraft.item.Item; //导入方法依赖的package包/类
private void loadItemModels()
{
this.registerVariantNames();
for (Item item : Item.REGISTRY)
{
for (String s : this.getVariantNames(item))
{
ResourceLocation resourcelocation = this.getItemLocation(s);
ResourceLocation resourcelocation1 = (ResourceLocation)Item.REGISTRY.getNameForObject(item);
this.loadItemModel(s, resourcelocation, resourcelocation1);
if (item.hasCustomProperties())
{
ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);
if (modelblock != null)
{
for (ResourceLocation resourcelocation2 : modelblock.getOverrideLocations())
{
this.loadItemModel(resourcelocation2.toString(), resourcelocation2, resourcelocation1);
}
}
}
}
}
}
示例3: loadItemModels
import net.minecraft.item.Item; //导入方法依赖的package包/类
protected void loadItemModels()
{
this.registerVariantNames();
for (Item item : Item.REGISTRY)
{
for (String s : this.getVariantNames(item))
{
ResourceLocation resourcelocation = this.getItemLocation(s);
ResourceLocation resourcelocation1 = (ResourceLocation)Item.REGISTRY.getNameForObject(item);
this.loadItemModel(s, resourcelocation, resourcelocation1);
if (item.hasCustomProperties())
{
ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation);
if (modelblock != null)
{
for (ResourceLocation resourcelocation2 : modelblock.getOverrideLocations())
{
this.loadItemModel(resourcelocation2.toString(), resourcelocation2, resourcelocation1);
}
}
}
}
}
}