6f2bbfab4c
- Refactored boostrap code: * Completely reworked item/block/tile registration. * Fixed server side startup. * Fixed server side startup. * More documentation. * More heavy cleanup * More cleanups. * Major refactoring of state mapping and fixes a lot of other issue related to item rendering. * Fixes sky chest item models (no item TESR). * Only use CachingRotatingBakedModel for tile entities automatically. Fix default rotation of quartz pillar for item model. * Used method reference instead of lambda for ItemMeshDefinition for multiparts. * Removed unnecessary IHasSpecialItemModel * Removed unused IconReg class. * Updated resource pack version.
34 lines
791 B
Java
34 lines
791 B
Java
package appeng.bootstrap.components;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.util.ResourceLocation;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import appeng.bootstrap.IBootstrapComponent;
|
|
|
|
|
|
public class ItemVariantsComponent implements IBootstrapComponent
|
|
{
|
|
|
|
private final Item item;
|
|
|
|
private final Collection<ResourceLocation> resources;
|
|
|
|
public ItemVariantsComponent( Item item, Collection<ResourceLocation> resources )
|
|
{
|
|
this.item = item;
|
|
this.resources = resources;
|
|
}
|
|
|
|
@Override
|
|
public void preInitialize( Side side )
|
|
{
|
|
ResourceLocation[] resourceArr = resources.toArray( new ResourceLocation[0] );
|
|
ModelBakery.registerItemVariants( item, resourceArr );
|
|
}
|
|
}
|