Restored glass model that implements the uv shift.
Added a way to register built-in models to support this.
This commit is contained in:
@@ -18,6 +18,7 @@ import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -42,6 +43,9 @@ class ItemRendering implements IItemRendering
|
||||
@SideOnly( Side.CLIENT )
|
||||
private Set<ResourceLocation> variants = new HashSet<>();
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private Map<String, IModel> builtInModels = new HashMap<>();
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IItemRendering meshDefinition( ItemMeshDefinition meshDefinition )
|
||||
@@ -73,6 +77,13 @@ class ItemRendering implements IItemRendering
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRendering builtInModel( String name, IModel model )
|
||||
{
|
||||
this.builtInModels.put( name, model );
|
||||
return this;
|
||||
}
|
||||
|
||||
void apply( FeatureFactory factory, Item item )
|
||||
{
|
||||
if( this.itemMeshDefinition != null )
|
||||
@@ -110,6 +121,8 @@ class ItemRendering implements IItemRendering
|
||||
factory.addBootstrapComponent( new ItemModelComponent( item, ImmutableMap.of( 0, model ) ) );
|
||||
}
|
||||
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( !resources.isEmpty() )
|
||||
{
|
||||
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
|
||||
|
||||
Reference in New Issue
Block a user