net.minecraftforge.fml.client.registry.ClientRegistry Java Examples

The following examples show how to use net.minecraftforge.fml.client.registry.ClientRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientProxy.java    From IGW-mod with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent event){
    MinecraftForge.EVENT_BUS.register(new TickHandler());

    MinecraftForge.EVENT_BUS.register(new TooltipOverlayHandler());

    //Not being used, as it doesn't really add anything...
    // MinecraftForge.EVENT_BUS.register(new HighlightHandler());

    openInterfaceKey = new KeyBinding("igwmod.keys.wiki", Constants.DEFAULT_KEYBIND_OPEN_GUI, "igwmod.keys.category");//TODO blend keybinding category in normal
    ClientRegistry.registerKeyBinding(openInterfaceKey);
    MinecraftForge.EVENT_BUS.register(this);//subscribe to key events.

    ConfigHandler.init(event.getSuggestedConfigurationFile());

    WikiRegistry.registerWikiTab(new IGWWikiTab());
    WikiRegistry.registerWikiTab(new BlockAndItemWikiTab());
    WikiRegistry.registerWikiTab(new EntityWikiTab());

    WikiRegistry.registerRecipeIntegrator(new IntegratorImage());
    WikiRegistry.registerRecipeIntegrator(new IntegratorCraftingRecipe());
    WikiRegistry.registerRecipeIntegrator(new IntegratorFurnace());
    WikiRegistry.registerRecipeIntegrator(new IntegratorStack());
    WikiRegistry.registerRecipeIntegrator(new IntegratorComment());
}
 
Example #2
Source File: ShulkerViewer.java    From ForgeHax with MIT License 6 votes vote down vote up
public ShulkerViewer() {
  super(Category.RENDER, "ShulkerViewer", false, "View the contents of a shulker box.");
  ClientRegistry.registerKeyBinding(lockDownKey);
  lockDownKey.setKeyConflictContext(
      new IKeyConflictContext() {
        @Override
        public boolean isActive() {
          return MC.currentScreen instanceof GuiContainer;
        }
        
        @Override
        public boolean conflicts(IKeyConflictContext other) {
          return false; // this will never conflict as
        }
      });
}
 
Example #3
Source File: ClientProxy.java    From Cyberware with MIT License 6 votes vote down vote up
@Override
public void preInit()
{
	super.preInit();
	
	for (Block block : CyberwareContent.blocks)
	{
		registerRenders(block);
	}
	
	for (Item item : CyberwareContent.items)
	{
		registerRenders(item);
	}

	ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySurgeryChamber.class, new TileEntitySurgeryChamberRenderer());
	RenderingRegistry.registerEntityRenderingHandler(EntityCyberZombie.class, RenderCyberZombie::new);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityScanner.class, new TileEntityScannerRenderer());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEngineeringTable.class, new TileEntityEngineeringRenderer());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBeaconPostMaster.class, new TileEntityBeaconLargeRenderer());

}
 
Example #4
Source File: ClientProxyControl.java    From Valkyrien-Skies with Apache License 2.0 6 votes vote down vote up
private static void registerTileEntityRenderers() {
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetworkRelay.class,
        new BasicNodeTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShipHelm.class,
        new ShipHelmTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySpeedTelegraph.class,
        new SpeedTelegraphTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPropellerEngine.class,
        new PropellerEngineTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityValkyriumEnginePart.class,
        new ValkyriumEnginePartTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGearbox.class,
        new GearboxTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLiftLever.class,
        new LiftLeverTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityValkyriumCompressorPart.class,
        new ValkyriumCompressorPartTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRudderPart.class,
        new RudderPartTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGiantPropellerPart.class,
        new GiantPropellerPartTileEntityRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRotationAxle.class,
        new RotationAxleTileEntityRenderer());
}
 
Example #5
Source File: ProxyClient.java    From EnderStorage with MIT License 6 votes vote down vote up
@Override
public void clientSetup(FMLClientSetupEvent event) {
    ScreenManager.registerFactory(ModContent.containerItemStorage, GuiEnderItemStorage::new);

    spriteHelper.addIIconRegister(EnderPouchBakery.INSTANCE);
    ClientRegistry.bindTileEntityRenderer(tileEnderChestType, RenderTileEnderChest::new);
    ClientRegistry.bindTileEntityRenderer(tileEnderTankType, RenderTileEnderTank::new);

    if (!EnderStorageConfig.disableCreatorVisuals) {
        for (PlayerRenderer renderPlayer : Minecraft.getInstance().getRenderManager().getSkinMap().values()) {
            renderPlayer.addLayer(new TankLayerRenderer(renderPlayer));
        }
    }

    ModelResourceLocation invLocation = new ModelResourceLocation(itemEnderPouch.getRegistryName(), "inventory");
    modelHelper.register(invLocation, new CCBakeryModel());
    ModelBakery.registerItemKeyGenerator(itemEnderPouch, stack -> {
        Frequency frequency = Frequency.readFromStack(stack);
        boolean open = EnderStorageManager.instance(true).getStorage(frequency, EnderItemStorage.TYPE).openCount() > 0;
        return ModelBakery.defaultItemKeyGenerator.generateKey(stack) + "|" + frequency.toModelLoc() + "|" + open;
    });

    modelHelper.register(new ModelResourceLocation(itemEnderChest.getRegistryName(), "inventory"), new EnderChestItemRender());
    modelHelper.register(new ModelResourceLocation(itemEnderTank.getRegistryName(), "inventory"), new EnderTankItemRender());
}
 
Example #6
Source File: ProxyClient.java    From WearableBackpacks with MIT License 6 votes vote down vote up
@Override
public void init() {
	super.init();
	Minecraft mc = Minecraft.getMinecraft();
	
	if (BackpacksContent.BACKPACK != null) {
		mc.getBlockColors().registerBlockColorHandler(BLOCK_COLOR, MiscUtils.getBlockFromItem(BackpacksContent.BACKPACK));
		mc.getItemColors().registerItemColorHandler(ITEM_COLOR, BackpacksContent.BACKPACK);
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBackpack.class, new RendererBackpack.TileEntity());
	}
	
	RenderManager manager = mc.getRenderManager();
	Map<String, RenderPlayer> skinMap = manager.getSkinMap();
	for (RenderPlayer renderer : skinMap.values()) {
		renderer.addLayer(new RendererBackpack.Layer(renderer));
	}
}
 
Example #7
Source File: ClientProxy.java    From BetterChests with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void init() {
	new ClientEventListener();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBChest.class, TESRBChest.INSTANCE);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBBarrel.class, TESRBBarrel.INSTANCE);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBTank.class, TESRBTank.INSTANCE);
	ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(BlocksItemsBetterChests.betterchest), 0, TileEntityBChest.class);

	TickRegistry.CLIENT.addContinuousCallback(() -> {
		if (!pressed && keyBind.isPressed() && Minecraft.getMinecraft().world != null) {
			//Open bag
			int idx = InvUtil.findInInvInternal(Minecraft.getMinecraft().player.inventory, null, stack -> stack.getItem() instanceof ItemBBag);
			if (idx != -1) {
				BetterChests.instance.ph.sendPacketToPlayers(new PacketOpenBag(idx));
			}
		}
		pressed = keyBind.isPressed();
	});
	ClientRegistry.registerKeyBinding(keyBind);
}
 
Example #8
Source File: ClientProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void registerRenderers()
{
    RenderingRegistry.registerEntityRenderingHandler(EntityEnderArrow.class, manager -> { return new RenderEnderArrow<EntityEnderArrow>(manager); });
    RenderingRegistry.registerEntityRenderingHandler(EntityEnderPearlReusable.class, manager -> { return new RenderEntityEnderPearl(manager, EnderUtilitiesItems.ENDER_PEARL_REUSABLE); });
    RenderingRegistry.registerEntityRenderingHandler(EntityEndermanFighter.class, manager -> { return new RenderEndermanFighter(manager); });
    RenderingRegistry.registerEntityRenderingHandler(EntityChair.class, manager -> { return new RenderChair(manager); });
    RenderingRegistry.registerEntityRenderingHandler(EntityFallingBlockEU.class, manager -> { return new RenderFallingBlockEU(manager); });

    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBarrel.class, new TESRBarrel());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnergyBridge.class, new TileEntityRendererEnergyBridge());
}
 
Example #9
Source File: ClientProxy.java    From enderutilities with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void registerKeyBindings()
{
    Keybindings.keyActivateUnselected = new KeyBinding( HotKeys.KEYBIND_NAME_ACTIVATE_UNSELECTED,
                                                        HotKeys.DEFAULT_KEYBIND_ACTIVATE_UNSELECTED,
                                                        HotKeys.KEYBIND_CATEGORY_ENDERUTILITIES);

    Keybindings.keyToggleMode = new KeyBinding(HotKeys.KEYBIND_NAME_TOGGLE_MODE,
                                               HotKeys.DEFAULT_KEYBIND_TOGGLE_MODE,
                                               HotKeys.KEYBIND_CATEGORY_ENDERUTILITIES);

    ClientRegistry.registerKeyBinding(Keybindings.keyActivateUnselected);
    ClientRegistry.registerKeyBinding(Keybindings.keyToggleMode);
}
 
Example #10
Source File: ClientProxy.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void registerKeys()
{
	//KeyBindings.addKeyBinding(KeyBindingHandler.Key_CombatMode);
	//KeyBindings.addIsRepeating(false);
	//ClientRegistry.registerKeyBinding(KeyBindingHandler.Key_ToolMode);
	//ClientRegistry.registerKeyBinding(KeyBindingHandler.Key_LockTool);
	ClientRegistry.registerKeyBinding(KeyBindingHandler.Key_CombatMode);
	//uploadKeyBindingsToGame();
}
 
Example #11
Source File: ClientProxy.java    From Levels with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init()
{
	keyBindingL = new KeyBinding("key.gui.weapon_interface", Keyboard.KEY_L, "key.levels");
	
	ClientRegistry.registerKeyBinding(keyBindingL);
}
 
Example #12
Source File: ClientProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent evt) {
	super.preInit(evt);
	MinecraftForge.EVENT_BUS.register(RenderUtility.instance);
	ClientRegistry.bindTileEntitySpecialRenderer(FWTile.class, FWTileRenderer.instance);
	RenderUtility.instance.preInit(evt);
}
 
Example #13
Source File: ClientProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent evt) {
	super.preInit(evt);
	MinecraftForge.EVENT_BUS.register(RenderUtility.instance);
	ClientRegistry.bindTileEntitySpecialRenderer(FWTile.class, FWTileRenderer.instance);
	RenderUtility.instance.preInit(evt);
}
 
Example #14
Source File: ClientEvents.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event)
{
    RenderingRegistry.registerEntityRenderingHandler(RockEntity.TYPE.get(),
            manager -> new SpriteRenderer<>(manager, Minecraft.getInstance().getItemRenderer()));

    ClientRegistry.bindTileEntityRenderer(DryingRackTileEntity.TYPE.get(), DryingRackRenderer::new);
    ClientRegistry.bindTileEntityRenderer(ChoppingBlockTileEntity.TYPE.get(), ChoppingBlockRenderer::new);
}
 
Example #15
Source File: ClientProxy.java    From ExNihiloAdscensio with MIT License 5 votes vote down vote up
@Override
public void registerRenderers()
{
	ClientRegistry.bindTileEntitySpecialRenderer(TileBarrel.class, new RenderBarrel());
	ClientRegistry.bindTileEntitySpecialRenderer(TileCrucible.class, new RenderCrucible());
	ClientRegistry.bindTileEntitySpecialRenderer(TileSieve.class, new RenderSieve());
	ClientRegistry.bindTileEntitySpecialRenderer(TileInfestedLeaves.class, new RenderInfestedLeaves());
	RenderingRegistry.registerEntityRenderingHandler(ProjectileStone.class, new RenderProjectileStone.Factory());
}
 
Example #16
Source File: ClientProxy.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@Override
public void postInit(FMLPostInitializationEvent e) {
    super.postInit(e);
    Minecraft.getMinecraft().getFramebuffer().enableStencil();

    // Register physics infuser tile entity renderer.
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPhysicsInfuser.class,
        new TileEntityPhysicsInfuserRenderer());
}
 
Example #17
Source File: ClientEventHandler.java    From HoloInventory with MIT License 5 votes vote down vote up
public static void init()
{
    if (instance != null) MinecraftForge.EVENT_BUS.unregister(instance);
    instance = new ClientEventHandler();
    MinecraftForge.EVENT_BUS.register(new ClientEventHandler());

    keyHold = new KeyBinding("Hold to show", KeyConflictContext.IN_GAME, Keyboard.KEY_H, HoloInventory.MODID);
    keyToggle = new KeyBinding("Toggle to show", KeyConflictContext.IN_GAME, 0, HoloInventory.MODID);
    ClientRegistry.registerKeyBinding(keyHold);
    ClientRegistry.registerKeyBinding(keyToggle);
}
 
Example #18
Source File: AutoPlace.java    From ForgeHax with MIT License 5 votes vote down vote up
public AutoPlace() {
  super(Category.PLAYER, "AutoPlace", false, "Automatically place blocks on top of other blocks");
  
  this.bindSelect.setKeyConflictContext(BindingHelper.getEmptyKeyConflictContext());
  this.bindFinish.setKeyConflictContext(BindingHelper.getEmptyKeyConflictContext());
  
  ClientRegistry.registerKeyBinding(this.bindSelect);
  ClientRegistry.registerKeyBinding(this.bindFinish);
}
 
Example #19
Source File: KeybindManager.java    From MediaMod with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Fired when you want to register keybinds
 *
 * @see MediaMod#preInit(FMLPreInitializationEvent)
 */
public void register() {
    // Initialize and declare keybinds
    INSTANCE.disableKeybind = new KeyBinding("key.disableKeybind", Keyboard.KEY_P, "key.categories.mediamod");
    INSTANCE.menuKeybind = new KeyBinding("key.menuKeybind", Keyboard.KEY_M, "key.categories.mediamod");
    INSTANCE.skipKeybind = new KeyBinding("key.skipKeybind", Keyboard.KEY_F, "key.categories.mediamod");
    INSTANCE.pausePlayKeybind = new KeyBinding("key.pausePlayKeybind", Keyboard.KEY_N, "key.categories.mediamod");

    ClientRegistry.registerKeyBinding(disableKeybind);
    ClientRegistry.registerKeyBinding(menuKeybind);
    ClientRegistry.registerKeyBinding(skipKeybind);
    ClientRegistry.registerKeyBinding(pausePlayKeybind);
}
 
Example #20
Source File: SkyblockAddons.java    From SkyblockAddons with MIT License 5 votes vote down vote up
public void addKeybinds(SkyblockKeyBinding... keybinds) {
    for (SkyblockKeyBinding skyblockKeyBinding : keybinds) {
        KeyBinding keyBinding = new KeyBinding("key.skyblockaddons."+ skyblockKeyBinding.getName(), skyblockKeyBinding.getDefaultKey(), MOD_NAME);
        ClientRegistry.registerKeyBinding(keyBinding);
        skyblockKeyBinding.setKeyBinding(keyBinding);

        keyBindings.add(skyblockKeyBinding);
    }
}
 
Example #21
Source File: TileEntityRegistry.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void render() {
	TileEntityRenderHelper TESR = new TileEntityRenderHelper();
    Item.getItemFromBlock(BlockLoader.TOFUCHEST).setTileEntityItemStackRenderer(TESR);
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTofuChest.class, new RenderTofuChest());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySaltPan.class, new RenderSaltPan());
    
}
 
Example #22
Source File: TileEntityRegistry.java    From Sakura_mod with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void render() {
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCampfire.class, new RenderTileEntityCampfire());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStoneMortar.class, new RenderTileEntityStoneMortar());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCampfirePot.class, new RenderTileEntityCampfirePot());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMapleCauldron.class, new RenderTileEntityMapleCauldron());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShoji.class, new ShojiRender());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOben.class, new RenderTileEntityOben());
    getItem(BlockLoader.STONEMORTAR).setTileEntityItemStackRenderer(new TileEntityRenderHelper());
}
 
Example #23
Source File: ExtraRandomness.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void registerModels(ModelRegistryEvent event) {
	ClientUtil.simpleItemModel(itemBlockAltar);
	
	altarItems.forEach(ClientUtil::simpleItemModel);
	
	// I am lazy.
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAltar.class, new RenderAltar());
}
 
Example #24
Source File: RegistrationHandler.java    From EmergingTechnology with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void registerModels(ModelRegistryEvent event) {

    for (Block block : ModBlocks.getBlocks()) {
        registerModel(Item.getItemFromBlock(block));
    }

    for (Item item : ModItems.getItems()) {
        registerModel(item);
    }

    registerModTissueModels();

    // Hydroponic TESR
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(ModBlocks.hydroponic), 0,
            new ModelResourceLocation(ModBlocks.hydroponic.getRegistryName(), "inventory"));

    ClientRegistry.bindTileEntitySpecialRenderer(HydroponicTileEntity.class, new HydroponicTESR());

    ClientRegistry.bindTileEntitySpecialRenderer(TidalGeneratorTileEntity.class,
            new AnimationTESR<TidalGeneratorTileEntity>());

    ClientRegistry.bindTileEntitySpecialRenderer(WindTileEntity.class, new AnimationTESR<WindTileEntity>());
    ClientRegistry.bindTileEntitySpecialRenderer(ScrubberTileEntity.class, new AnimationTESR<ScrubberTileEntity>());
    ClientRegistry.bindTileEntitySpecialRenderer(HarvesterTileEntity.class, new AnimationTESR<HarvesterTileEntity>());

    RenderHandler.registerMeshesAndStatesForBlock(ModBlocks.carbondioxideblock);
    RenderHandler.registerMeshesAndStatesForBlock(ModBlocks.nutrientblock);
}
 
Example #25
Source File: HotKeyHandler.java    From I18nUpdateMod with MIT License 5 votes vote down vote up
public HotKeyHandler() {
    ClientRegistry.registerKeyBinding(mainKey);
    ClientRegistry.registerKeyBinding(reportKey);
    ClientRegistry.registerKeyBinding(weblateKey);
    ClientRegistry.registerKeyBinding(mcmodKey);
    ClientRegistry.registerKeyBinding(reloadKey);
}
 
Example #26
Source File: GokiKeyHandler.java    From GokiStats with MIT License 4 votes vote down vote up
public GokiKeyHandler() {
    statsMenu = new KeyBinding(I18n.format("ui.opmenu.name"), 21, "Goki Stats");
    compatibilityMenu = new KeyBinding(I18n.format("ui.openhelper.name"), 35, "Goki Stats");
    ClientRegistry.registerKeyBinding(statsMenu);
    ClientRegistry.registerKeyBinding(compatibilityMenu);
}
 
Example #27
Source File: ClientProxy.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public void init(FMLInitializationEvent event) {
    super.init(event);
    ChangeMode = new KeyBinding("key.sakura.sheath_in", Keyboard.KEY_V, "key.categories.sakura");
    ClientRegistry.registerKeyBinding(ChangeMode); 
}
 
Example #28
Source File: KeyBindingHandler.java    From WearableBackpacks with MIT License 4 votes vote down vote up
public KeyBindingHandler() {
	ClientRegistry.registerKeyBinding(openBackpack);
}
 
Example #29
Source File: BoingHandler.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void onInit(FMLInitializationEvent e) {
    jump = new KeyBinding("key.bijump", Keyboard.KEY_SPACE, "key.categories.bijump");
    ClientRegistry.registerKeyBinding(jump);
}
 
Example #30
Source File: Module.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public void registerBind(String name, int keycode) {
	this.key = new KeyBinding(name, keycode, "BleachHack");
	ClientRegistry.registerKeyBinding(this.key);
}