本文整理汇总了Java中net.minecraft.client.renderer.block.model.ItemOverride类的典型用法代码示例。如果您正苦于以下问题:Java ItemOverride类的具体用法?Java ItemOverride怎么用?Java ItemOverride使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItemOverride类属于net.minecraft.client.renderer.block.model包,在下文中一共展示了ItemOverride类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AnimationItemOverrideList
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
public AnimationItemOverrideList(IModel model, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, List<ItemOverride> overrides)
{
super(overrides);
this.model = model;
this.state = state;
this.format = format;
this.bakedTextureGetter = bakedTextureGetter;
}
示例2: getOverrides
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
@Override
public ItemOverrideList getOverrides()
{
return new ItemOverrideList(new ArrayList<ItemOverride>()){
@Override
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
{
if( !( stack.getItem() == Item.getItemFromBlock(ModBlocks.crystalPipe)) )
{
return originalModel;
}
return new ModelPipeBaked( stack );
}
};
}
示例3: getItemOverrides
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private List<ItemOverride> getItemOverrides(
JsonObject object,
JsonDeserializationContext deserializationContext) {
List<ItemOverride> list = Lists.<ItemOverride>newArrayList();
if (object.has("overrides")) {
for (JsonElement jsonelement : JsonUtils.getJsonArray(object, "overrides")) {
list.add((ItemOverride) deserializationContext.deserialize(jsonelement, ItemOverride.class));
}
}
return list;
}
示例4: deserialize
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
@Override
public ModelDescription deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
JsonObject jsonObject = json.getAsJsonObject();
int version = jsonObject.get("version").getAsInt();
// Currently version is ignored
if (version != 0 && version != 1) {
throw new JsonParseException("Unsupported model version");
}
boolean isLegacy = version == 0;
ISkeleton skeleton = loadSkeleton(isLegacy, jsonObject);
ResourceLocation modelLocation = new ResourceLocation(jsonObject.get("mesh").getAsString());
ModelMCMD mesh = ClientLoader.loadModel(modelLocation, skeleton);
ImmutableMap<String, ResourceLocation> textureLocatons = ImmutableMap.of();
if (version != 0) {
Builder<String, ResourceLocation> builder = ImmutableMap.builder();
JsonObject textureMap = jsonObject.getAsJsonObject("textures");
for (Entry<String, JsonElement> texEntry : textureMap.entrySet()) {
String slotName = texEntry.getKey();
if (!slotName.startsWith("#")) {
throw new JsonParseException("Slot names must begin with '#'");
}
ResourceLocation textureLocation = new ResourceLocation(texEntry.getValue().getAsString());
builder.put(slotName, textureLocation);
}
textureLocatons = builder.build();
}
ImmutableMap<TransformType, TRSRTransformation> viewMapping = parseViewMapping(jsonObject, context);
List<ItemOverride> itemOverrides = getItemOverrides(jsonObject, context);
return new ModelDescription(mesh, skeleton, textureLocatons, viewMapping, itemOverrides);
}
示例5: ModelDescription
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private ModelDescription(
ModelMCMD model,
ISkeleton skeleton,
ImmutableMap<String, ResourceLocation> textureMapping,
ImmutableMap<TransformType, TRSRTransformation> viewMapping,
List<ItemOverride> itemOverrides) {
this.model = Objects.requireNonNull(model);
this.skeleton = Objects.requireNonNull(skeleton);
this.textureMapping = Objects.requireNonNull(textureMapping);
this.viewMapping = Objects.requireNonNull(viewMapping);
this.itemOverrides = new ItemOverrideList(itemOverrides);
}
示例6: getDependencies
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private static Set<ResourceLocation> getDependencies(BakedModelWrapper bakedModel) {
Set<ResourceLocation> overrideLocations = new HashSet<>();
for (ItemOverride override : bakedModel.getOverrides().getOverrides()) {
ResourceLocation overrideLocation = override.getLocation();
overrideLocations.add(overrideLocation);
}
return overrideLocations;
}
示例7: StencilItemOverride
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
public StencilItemOverride(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
super(Collections.<ItemOverride> emptyList());
this.state = state;
this.format = format;
this.bakedTextureGetter = bakedTextureGetter;
final ResourceLocation emptyStencilTexture = StencilTextureManager.INSTANCE.getEmptyStencilTextureLocation(BACKGROUND_TEXTURE);
this.emptyBakedModel = createItemModel(emptyStencilTexture);
}
示例8: TexturedItemOverrides
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
public TexturedItemOverrides(IBakedModel untexturedModel, IModel texturedModel, List<ItemOverride> texturedModelOverrides, Set<String> texturesToReplace, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
super(Lists.reverse(texturedModelOverrides));
this.untexturedModel = untexturedModel;
this.texturedModel = texturedModel;
this.texturesToReplace = ImmutableSet.copyOf(texturesToReplace);
this.state = state;
this.format = format;
this.bakedTextureGetter = bakedTextureGetter;
}
示例9: SpellPageOverrideList
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
public SpellPageOverrideList() {
super(ImmutableList.<ItemOverride>of());
this.cache = new HashMap<String, IBakedModel>();
}
示例10: KnowledgeBookOverrideList
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
public KnowledgeBookOverrideList() {
super(ImmutableList.<ItemOverride>of());
this.cache = new HashMap<String, IBakedModel>();
}
示例11: BakedMaceOverrideHandler
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private BakedMaceOverrideHandler() {
super(ImmutableList.<ItemOverride>of());
}
示例12: BakedDaggerOverrideHandler
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private BakedDaggerOverrideHandler() {
super(ImmutableList.<ItemOverride>of());
}
示例13: BakedHoeOverrideHandler
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private BakedHoeOverrideHandler() {
super(ImmutableList.<ItemOverride>of());
}
示例14: BakedPickaxeOverrideHandler
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private BakedPickaxeOverrideHandler() {
super(ImmutableList.<ItemOverride>of());
}
示例15: BakedAxeOverrideHandler
import net.minecraft.client.renderer.block.model.ItemOverride; //导入依赖的package包/类
private BakedAxeOverrideHandler() {
super(ImmutableList.<ItemOverride>of());
}