Search in sources :

Example 1 with AudioLibrary

use of mchorse.blockbuster.audio.AudioLibrary in project blockbuster by mchorse.

the class ClientProxy method preLoad.

/**
 * Register mod items, blocks, tile entites and entities, load item,
 * block models and register entity renderer.
 */
@Override
public void preLoad(FMLPreInitializationEvent event) {
    super.preLoad(event);
    /* Items */
    this.registerItemModel(Blockbuster.playbackItem, Blockbuster.path("playback"));
    this.registerItemModel(Blockbuster.registerItem, Blockbuster.path("register"));
    this.registerItemModel(Blockbuster.actorConfigItem, Blockbuster.path("actor_config"));
    this.registerItemModel(Blockbuster.gunItem, Blockbuster.path("gun"));
    /* Blocks */
    this.registerItemModel(Blockbuster.directorBlock, Blockbuster.path("director"));
    final ModelResourceLocation modelStatic = new ModelResourceLocation(Blockbuster.path("model_static"), "inventory");
    final ModelResourceLocation model = new ModelResourceLocation(Blockbuster.path("model"), "inventory");
    /* Register model block's configurable render disable */
    Item item = Item.getItemFromBlock(Blockbuster.modelBlock);
    ModelBakery.registerItemVariants(item, model, modelStatic);
    ModelLoader.setCustomMeshDefinition(item, (stack) -> Blockbuster.modelBlockDisableItemRendering.get() ? modelStatic : model);
    Blockbuster.modelBlockItem.setTileEntityItemStackRenderer(new TileEntityModelItemStackRenderer());
    Blockbuster.gunItem.setTileEntityItemStackRenderer(new TileEntityGunItemStackRenderer());
    /* Entities */
    this.registerEntityRender(EntityActor.class, new RenderActor.FactoryActor());
    this.registerEntityRender(EntityGunProjectile.class, new RenderGunProjectile.FactoryGunProjectile());
    /* Tile entity */
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityModel.class, modelRenderer = new TileEntityModelRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDirector.class, new TileEntityDirectorRenderer());
    this.injectResourcePack(CommonProxy.configFile.getAbsolutePath());
    /* Structure morph */
    StructureMorph.STRUCTURES = new HashMap<String, StructureRenderer>();
    audio = new AudioLibrary(new File(CommonProxy.configFile, "audio"));
    skinsFolder = new File(configFile, "skins");
    skinsFolder.mkdirs();
}
Also used : AudioLibrary(mchorse.blockbuster.audio.AudioLibrary) RenderActor(mchorse.blockbuster.client.render.RenderActor) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) StructureRenderer(mchorse.blockbuster_pack.morphs.structure.StructureRenderer) TileEntityDirectorRenderer(mchorse.blockbuster.client.render.tileentity.TileEntityDirectorRenderer) Item(net.minecraft.item.Item) RenderGunProjectile(mchorse.blockbuster.client.render.RenderGunProjectile) TileEntityModelItemStackRenderer(mchorse.blockbuster.client.render.tileentity.TileEntityModelItemStackRenderer) TileEntityModelRenderer(mchorse.blockbuster.client.render.tileentity.TileEntityModelRenderer) TileEntityGunItemStackRenderer(mchorse.blockbuster.client.render.tileentity.TileEntityGunItemStackRenderer) File(java.io.File)

Aggregations

File (java.io.File)1 AudioLibrary (mchorse.blockbuster.audio.AudioLibrary)1 RenderActor (mchorse.blockbuster.client.render.RenderActor)1 RenderGunProjectile (mchorse.blockbuster.client.render.RenderGunProjectile)1 TileEntityDirectorRenderer (mchorse.blockbuster.client.render.tileentity.TileEntityDirectorRenderer)1 TileEntityGunItemStackRenderer (mchorse.blockbuster.client.render.tileentity.TileEntityGunItemStackRenderer)1 TileEntityModelItemStackRenderer (mchorse.blockbuster.client.render.tileentity.TileEntityModelItemStackRenderer)1 TileEntityModelRenderer (mchorse.blockbuster.client.render.tileentity.TileEntityModelRenderer)1 StructureRenderer (mchorse.blockbuster_pack.morphs.structure.StructureRenderer)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 Item (net.minecraft.item.Item)1