Port 8e7a313a2 fix missing texture warnings (#5365)

This commit is contained in:
Richard Freimer authored and GitHub committed 2019-04-09 00:10:15 -04:00
1 parent 7e3cfb8d02
commit b82a74cb75
2 files changed
+14 -6

No files matched your search

@@ -1,7 +1,9 @@
package mekanism.client.render.obj;
import com.google.common.collect.ImmutableMap;
import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -13,8 +15,8 @@ import net.minecraftforge.common.model.IModelState;
public class MekanismOBJModel extends OBJModel {
public OBJModelType modelType;
public ResourceLocation location;
private OBJModelType modelType;
private ResourceLocation location;
public MekanismOBJModel(OBJModelType type, MaterialLibrary matLib, ResourceLocation modelLocation) {
super(matLib, modelLocation);
@@ -43,15 +45,19 @@ public class MekanismOBJModel extends OBJModel {
@Nonnull
@Override
public IModel process(@Nonnull ImmutableMap<String, String> customData) {
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib(), location);
return ret;
return new MekanismOBJModel(modelType, getMatLib(), location);
}
@Nonnull
@Override
public IModel retexture(@Nonnull ImmutableMap<String, String> textures) {
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib().makeLibWithReplacements(textures), location);
return ret;
return new MekanismOBJModel(modelType, getMatLib().makeLibWithReplacements(textures), location);
}
@Nonnull
@Override
public Collection<ResourceLocation> getTextures() {
return super.getTextures().stream().filter(r -> !r.getPath().startsWith("#")).collect(Collectors.toList());
}
public enum OBJModelType {
@@ -105,6 +105,7 @@ public abstract class OBJBakedModelBase extends OBJBakedModel {
}
}
@SuppressWarnings("unchecked")
public static ImmutableMap<String, TextureAtlasSprite> getTexturesForOBJModel(IBakedModel model) {
try {
if (f_textures == null) {
@@ -218,6 +219,7 @@ public abstract class OBJBakedModelBase extends OBJBakedModel {
return quadList;
}
@SuppressWarnings("deprecation")
protected void updateStateVisibilityMap(OBJState state) {
try {
if (m_updateStateVisibilityMap == null) {