mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Fix ItemLayerModel erroneously adding particle texture to layer texture list (#9441)
This commit is contained in:
1 parent
e6aaaff3f3
commit
01846c729a
3 files changed
+5
-4
No files matched your search
+2
-1
@@ -12,6 +12,7 @@
|
||||
"render_types": {},
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/coal",
|
||||
"layer1": "minecraft:item/stick"
|
||||
"layer1": "minecraft:item/stick",
|
||||
"particle": "minecraft:block/red_stained_glass"
|
||||
}
|
||||
}
|
||||
@@ -56,10 +56,9 @@ public class ItemLayerModel implements IUnbakedGeometry<ItemLayerModel>
|
||||
@Override
|
||||
public BakedModel bake(IGeometryBakingContext context, ModelBaker baker, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState, ItemOverrides overrides, ResourceLocation modelLocation)
|
||||
{
|
||||
if (textures == null) {
|
||||
if (textures == null)
|
||||
{
|
||||
ImmutableList.Builder<Material> builder = ImmutableList.builder();
|
||||
if (context.hasMaterial("particle"))
|
||||
builder.add(context.getMaterial("particle"));
|
||||
for (int i = 0; context.hasMaterial("layer" + i); i++)
|
||||
{
|
||||
builder.add(context.getMaterial("layer" + i));
|
||||
|
||||
@@ -201,6 +201,7 @@ public class NewModelLoaderTest
|
||||
protected void registerModels()
|
||||
{
|
||||
withExistingParent(NewModelLoaderTest.item_layers.getId().getPath(), "forge:item/default")
|
||||
.texture("particle", "minecraft:block/red_stained_glass")
|
||||
.texture("layer0", "minecraft:item/coal")
|
||||
.texture("layer1", "minecraft:item/stick")
|
||||
.customLoader(ItemLayerModelBuilder::begin)
|
||||
|
||||
Reference in new issue
Block a user