use of net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent in project TinkersConstruct by SlimeKnights.
the class CommonsClientEvents method clientSetup.
@SubscribeEvent
static void clientSetup(final FMLClientSetupEvent event) {
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.glow.get(), RenderType.translucent());
// glass
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.clearGlass.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.clearGlassPane.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.clearTintedGlass.get(), RenderType.translucent());
for (ClearStainedGlassBlock.GlassColor color : ClearStainedGlassBlock.GlassColor.values()) {
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.clearStainedGlass.get(color), RenderType.translucent());
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.clearStainedGlassPane.get(color), RenderType.translucent());
}
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.soulGlass.get(), RenderType.translucent());
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.soulGlassPane.get(), RenderType.translucent());
ItemBlockRenderTypes.setRenderLayer(TinkerMaterials.soulsteel.get(), RenderType.translucent());
ItemBlockRenderTypes.setRenderLayer(TinkerMaterials.slimesteel.get(), RenderType.translucent());
RenderType cutout = RenderType.cutout();
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.goldBars.get(), cutout);
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.goldPlatform.get(), cutout);
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.ironPlatform.get(), cutout);
ItemBlockRenderTypes.setRenderLayer(TinkerCommons.cobaltPlatform.get(), cutout);
Consumer<Block> setCutout = block -> ItemBlockRenderTypes.setRenderLayer(block, cutout);
TinkerCommons.copperPlatform.forEach(setCutout);
TinkerCommons.waxedCopperPlatform.forEach(setCutout);
Font unicode = unicodeFontRender();
TinkerBook.MATERIALS_AND_YOU.fontRenderer = unicode;
TinkerBook.TINKERS_GADGETRY.fontRenderer = unicode;
TinkerBook.PUNY_SMELTING.fontRenderer = unicode;
TinkerBook.MIGHTY_SMELTING.fontRenderer = unicode;
TinkerBook.FANTASTIC_FOUNDRY.fontRenderer = unicode;
TinkerBook.ENCYCLOPEDIA.fontRenderer = unicode;
}
use of net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent in project Structurize by ldtteam.
the class ClientLifecycleSubscriber method onClientInit.
/**
* Called when client app is initialized.
*
* @param event event
*/
@SubscribeEvent
public static void onClientInit(final FMLClientSetupEvent event) {
OptifineCompat.getInstance().intialize();
final IResourceManager rm = event.getMinecraftSupplier().get().getResourceManager();
if (rm instanceof IReloadableResourceManager) {
((IReloadableResourceManager) rm).registerReloadListener((ISelectiveResourceReloadListener) (resourceManager, resourcePredicate) -> {
if (resourcePredicate.test(VanillaResourceType.MODELS) || resourcePredicate.test(VanillaResourceType.TEXTURES) || resourcePredicate.test(VanillaResourceType.SHADERS)) {
Log.getLogger().debug("Clearing blueprint renderer cache.");
BlueprintHandler.getInstance().clearCache();
}
Log.getLogger().debug("Clearing gui XML cache.");
Loader.cleanParsedCache();
});
}
// final RenderType s = RenderType.getSolid();
// ModBlocks.blockSubstitution;
// ModBlocks.blockSolidSubstitution;
// ModBlocks.blockFluidSubstitution;
// ModBlocks.multiBlock;
// ModBlocks.blockDecoBarrel_onside;
// ModBlocks.blockDecoBarrel_standing;
// ModBlocks.paperWalls;
// ModBlocks.floatingCarpets;
// ModBlocks.timberFrames;
// ModBlocks.shingles;
// ModBlocks.shingleSlabs;
// final RenderType c = RenderType.getCutout();
// final RenderType cm = RenderType.getCutoutMipped();
final RenderType t = RenderType.translucent();
ModBlocks.getPaperWalls().forEach(frame -> RenderTypeLookup.setRenderLayer(frame, t));
// ModBlocks.CACTI_BLOCKS
// ModBlocks.BRICKS
DELAYED_RENDER_TYPE_SETUP.forEach(tu -> {
if (!tu.getB().equals(RenderType.solid())) {
RenderTypeLookup.setRenderLayer(tu.getA().get(), tu.getB());
}
});
DELAYED_RENDER_TYPE_SETUP.clear();
DELAYED_RENDER_TYPE_SETUP.trimToSize();
}
use of net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent in project ElevatorMod by VsnGamer.
the class ClientRegistry method clientSetup.
@SubscribeEvent
public static void clientSetup(FMLClientSetupEvent event) {
MenuScreens.register(Registry.ELEVATOR_CONTAINER.get(), ElevatorScreen::new);
Minecraft.getInstance().getBlockColors().register(new ColorCamoElevator(), Registry.ELEVATOR_BLOCKS.values().stream().map(RegistryObject::get).toArray(ElevatorBlock[]::new));
Registry.ELEVATOR_BLOCKS.values().forEach(o -> ItemBlockRenderTypes.setRenderLayer(o.get(), t -> true));
}
use of net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent in project relics by SSKirillSS.
the class RemoteRegistry method setupClient.
@SubscribeEvent
public static void setupClient(final FMLClientSetupEvent event) {
RenderingRegistry.registerEntityRenderingHandler(EntityRegistry.STELLAR_CATALYST_PROJECTILE.get(), new StellarCatalystProjectileRenderer.RenderFactory());
RenderingRegistry.registerEntityRenderingHandler(EntityRegistry.SPACE_DISSECTOR.get(), new SpaceDissectorRenderer.RenderFactory());
RenderingRegistry.registerEntityRenderingHandler(EntityRegistry.SHADOW_GLAIVE.get(), new ShadowGlaiveRenderer.RenderFactory());
ClientRegistry.bindTileEntityRenderer(TileRegistry.PEDESTAL_TILE.get(), PedestalTileRenderer::new);
ClientRegistry.bindTileEntityRenderer(TileRegistry.RUNIC_ALTAR_TILE.get(), RunicAltarTileRenderer::new);
ClientRegistry.bindTileEntityRenderer(TileRegistry.RUNIC_ANVIL_TILE.get(), RunicAnvilTileRenderer::new);
ClientRegistry.bindTileEntityRenderer(TileRegistry.BLOODY_LECTERN_TILE.get(), BloodyLecternTileRenderer::new);
RenderTypeLookup.setRenderLayer(BlockRegistry.CHALK_BLOCK.get(), RenderType.cutout());
RenderTypeLookup.setRenderLayer(BlockRegistry.RUNIC_ALTAR_BLOCK.get(), RenderType.cutout());
RenderTypeLookup.setRenderLayer(BlockRegistry.RUNIC_ANVIL_BLOCK.get(), RenderType.cutout());
RenderTypeLookup.setRenderLayer(BlockRegistry.BLOODY_LECTERN_BLOCK.get(), RenderType.cutout());
HotkeyRegistry.register();
ItemModelsProperties.register(ItemRegistry.SPACE_DISSECTOR.get(), new ResourceLocation(Reference.MODID, "mode"), (stack, world, entity) -> NBTUtils.getBoolean(stack, SpaceDissectorItem.TAG_IS_THROWN, false) ? 1 : 0);
ItemModelsProperties.register(ItemRegistry.INFINITY_HAM.get(), new ResourceLocation(Reference.MODID, "pieces"), (stack, world, entity) -> Math.min(3, NBTUtils.getInt(stack, InfinityHamItem.TAG_PIECES, 0)));
ItemModelsProperties.register(ItemRegistry.SHADOW_GLAIVE.get(), new ResourceLocation(Reference.MODID, "charges"), (stack, world, entity) -> Math.min(8, NBTUtils.getInt(stack, ShadowGlaiveItem.TAG_CHARGES, 0)));
ItemModelsProperties.register(ItemRegistry.RELIC_CONTRACT.get(), new ResourceLocation(Reference.MODID, "blood"), (stack, world, entity) -> NBTUtils.getInt(stack, RelicContractItem.TAG_BLOOD, 0));
ItemRegistry.getRegisteredRelics().forEach(item -> ItemModelsProperties.register(item, new ResourceLocation(Reference.MODID, "broken"), (stack, world, entity) -> DurabilityUtils.isBroken(stack) ? 1 : 0));
}
use of net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent in project minecolonies by Minecolonies.
the class MineColonies method doClientStuff.
@OnlyIn(Dist.CLIENT)
@SubscribeEvent
public static void doClientStuff(final FMLClientSetupEvent event) {
RenderingRegistry.registerEntityRenderingHandler(ModEntities.CITIZEN, RenderBipedCitizen::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.VISITOR, RenderBipedCitizen::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.FISHHOOK, RenderFishHook::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.FIREARROW, FireArrowRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.MC_NORMAL_ARROW, TippedArrowRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.SPEAR, RendererSpear::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.DRUID_POTION, m -> new SpriteRenderer(m, event.getMinecraftSupplier().get().getItemRenderer(), 1.0f, true));
RenderingRegistry.registerEntityRenderingHandler(ModEntities.BARBARIAN, RendererBarbarian::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.ARCHERBARBARIAN, RendererBarbarian::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.CHIEFBARBARIAN, RendererChiefBarbarian::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.PIRATE, RendererPirate::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.ARCHERPIRATE, RendererArcherPirate::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.CHIEFPIRATE, RendererChiefPirate::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.MUMMY, RendererMummy::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.ARCHERMUMMY, RendererArcherMummy::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.PHARAO, RendererPharao::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.SHIELDMAIDEN, RendererShieldmaidenNorsemen::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.NORSEMEN_ARCHER, RendererArcherNorsemen::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.NORSEMEN_CHIEF, RendererChiefNorsemen::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.AMAZON, RendererAmazon::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.AMAZONSPEARMAN, RendererAmazonSpearman::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.AMAZONCHIEF, RendererChiefAmazon::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.MERCENARY, RenderMercenary::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.SITTINGENTITY, RenderSitting::new);
RenderingRegistry.registerEntityRenderingHandler(ModEntities.MINECART, MinecartRenderer::new);
ClientRegistry.bindTileEntityRenderer(MinecoloniesTileEntities.BUILDING, EmptyTileEntitySpecialRenderer::new);
ClientRegistry.bindTileEntityRenderer(MinecoloniesTileEntities.SCARECROW, TileEntityScarecrowRenderer::new);
ClientRegistry.bindTileEntityRenderer(MinecoloniesTileEntities.ENCHANTER, TileEntityEnchanterRenderer::new);
ClientRegistry.bindTileEntityRenderer(MinecoloniesTileEntities.COLONY_FLAG, TileEntityColonyFlagRenderer::new);
ClientRegistry.bindTileEntityRenderer(MinecoloniesTileEntities.NAMED_GRAVE, TileEntityNamedGraveRenderer::new);
ModModelTypeInitializer.init();
Arrays.stream(ModBlocks.getHuts()).forEach(hut -> RenderTypeLookup.setRenderLayer(hut, renderType -> renderType.equals(RenderType.cutout()) || renderType.equals(RenderType.solid()) || renderType.equals(RenderType.translucent())));
RenderTypeLookup.setRenderLayer(ModBlocks.blockScarecrow, RenderType.cutout());
RenderTypeLookup.setRenderLayer(ModBlocks.blockRack, RenderType.cutout());
RenderTypeLookup.setRenderLayer(ModBlocks.blockDecorationPlaceholder, RenderType.cutout());
RenderTypeLookup.setRenderLayer(ModBlocks.blockCompostedDirt, RenderType.cutout());
RenderTypeLookup.setRenderLayer(ModBlocks.blockBarrel, RenderType.cutout());
RenderTypeLookup.setRenderLayer(ModBlocks.blockWayPoint, RenderType.cutout());
ItemModelsProperties.register(ModItems.spear, new ResourceLocation("throwing"), (item, world, entity) -> (entity != null && entity.isUsingItem() && entity.getUseItem() == item) ? 1.0F : 0.0F);
}
Aggregations