public static IBakedModel makeModelCube(TextureAtlasSprite p_makeModelCube_0_, int p_makeModelCube_1_) { List list = new ArrayList(); 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 = new ArrayList(); list1.add(makeBakedQuad(enumfacing, p_makeModelCube_0_, p_makeModelCube_1_)); map.put(enumfacing, list1); } ItemOverrideList itemoverridelist = new ItemOverrideList(new ArrayList()); IBakedModel ibakedmodel = new SimpleBakedModel(list, map, true, true, p_makeModelCube_0_, ItemCameraTransforms.DEFAULT, itemoverridelist); return ibakedmodel; }
public BakedItemModel(ImmutableList<BakedQuad> quads, TextureAtlasSprite particle, ImmutableMap<TransformType, TRSRTransformation> transforms, ItemOverrideList overrides, IBakedModel otherModel) { this.quads = quads; this.particle = particle; this.transforms = transforms; this.overrides = overrides; if(otherModel != null) { this.otherModel = otherModel; this.isCulled = true; } else { ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder(); for(BakedQuad quad : quads) { if(quad.getFace() == EnumFacing.SOUTH) { builder.add(quad); } } this.otherModel = new BakedItemModel(builder.build(), particle, transforms, overrides, this); isCulled = false; } }
public BakedModelWrapper( ModelMCMD model, IModelState state, VertexFormat format, ImmutableMap<String, TextureAtlasSprite> slotToSprite, ItemOverrideList itemOverrides) { this.actualModel = Objects.requireNonNull(model); this.slotToSprite = Objects.requireNonNull(slotToSprite); this.bakedState = Objects.requireNonNull(state); this.format = Objects.requireNonNull(format); // There is at least the "missingno" texture in the list particleSprite = getParticleSprite(slotToSprite); this.stateInformation = new ModelStateInformation(); stateInformation.setAnimation(new AnimationStateProxy(state)); stateInformation.setFrame(0); this.itemOverrides = Objects.requireNonNull(itemOverrides); }
public BakedItemModel(ModelCustomLayers parent, VertexFormat format, ImmutableList<BakedQuad> quads, TextureAtlasSprite particle, ImmutableMap<TransformType, TRSRTransformation> transforms, ItemOverrideList overrides, @Nullable IBakedModel otherModel) { this.parent = parent; this.format = format; this.quads = quads; this.particle = particle; this.transforms = transforms; this.overrides = overrides; if(otherModel != null) { this.otherModel = otherModel; this.isCulled = true; } else { ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder(); for(BakedQuad quad : quads) { if(quad.getFace() == EnumFacing.SOUTH) { builder.add(quad); } } this.otherModel = new BakedItemModel(parent, format, builder.build(), particle, transforms, overrides, this); isCulled = false; } }
@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 ); } }; }
@Override public ItemOverrideList getOverrides() { return new ItemOverrideList(ImmutableList.of()) { @Override public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { IBakedModel model = ModelBakery.getCachedItemModel(stack); if (model == null) { return originalModel; } return model; } }; }
@Override public ItemOverrideList getOverrides() { return new ItemOverrideList(Collections.emptyList()) { @Override public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { ModelHandle mh = ModelHandle.of(BASE_MODEL); if (state != null) { mh = mh.state(state); } NBTTagCompound tag = stack.getTagCompound(); if (tag != null) { String book = tag.getString("Book"); BookDocument bookDocument = BookRegistry.get(new ResourceLocation(book)); if (bookDocument != null) { ResourceLocation cover = bookDocument.getBookCover(); if (cover != null) mh = mh.replace("#CoverGraphics", cover.toString()); } } return mh.get(); } }; }
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); }
private ModelWrapper( ResourceLocation file, ModelMCMD model, Map<TransformType, TRSRTransformation> viewTransformations, Map<String, ResourceLocation> slotToTex, Multimap<ResourceLocation, String> textureToSlot, ItemOverrideList itemOverrides) { this.modelLocation = Objects.requireNonNull(file); this.actualModel = Objects.requireNonNull(model); this.viewTransformations = new HashMap<>(viewTransformations); this.slotToTexture = new HashMap<>(slotToTex); this.textureToSlots = MultimapBuilder.hashKeys().hashSetValues().build(textureToSlot); this.itemOverrides = Objects.requireNonNull(itemOverrides); }
@Override public void preInit() { CustomModelLoader.INSTANCE.registerModel(new ResourceLocation("betterchests:models/block/betterchest"), (a, b, c) -> new BuiltInModel(TESRBChest.TRANSFORMS, ItemOverrideList.NONE)); CustomModelLoader.INSTANCE.registerModel(new ResourceLocation("betterchests:models/item/filter"), new ModelFilter()); CustomModelLoader.INSTANCE.registerModel(new ResourceLocation("betterchests:models/item/betterportablebarrel"), new ModelPortableBarrel()); keyBind = new KeyBinding("betterchests.keybind.openbag", Keyboard.KEY_ADD, "betterchests:keybind.category"); }
@Override public ItemOverrideList getOverrides() { return new ItemOverrideList(Collections.emptyList()) { @Override public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { if (ItemFilter.getInventoryFor(stack).isBlacklist()) { return blacklist; } else { return whitelist; } } }; }
@Override public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) { final IModel untexturedModel = getModel(this.untexturedModel); final IBakedModel untexturedBakedModel = untexturedModel.bake(new ModelStateComposition(state, untexturedModel.getDefaultState()), format, bakedTextureGetter); final IModel texturedModel = getModel(this.texturedModel); final IBakedModel texturedBakedModel = texturedModel.bake(new ModelStateComposition(state, texturedModel.getDefaultState()), format, bakedTextureGetter); final ItemOverrideList overrides = new TexturedItemOverrides(untexturedBakedModel, texturedModel, texturedBakedModel.getOverrides().getOverrides(), textures, state, format, bakedTextureGetter); return new BakedModel(untexturedBakedModel, PerspectiveMapWrapper.getTransforms(state), overrides); }
@Override public ItemOverrideList getOverrides() { return originalModel.getOverrides(); }
@Override public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
@Override public ItemOverrideList getOverrides() { return null; }
@Override public ItemOverrideList getOverrides() { return SpellPageOverrideList.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return KnowledgeBookOverrideList.INSTANCE; }
@Override public ItemOverrideList getOverrides() { throw new UnsupportedOperationException("The finalized model does not have an override list."); }
@Override public ItemOverrideList getOverrides() { return overrides; }
@Override public ItemOverrideList getOverrides() { return new ItemOverrideList(Collections.emptyList()); }
@Override public ItemOverrideList getOverrides() { return BakedMaceOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedDaggerOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedHoeOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedPickaxeOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedAxeOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedHammerOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedShovelOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedSwordOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedHandpickOverrideHandler.INSTANCE; }
@Override public ItemOverrideList getOverrides() { return BakedModelInstrument.ItemOverrideListHandler.INSTANCE; }
public AnimationItemOverrideList(IModel model, IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, ItemOverrideList overrides) { this(model, state, format, bakedTextureGetter, overrides.getOverrides()); }