ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java

100 lines
5.1 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
* This file ("ClientProxy.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* <EFBFBD> 2015 Ellpeck
*/
2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.proxy;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.VillagerRegistry;
2015-03-07 12:51:28 +01:00
import ellpeck.actuallyadditions.blocks.InitBlocks;
2015-03-30 15:08:19 +02:00
import ellpeck.actuallyadditions.blocks.render.*;
2015-04-26 21:09:25 +02:00
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
2015-03-30 18:42:14 +02:00
import ellpeck.actuallyadditions.event.RenderPlayerEventAA;
import ellpeck.actuallyadditions.event.TooltipEvent;
import ellpeck.actuallyadditions.tile.*;
import ellpeck.actuallyadditions.update.UpdateCheckerClientNotifier;
import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.KeyBinds;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util;
import ellpeck.actuallyadditions.util.playerdata.PersistantClientData;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient;
import java.io.File;
@SuppressWarnings("unused")
public class ClientProxy implements IProxy{
@Override
public void preInit(FMLPreInitializationEvent event){
2015-07-01 21:32:48 +02:00
ModUtil.LOGGER.info("PreInitializing ClientProxy...");
2015-06-15 22:06:07 +02:00
PersistantClientData.setTheFile(new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"Data.dat"));
KeyBinds.init();
}
@Override
public void init(FMLInitializationEvent event){
2015-07-01 21:32:48 +02:00
ModUtil.LOGGER.info("Initializing ClientProxy...");
2015-03-30 18:42:14 +02:00
if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled()){
Util.registerEvent(new UpdateCheckerClientNotifier());
}
AssetUtil.COMPOST_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
AssetUtil.FISHING_NET_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
AssetUtil.FURNACE_SOLAR_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
AssetUtil.COFFEE_MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
AssetUtil.PHANTOM_BOOSTER_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
AssetUtil.SMILEY_CLOUD_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
2015-09-27 16:48:58 +02:00
AssetUtil.TOOL_TABLE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCompost), new RenderItems(new ModelCompost()));
2015-03-30 15:08:19 +02:00
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFishingNet.class, new RenderTileEntity(new ModelFishingNet()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockFishingNet), new RenderItems(new ModelFishingNet()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockFurnaceSolar), new RenderItems(new ModelFurnaceSolar()));
2015-03-30 18:42:14 +02:00
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoffeeMachine.class, new RenderTileEntity(new ModelCoffeeMachine()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCoffeeMachine), new RenderItems(new ModelCoffeeMachine()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPhantomBooster.class, new RenderTileEntity(new ModelPhantomBooster()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockPhantomBooster), new RenderItems(new ModelPhantomBooster()));
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud(new ModelSmileyCloud()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockSmileyCloud), new RenderItems(new ModelSmileyCloud()));
2015-09-27 16:48:58 +02:00
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityToolTable.class, new RenderTileEntity(new ModelToolTable()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockToolTable), new RenderItems(new ModelToolTable()));
VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png"));
Util.registerEvent(new TooltipEvent());
2015-03-30 18:42:14 +02:00
Util.registerEvent(new RenderPlayerEventAA());
}
@Override
public void postInit(FMLPostInitializationEvent event){
2015-07-01 21:32:48 +02:00
ModUtil.LOGGER.info("PostInitializing ClientProxy...");
}
}