Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.

This commit is contained in:
RainWarrior committed 2016-03-24 22:22:20 +03:00
1 parent 7e4d7077a5
commit a9d23f5e78
133 files changed
+489 -623

No files matched your search

@@ -33,7 +33,7 @@ public class Attributes
int padding = 0;
int j = 0;
for(VertexFormatElement firstAttr : (List<VertexFormatElement>)first.getElements())
for(VertexFormatElement firstAttr : first.getElements())
{
while(j < second.getElementCount() && second.getElement(j).getUsage() == EnumUsage.PADDING)
{
@@ -16,7 +16,6 @@ import net.minecraft.client.renderer.block.model.VariantList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fml.common.FMLLog;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;
@@ -159,7 +158,7 @@ public class BlockStateLoader
}
/**
* Used to replace the base model with a retextured model containing submodels.
* Used to replace the base model with a re-textured model containing sub-models.
*/
@Override
public IModel process(IModel base)
@@ -176,9 +175,9 @@ public class BlockStateLoader
return base;
}
// Apply rotation of base model to submodels.
// Apply rotation of base model to sub-models.
// If baseRot is non-null, then that rotation will be applied instead of the base model's rotation.
// This is used to allow replacing base model with a submodel when there is no base model for a variant.
// This is used to allow replacing base model with a sub-model when there is no base model for a variant.
IModelState baseTr = getState();
ImmutableMap.Builder<String, Pair<IModel, IModelState>> models = ImmutableMap.builder();
for (Entry<String, SubModel> entry : parts.entrySet())
@@ -473,7 +473,7 @@ public class ForgeBlockStateV1 extends Marker
for (Entry<String, JsonElement> e : json.get("textures").getAsJsonObject().entrySet())
{
if (e.getValue().isJsonNull())
ret.textures.put(e.getKey(), ""); // We have to use "" because ImmutibleMaps don't allow nulls -.-
ret.textures.put(e.getKey(), ""); // We have to use "" because ImmutableMaps don't allow nulls -.-
else
ret.textures.put(e.getKey(), e.getValue().getAsString());
}
@@ -1,12 +0,0 @@
package net.minecraftforge.client.model;
import com.google.common.collect.ImmutableSet;
/**
* Created by rainwarrior on 2/2/16.
*/
public interface IModelWithSubmodels<M extends IModelWithSubmodels<M>> extends IModel
{
M setDefaultSubmodelEnabled (boolean value);
M setSubmodelsEnabled(ImmutableSet<String> submodelNames, boolean show);
}
@@ -31,7 +31,7 @@ public class MapModelState implements IModelState
public MapModelState(Map<Wrapper, IModelState> map, IModelState def)
{
this.map = ImmutableMap.<Wrapper, IModelState>copyOf(map);
this.map = ImmutableMap.copyOf(map);
this.def = def;
}
@@ -10,18 +10,17 @@ import javax.vecmath.Vector4f;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.block.model.ModelRotation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelRotation;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.model.IModelPart;
import net.minecraftforge.common.model.IModelState;
@@ -717,16 +717,13 @@ public final class ModelLoader extends ModelBakery
IModel model = ModelLoaderRegistry.getModel(loc);
// FIXME: is this the place? messes up dependency and texture resolution
if (v instanceof ISmartVariant)
model = v.process(model);
for(ResourceLocation location : model.getDependencies())
{
model = ((ISmartVariant)v).process(model);
for(ResourceLocation location : model.getDependencies())
{
ModelLoaderRegistry.getModelOrMissing(location);
}
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
textures.addAll(model.getTextures()); // Kick this, just in case.
ModelLoaderRegistry.getModelOrMissing(location);
}
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
textures.addAll(model.getTextures()); // Kick this, just in case.
models.add(model);
builder.add(Pair.of(model, v.getState()));
@@ -33,7 +33,7 @@ public enum Animation
}
/**
* Iternal hook, do not use.
* Internal hook, do not use.
*/
public static void setClientPartialTickTime(float clientPartialTickTime) {
Animation.INSTANCE.clientPartialTickTime = clientPartialTickTime;
@@ -551,12 +551,12 @@ public class ModelBlockAnimation
}
catch(IOException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model aniamtion %s, skipping", armatureLocation);
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model animation %s, skipping", armatureLocation);
return defaultModelBlockAnimation;
}
catch(JsonParseException e)
{
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model aniamtion %s, skipping", armatureLocation);
FMLLog.log(Level.ERROR, e, "Exception loading vanilla model animation %s, skipping", armatureLocation);
return defaultModelBlockAnimation;
}
}
@@ -60,7 +60,7 @@ public enum B3DClip implements IClip
{
ret = ret.compose(new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null));
}
// TODO animated TRSR for speed?
// TODO animated TRSRTransformation for speed?
else
{
ret = ret.compose(endTr);
@@ -74,7 +74,7 @@ import com.google.gson.JsonParser;
/*
* Loader for Blitz3D models.
* To enable for your mod call instance.addDomain(modid).
* To enable for your mod call instance.addDomain(modId).
* If you need more control over accepted resources - extend the class, and register a new instance with ModelLoaderRegistry.
*/
public enum B3DLoader implements ICustomModelLoader
@@ -139,7 +139,7 @@ public enum B3DLoader implements ICustomModelLoader
{
return new ModelWrapper(modelLocation, model, ImmutableSet.<String>of(), true, true, 1);
}
return new ModelWrapper(modelLocation, model, ImmutableSet.of(((Node<Mesh>)model.getRoot()).getName()), true, true, 1);
return new ModelWrapper(modelLocation, model, ImmutableSet.of(model.getRoot().getName()), true, true, 1);
}
public static final class B3DState implements IModelState
@@ -208,7 +208,7 @@ public enum B3DLoader implements ICustomModelLoader
public Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part)
{
// TODO optionify better
// TODO make more use of Optional
if(!part.isPresent()) return parent.apply(part);
if(!(part.get() instanceof NodeJoint))
{
@@ -277,7 +277,7 @@ public enum B3DLoader implements ICustomModelLoader
// current node local pose
ret = ret.compose(new TRSRTransformation(key.getPos(), key.getRot(), key.getScale(), null));
// this part moved inside the model
// inverse bind of the curent node
// inverse bind of the current node
/*Matrix4f rm = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
rm.invert();
ret = ret.compose(new TRSRTransformation(rm));
@@ -60,7 +60,7 @@ public class B3DModel
public static class Parser
{
private static final int version = 0001;
private static final int version = 1;
private final ByteBuffer buf;
private byte[] tag = new byte[4];
@@ -204,7 +204,7 @@ public class B3DModel
if(version / 100 > Parser.version / 100)
throw new IOException("Unsupported major model version: " + ((float)version / 100));
if(version % 100 > Parser.version % 100)
logger.warn(String.format("Minor version differnce in model: ", ((float)version / 100)));
logger.warn(String.format("Minor version difference in model: ", ((float)version / 100)));
List<Texture> textures = Collections.emptyList();
List<Brush> brushes = Collections.emptyList();
Node<?> root = null;
@@ -22,6 +22,7 @@ import javax.vecmath.Vector4f;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
@@ -29,17 +30,17 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.*;
import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IModelCustomData;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.client.model.IRetexturableModel;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.model.IModelPart;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.fml.common.FMLLog;
@@ -1281,7 +1282,7 @@ public class OBJModel implements IRetexturableModel, IModelCustomData
INSTANCE;
public String getName()
{
return "OBJPropery";
return "OBJProperty";
}
@Override