Revert binary-incompatible changes in models.

This commit is contained in:
RainWarrior 2016-02-04 13:34:40 +03:00
parent e611162de5
commit 085b28ba35
8 changed files with 25 additions and 22 deletions

View File

@ -0,0 +1,12 @@
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);
}

View File

@ -68,7 +68,7 @@ public class ItemLayerModel implements IRetexturableModel<ItemLayerModel>
return TRSRTransformation.identity(); return TRSRTransformation.identity();
} }
public ItemLayerModel retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
ImmutableList.Builder<ResourceLocation> builder = ImmutableList.builder(); ImmutableList.Builder<ResourceLocation> builder = ImmutableList.builder();
for(int i = 0; i < textures.size() + this.textures.size(); i++) for(int i = 0; i < textures.size() + this.textures.size(); i++)

View File

@ -140,7 +140,7 @@ public class ModelDynBucket implements IModel, IModelCustomData<ModelDynBucket>,
* If the fluid can't be found, water is used * If the fluid can't be found, water is used
*/ */
@Override @Override
public ModelDynBucket process(ImmutableMap<String, String> customData) public IModel process(ImmutableMap<String, String> customData)
{ {
String fluidName = customData.get("fluid"); String fluidName = customData.get("fluid");
Fluid fluid = FluidRegistry.getFluid(fluidName); Fluid fluid = FluidRegistry.getFluid(fluidName);
@ -171,7 +171,7 @@ public class ModelDynBucket implements IModel, IModelCustomData<ModelDynBucket>,
* If no liquid is given a hardcoded variant for the bucket is used. * If no liquid is given a hardcoded variant for the bucket is used.
*/ */
@Override @Override
public ModelDynBucket retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
ResourceLocation base = baseLocation; ResourceLocation base = baseLocation;

View File

@ -397,7 +397,7 @@ public class ModelFluid implements IModelCustomData<ModelFluid>
} }
@Override @Override
public ModelFluid process(ImmutableMap<String, String> customData) public IModel process(ImmutableMap<String, String> customData)
{ {
if(!customData.containsKey("fluid")) return this; if(!customData.containsKey("fluid")) return this;

View File

@ -591,7 +591,7 @@ public class ModelLoader extends ModelBakery
} }
@Override @Override
public VanillaModelWrapper retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
if (textures.isEmpty()) if (textures.isEmpty())
return this; return this;

View File

@ -94,7 +94,7 @@ public class MultiLayerModel implements IModelCustomData<MultiLayerModel>
} }
@Override @Override
public MultiLayerModel process(ImmutableMap<String, String> customData) public IModel process(ImmutableMap<String, String> customData)
{ {
ImmutableMap.Builder<Optional<EnumWorldBlockLayer>, ModelResourceLocation> builder = ImmutableMap.builder(); ImmutableMap.Builder<Optional<EnumWorldBlockLayer>, ModelResourceLocation> builder = ImmutableMap.builder();
for(String key : customData.keySet()) for(String key : customData.keySet())

View File

@ -580,7 +580,7 @@ public class B3DLoader implements ICustomModelLoader
} }
@Override @Override
public Wrapper retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
ImmutableMap.Builder<String, ResourceLocation> builder = ImmutableMap.builder(); ImmutableMap.Builder<String, ResourceLocation> builder = ImmutableMap.builder();
for(Map.Entry<String, ResourceLocation> e : this.textures.entrySet()) for(Map.Entry<String, ResourceLocation> e : this.textures.entrySet())
@ -602,7 +602,7 @@ public class B3DLoader implements ICustomModelLoader
} }
@Override @Override
public Wrapper process(ImmutableMap<String, String> customData) public IModel process(ImmutableMap<String, String> customData)
{ {
return this; return this;
} }
@ -712,7 +712,7 @@ public class B3DLoader implements ICustomModelLoader
} }
@Override @Override
public ModelWrapper retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
ImmutableMap.Builder<String, ResourceLocation> builder = ImmutableMap.builder(); ImmutableMap.Builder<String, ResourceLocation> builder = ImmutableMap.builder();
for(Map.Entry<String, ResourceLocation> e : this.textures.entrySet()) for(Map.Entry<String, ResourceLocation> e : this.textures.entrySet())
@ -734,7 +734,7 @@ public class B3DLoader implements ICustomModelLoader
} }
@Override @Override
public ModelWrapper process(ImmutableMap<String, String> data) public IModel process(ImmutableMap<String, String> data)
{ {
if(data.containsKey("mesh")) if(data.containsKey("mesh"))
{ {

View File

@ -32,16 +32,7 @@ import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IFlexibleBakedModel; import net.minecraftforge.client.model.*;
import net.minecraftforge.client.model.IModelCustomData;
import net.minecraftforge.client.model.IModelPart;
import net.minecraftforge.client.model.IModelState;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.client.model.IRetexturableModel;
import net.minecraftforge.client.model.ISmartBlockModel;
import net.minecraftforge.client.model.ISmartItemModel;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.client.model.pipeline.LightUtil; import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.property.IExtendedBlockState; import net.minecraftforge.common.property.IExtendedBlockState;
@ -131,14 +122,14 @@ public class OBJModel implements IRetexturableModel<OBJModel>, IModelCustomData<
} }
@Override @Override
public OBJModel process(ImmutableMap<String, String> customData) public IModel process(ImmutableMap<String, String> customData)
{ {
OBJModel ret = new OBJModel(this.matLib, this.modelLocation, new CustomData(this.customData, customData)); OBJModel ret = new OBJModel(this.matLib, this.modelLocation, new CustomData(this.customData, customData));
return ret; return ret;
} }
@Override @Override
public OBJModel retexture(ImmutableMap<String, String> textures) public IModel retexture(ImmutableMap<String, String> textures)
{ {
OBJModel ret = new OBJModel(this.matLib.makeLibWithReplacements(textures), this.modelLocation, this.customData); OBJModel ret = new OBJModel(this.matLib.makeLibWithReplacements(textures), this.modelLocation, this.customData);
return ret; return ret;