Skip to content

Commit

Permalink
fix missing texture warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Mar 14, 2019
1 parent 5f67633 commit 8e7a313
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
27 changes: 22 additions & 5 deletions src/main/java/mekanism/client/render/obj/MekanismOBJModel.java
@@ -1,5 +1,6 @@
package mekanism.client.render.obj;

import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
Expand All @@ -10,8 +11,14 @@

import com.google.common.collect.ImmutableMap;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;

@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
public class MekanismOBJModel extends OBJModel
{
public OBJModelType modelType;
Expand Down Expand Up @@ -45,17 +52,27 @@ else if(modelType == OBJModelType.TRANSMITTER)
@Override
public IModel process(ImmutableMap<String, String> customData)
{
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib(), location);
return ret;
return new MekanismOBJModel(modelType, getMatLib(), location);
}

@Override
public IModel retexture(ImmutableMap<String, String> textures)
{
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib().makeLibWithReplacements(textures), location);
return ret;
return new MekanismOBJModel(modelType, getMatLib().makeLibWithReplacements(textures), location);
}


@Override
public Collection<ResourceLocation> getTextures()
{
List<ResourceLocation> superlist = new ArrayList<>();
for (ResourceLocation r : super.getTextures()){
if (!r.getResourcePath().startsWith("#")){
superlist.add(r);
}
}
return superlist;
}

public enum OBJModelType
{
GLOW_PANEL,
Expand Down
Expand Up @@ -233,6 +233,7 @@ public static void putVertexData(UnpackedBakedQuad.Builder builder, Vertex v, No

private static Method m_updateStateVisibilityMap;

@SuppressWarnings("deprecation")
protected void updateStateVisibilityMap(OBJState state)
{
try {
Expand All @@ -249,7 +250,8 @@ protected void updateStateVisibilityMap(OBJState state)
}

private static Field f_textures;


@SuppressWarnings("unchecked")
public static ImmutableMap<String, TextureAtlasSprite> getTexturesForOBJModel(IBakedModel model)
{
try {
Expand Down

0 comments on commit 8e7a313

Please sign in to comment.