mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Implement forge IBakedModel methods in vanilla wrapper models
This commit is contained in:
1 parent
e62805f1d7
commit
8f9e52c260
6 files changed
+131
-17
No files matched your search
@@ -22,7 +22,6 @@ package net.minecraftforge.client.extensions;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -34,7 +34,8 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.vector.TransformationMatrix;
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
@@ -42,7 +43,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemMultiLayerBakedModel implements IBakedModel
|
||||
public class ItemMultiLayerBakedModel implements IDynamicBakedModel
|
||||
{
|
||||
private final boolean smoothLighting;
|
||||
private final boolean shadedInGui;
|
||||
@@ -67,10 +68,10 @@ public class ItemMultiLayerBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand)
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand, IModelData modelData)
|
||||
{
|
||||
List<BakedQuad> quads = Lists.newArrayList();
|
||||
layerModels.forEach(lm -> quads.addAll(lm.getFirst().getQuads(state, side, rand, EmptyModelData.INSTANCE)));
|
||||
layerModels.forEach(lm -> quads.addAll(lm.getFirst().getQuads(state, side, rand, modelData)));
|
||||
return quads;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.util.math.vector.TransformationMatrix;
|
||||
import net.minecraft.client.renderer.model.*;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
@@ -44,7 +43,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeRenderTypes;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
import net.minecraftforge.client.model.data.IDynamicBakedModel;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -109,7 +108,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
);
|
||||
}
|
||||
|
||||
private static final class MultiLayerBakedModel implements IBakedModel
|
||||
private static final class MultiLayerBakedModel implements IDynamicBakedModel
|
||||
{
|
||||
private final ImmutableMap<RenderType, IBakedModel> models;
|
||||
private final ImmutableMap<TransformType, TransformationMatrix> cameraTransforms;
|
||||
@@ -143,13 +142,6 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand)
|
||||
{
|
||||
return getQuads(state, side, rand, EmptyModelData.INSTANCE);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand, @Nonnull IModelData extraData)
|
||||
|
||||
Reference in new issue
Block a user