use of com.wuest.prefab.Config.Structures.BasicStructureConfiguration.EnumBasicStructureName in project MC-Prefab by Brian-Wuest.
the class ItemRenderRegister method regItem.
/**
* Registers an item to be rendered. This is needed for textures.
* @param item The item to register.
* @param metaData The meta data for the item to register.
* @param blockName the name of the block.
*/
public static void regItem(Item item, int metaData, String blockName) {
ModelResourceLocation location = new ModelResourceLocation(blockName, "inventory");
if (!(item instanceof ItemBasicStructure)) {
ModelLoader.setCustomModelResourceLocation(item, metaData, location);
} else {
ArrayList<ResourceLocation> names = new ArrayList<ResourceLocation>();
for (EnumBasicStructureName value : EnumBasicStructureName.values()) {
if (value.getResourceLocation() != null) {
names.add(value.getResourceLocation());
}
}
ResourceLocation[] resources = new ResourceLocation[names.size()];
resources = names.toArray(resources);
ModelLoader.registerItemVariants(item, resources);
}
}
use of com.wuest.prefab.Config.Structures.BasicStructureConfiguration.EnumBasicStructureName in project MC-Prefab by Brian-Wuest.
the class ItemBasicStructure method getSubItems.
/**
* returns a list of items with the same ID, but different meta (eg: dye
* returns 16 items)
*/
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
if (this.isInCreativeTab(tab)) {
for (EnumBasicStructureName value : EnumBasicStructureName.values()) {
if (value.getResourceLocation() != null) {
ItemStack stack = new ItemStack(this);
IStructureConfigurationCapability capability = stack.getCapability(ModRegistry.StructureConfiguration, EnumFacing.NORTH);
capability.getConfiguration().basicStructureName = value;
subItems.add(stack);
}
}
}
}
use of com.wuest.prefab.Config.Structures.BasicStructureConfiguration.EnumBasicStructureName in project MC-Prefab by Brian-Wuest.
the class ClientEventHandler method regItem.
/**
* Registers an item to be rendered. This is needed for textures.
* @param item The item to register.
* @param metaData The meta data for the item to register.
* @param blockName the name of the block.
*/
public static void regItem(Item item, int metaData, String blockName) {
ModelResourceLocation location = new ModelResourceLocation(blockName, "inventory");
if (!(item instanceof ItemBasicStructure)) {
ModelLoader.setCustomModelResourceLocation(item, metaData, location);
} else {
ArrayList<ResourceLocation> names = new ArrayList<ResourceLocation>();
for (EnumBasicStructureName value : EnumBasicStructureName.values()) {
if (value.getResourceLocation() != null) {
names.add(value.getResourceLocation());
}
}
ResourceLocation[] resources = new ResourceLocation[names.size()];
resources = names.toArray(resources);
ModelLoader.registerItemVariants(item, resources);
}
}
Aggregations