本文整理匯總了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);
}
}
}
}
}
}