mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.
This commit is contained in:
1 parent
7e4d7077a5
commit
a9d23f5e78
133 files changed
+489
-623
No files matched your search
@@ -49,7 +49,7 @@ public class ClientCommandHandler extends CommandHandler
|
||||
String[] args = new String[temp.length - 1];
|
||||
String commandName = temp[0];
|
||||
System.arraycopy(temp, 1, args, 0, args.length);
|
||||
ICommand icommand = (ICommand) getCommands().get(commandName);
|
||||
ICommand icommand = getCommands().get(commandName);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -7,8 +7,7 @@ import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class EnumHelperClient extends EnumHelper
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static Class[][] clentTypes =
|
||||
private static Class<?>[][] clientTypes =
|
||||
{
|
||||
{GameType.class, int.class, String.class},
|
||||
{Options.class, String.class, boolean.class, boolean.class},
|
||||
@@ -32,6 +31,6 @@ public class EnumHelperClient extends EnumHelper
|
||||
|
||||
public static <T extends Enum<? >> T addEnum(Class<T> enumType, String enumName, Object... paramValues)
|
||||
{
|
||||
return addEnum(clentTypes, enumType, enumName, paramValues);
|
||||
return addEnum(clientTypes, enumType, enumName, paramValues);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,6 @@ import net.minecraftforge.fml.common.FMLLog;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@@ -110,7 +109,7 @@ public class ForgeHooksClient
|
||||
}
|
||||
|
||||
//Optifine Helper Functions u.u, these are here specifically for Optifine
|
||||
//Note: When using Optfine, these methods are invoked using reflection, which
|
||||
//Note: When using Optifine, these methods are invoked using reflection, which
|
||||
//incurs a major performance penalty.
|
||||
public static void orientBedCamera(IBlockAccess world, BlockPos pos, IBlockState state, Entity entity)
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ public class GuiIngameForge extends GuiIngame
|
||||
renderExperience(width, height);
|
||||
}
|
||||
|
||||
renderToolHightlight(res);
|
||||
renderToolHighlight(res);
|
||||
renderHUDText(width, height);
|
||||
renderPotionIcons(res);
|
||||
renderRecordOverlay(width, height, partialTicks);
|
||||
@@ -466,21 +466,21 @@ public class GuiIngameForge extends GuiIngame
|
||||
int x = left - i * 8 - 9;
|
||||
int y = top;
|
||||
int icon = 16;
|
||||
byte backgound = 0;
|
||||
byte background = 0;
|
||||
|
||||
if (mc.thePlayer.isPotionActive(MobEffects.hunger))
|
||||
{
|
||||
icon += 36;
|
||||
backgound = 13;
|
||||
background = 13;
|
||||
}
|
||||
if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this
|
||||
if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this
|
||||
|
||||
if (player.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
|
||||
{
|
||||
y = top + (rand.nextInt(3) - 1);
|
||||
}
|
||||
|
||||
drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9);
|
||||
drawTexturedModalRect(x, y, 16 + background * 9, 27, 9, 9);
|
||||
|
||||
if (unused)
|
||||
{
|
||||
@@ -602,7 +602,7 @@ public class GuiIngameForge extends GuiIngame
|
||||
post(JUMPBAR);
|
||||
}
|
||||
|
||||
protected void renderToolHightlight(ScaledResolution res)
|
||||
protected void renderToolHighlight(ScaledResolution res)
|
||||
{
|
||||
if (this.mc.gameSettings.heldItemTooltips && !this.mc.playerController.isSpectator())
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user