Java 类net.minecraftforge.client.event.TextureStitchEvent 实例源码

项目:RunicArcana    文件:StitchEventHandler.java   
@SubscribeEvent
public void textureStuff(TextureStitchEvent.Pre event)
{
    if (event.getMap() == Minecraft.getMinecraft().getTextureMapBlocks()) {

        for (LinkedList<IDustSymbol> category : ModDust.dustRegistry)
        {
            for(IDustSymbol dust : category)
            {

                String textureStr = dust.getTexture();
                int index = textureStr.lastIndexOf(".png");
                String texture =  "runicarcana:"+textureStr.substring(9,index);
                event.getMap().registerSprite(new ResourceLocation(texture));
            }

        }
    }

    event.getMap().registerSprite(new ResourceLocation(Reference.PARTICLE_RESOURCE_LOCATION + "WaterStrikeFX"));
    event.getMap().registerSprite(new ResourceLocation(Reference.PARTICLE_RESOURCE_LOCATION + "EarthStrikeFX"));
    event.getMap().registerSprite(new ResourceLocation(Reference.PARTICLE_RESOURCE_LOCATION + "AirStrikeFX"));

}
项目:ExtraUtilities    文件:TConEvents.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void handleStich(final TextureStitchEvent.Pre event) {
    if (event.map.getTextureType() != 0) {
        return;
    }
    TConIntegration.bedrock.setIcons(event.map.registerIcon("TConIntegration.bedrock"));
    TextureAtlasSprite sprite = new TextureBedrockLava("extrautils:bedrockFluid", "lava_still");
    event.map.setTextureEntry("extrautils:bedrockFluid", sprite);
    if (TConIntegration.bedrock != null) {
        TConIntegration.bedrock.setIcons((IIcon)sprite);
    }
    sprite = new TextureBedrockLava("extrautils:bedrockFluid_flowing", "lava_flow");
    if (event.map.setTextureEntry("extrautils:bedrockFluid_flowing", sprite) && TConIntegration.bedrock != null) {
        TConIntegration.bedrock.setFlowingIcon((IIcon)sprite);
    }
    sprite = new TextureUnstableLava("extrautils:unstableFluid", "water_still");
    event.map.setTextureEntry("extrautils:unstableFluid", sprite);
    if (TConIntegration.unstable != null) {
        TConIntegration.unstable.setIcons((IIcon)sprite);
    }
    sprite = new TextureUnstableLava("extrautils:unstableFluid_flowing", "water_flow");
    if (event.map.setTextureEntry("extrautils:unstableFluid_flowing", sprite) && TConIntegration.unstable != null) {
        TConIntegration.unstable.setFlowingIcon((IIcon)sprite);
    }
}
项目:4Space-5    文件:FluidTexturesGC.java   
@SubscribeEvent
public void onStitch(TextureStitchEvent.Pre event)
{
    if (event.map.getTextureType() == 0)
    {
        AsteroidsModule.fluidMethaneGas.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/MethaneGas"));
        AsteroidsModule.fluidAtmosphericGases.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/AtmosphericGases"));
        AsteroidsModule.fluidLiquidMethane.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/LiquidMethane"));
        AsteroidsModule.fluidLiquidOxygen.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/LiquidOxygen"));
        AsteroidsModule.fluidOxygenGas.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/OxygenGas"));
        AsteroidsModule.fluidLiquidNitrogen.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/LiquidNitrogen"));
        AsteroidsModule.fluidLiquidArgon.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/LiquidArgon"));
        AsteroidsModule.fluidNitrogenGas.setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/NitrogenGas"));
        FluidRegistry.getFluid("hydrogen").setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/HydrogenGas"));
        FluidRegistry.getFluid("helium").setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/HeliumGas"));
        FluidRegistry.getFluid("argon").setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/ArgonGas"));
        FluidRegistry.getFluid("carbondioxide").setIcons(event.map.registerIcon(AsteroidsModule.ASSET_PREFIX + ":fluids/CarbonDioxideGas"));
    }
}
项目:4Space-5    文件:LiquidTextures.java   
@SubscribeEvent
public void postStitch(TextureStitchEvent.Post event)
{
    IIcon[] icons;
    if(replaceLava)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
    }
    if(replaceWater)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
    }
}
项目:Toms-Mod    文件:EventHandlerClient.java   
@SubscribeEvent
public void onRegisterTexture(TextureStitchEvent.Pre event) {
    TMLogger.info("Adding fluid textures");
    loadedLocations.clear();
    lcdFont = new LCDFontRenderer(mc.gameSettings, Configs.lcdFont, mc.renderEngine, false);
    TextureMap map = event.getMap();
    for (Entry<String, Fluid> entry : CoreInit.fluidList.entrySet()) {
        if (!loadedLocations.contains(entry.getValue().getFlowing())) {
            map.registerSprite(entry.getValue().getFlowing());
            loadedLocations.add(entry.getValue().getFlowing());
        }
        if (!loadedLocations.contains(entry.getValue().getStill())) {
            map.registerSprite(entry.getValue().getStill());
            loadedLocations.add(entry.getValue().getStill());
        }
    }
    textureIns++;
}
项目:Factorization    文件:FzModel.java   
@SubscribeEvent
public void bakeModels(TextureStitchEvent.Post event) {
    final TextureMap map = event.map;
    Function<ResourceLocation,TextureAtlasSprite> lookup = new Function<ResourceLocation, TextureAtlasSprite>() {
        @Nullable
        @Override
        public TextureAtlasSprite apply(@Nullable ResourceLocation input) {
            if (input == null) return map.getAtlasSprite(null);
            return map.getAtlasSprite(input.toString());
        }
    };
    for (FzModel fzm : instances) {
        IModel rawModel = raws.get(fzm);
        if (rawModel == null) {
            fzm.model = null;
            continue;
        }
        fzm.model = rawModel.bake(fzm.trsrt, fzm.getFormat(), lookup);
    }
    raws.clear();
}
项目:Factorization    文件:RenderUtil.java   
/**
 * Use reflection to set all TextureAtlasSprites in a class.
 * All fields that are TextureAtlasSprites will be assigned, and any field whose type
 * is annotated with {@link LoadSprite} will be instantiated, assigned, and recursively loaded.
 * If a field name contains a '$', it will be replaced with a '/' for the icon's path name,
 * and also when recursion occurs.
 * @param domain    The domain of the textures.
 * @param toVisit   The object to visit. If it is a class, then its static fields will be loaded.
 * @param prefix    The path prefix. You likely want "".
 * @param event     Call this method during the TextureStitchEvent.Pre event.
 * @see LoadSprite
 * @throws RuntimeException on any error
 */
public static void loadSprites(String domain, Object toVisit, String prefix, TextureStitchEvent.Pre event)  {
    Class base;
    Object instance;
    if (toVisit instanceof Class) {
        base = (Class) toVisit;
        instance = null;
    } else {
        base = toVisit.getClass();
        instance = toVisit;
    }
    try {
        load0(domain, base, instance, prefix, event);
    } catch (Throwable e) {
        throw new RuntimeException(e);
    }
}
项目:Factorization    文件:RenderUtil.java   
private static void load0(String domain, Class base, Object instance, String prefix, TextureStitchEvent.Pre event) throws IllegalAccessException, InstantiationException {
    for (Field field : base.getFields()) {
        String name = field.getName().replace("$", "/");

        Class<?> type = field.getType();
        boolean staticField = (field.getModifiers() & Modifier.STATIC) != 0;
        boolean staticAccess = instance == null;
        if (staticField != staticAccess) continue;
        Object set;
        if (type == TextureAtlasSprite.class) {
            ResourceLocation location = new ResourceLocation(domain, prefix + name);
            set = event.map.registerSprite(location);
        } else if (canVisit(type)) {
            set = type.newInstance();
            load0(domain, type, set, prefix + name + "/", event);
        } else {
            continue;
        }
        field.set(instance, set);
    }
}
项目:FlowstoneEnergy    文件:TextureStitchEventHandler.java   
@SubscribeEvent
public void onPreTextureStiching(TextureStitchEvent.Pre event){
    if (event.map == FMLClientHandler.instance().getClient().getTextureMapBlocks()){
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/machine_Top"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/machine_Bottom"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/oreTumbler_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/oreTumbler_Front_Active"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/flowstoneBottler_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/flowstoneBottler_Front_Activate"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/furnace_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/furnace_Front_Active"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/lumberMill_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/lumberMill_Front_Active"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/metalMixer_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/metalMixer_Front_Active"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/cooler_Front"));
        event.map.registerSprite(new ResourceLocation("flowstoneenergy:blocks/machines/cooler_Front_Active"));
    }

}
项目:ShadowsOfPhysis    文件:TextureMapHandler.java   
@SubscribeEvent
public void onStitch(TextureStitchEvent.Pre event) {
    Map<String, TextureAtlasSprite> iconlist = null;
    if (event.map.getTextureType() == 0) {
        iconlist = TextureHelper.addedBlockIcons;
    }
    else if (event.map.getTextureType() == 1) {
        iconlist = TextureHelper.addedItemIcons;
    }

    if (iconlist != null) {
        for (Entry<String, TextureAtlasSprite> entry : iconlist.entrySet()) {
            //Physis.logger.info("Adding "+entry.getKey()+" to the map");
            event.map.setTextureEntry(entry.getKey(), entry.getValue());
        }
    }
}
项目:OpenBlocks    文件:CanvasTextureManager.java   
@SubscribeEvent
public void onTextureStitchEvent(TextureStitchEvent.Pre evt) {
    freeTextures.clear();
    usedTextures.clear();
    peakRejectedAllocations = 0;
    textureLimitReached = false;

    CanvasSideState.onTextureReload();

    if (DEBUG) Log.info("Allocating %s textures", Config.canvasPoolSize);

    final TextureMap map = evt.getMap();
    final EmptyTextureData emptyTexture = new EmptyTextureData();
    for (int i = 0; i < Config.canvasPoolSize; i++) {
        final CanvasTexture entry = new CanvasTexture(OpenBlocks.location("canvas-" + i), emptyTexture);
        map.setTextureEntry(entry);
        freeTextures.push(entry);
    }
}
项目:Agriculture    文件:ExtraIcons.java   
@ForgeSubscribe
public void onItemIconRegister(final TextureStitchEvent.Pre evt)
{
    System.out.println("textureType = " + evt.map.textureType);
    if (evt.map.textureType == 1)
    {
        ExtraIcons.ovenSlotOpen = evt.map.registerIcon("agriculture:gui/OvenSlotOpen");
        ExtraIcons.ovenSlotClosed = evt.map.registerIcon("agriculture:gui/OvenSlotClosed");
    }
    else
    {
        ExtraIcons.liquidMilk = evt.map.registerIcon("agriculture:milk");
        ExtraIcons.liquidBeer = evt.map.registerIcon("agriculture:beer");
        ExtraIcons.liquidHotcocoa = evt.map.registerIcon("agriculture:hotcocoa");
        ExtraIcons.vineger = evt.map.registerIcon("agriculture:vinegar");
        ExtraIcons.liquidVodka = evt.map.registerIcon("agriculture:vodka");
        ExtraIcons.liquidCider = evt.map.registerIcon("agriculture:cider");
    }
}
项目:genera    文件:EventHandler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void stitch(TextureStitchEvent.Pre event){
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/wood/body"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/wood/wing_bottom"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/wood/wing_top"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/cave/body"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/cave/wing_bottom"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/cave/wing_top"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/mountain/body"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/mountain/wing_bottom"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID,"entity/faerie/mountain/wing_top"));
}
项目:Bewitchment    文件:ClientProxy.java   
@SubscribeEvent
public static void stitchEventPre(TextureStitchEvent.Pre event) {
    event.getMap().registerSprite(ResourceLocations.STEAM);
    event.getMap().registerSprite(ResourceLocations.BEE);
    event.getMap().registerSprite(ResourceLocations.FLAME);
    event.getMap().registerSprite(ResourceLocations.GRAY_WATER);
}
项目:Anima-Mundi    文件:ParticleManager.java   
@SubscribeEvent
public static void registerParticles(TextureStitchEvent.Pre event)
{
    stitchParticle("particle/glow_par", event.getMap());
    stitchParticle("items/sword_glow_top", event.getMap());
    stitchParticle("items/sword_glow_bottom", event.getMap());
}
项目:connor41-etfuturum2    文件:ClientEventHandler.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
    if (EtFuturum.enablePrismarine)
        if (event.map.getTextureType() == 0) {
            TextureAtlasSprite icon = new PrismarineIcon("prismarine_rough");
            if (event.map.setTextureEntry("prismarine_rough", icon))
                ((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, icon);
            else
                ((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, event.map.registerIcon("prismarine_rough"));
        }
}
项目:Thermionics    文件:ClientProxy.java   
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre event) {
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/clear_hootch"));
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/medium_hootch"));
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/dark_hootch"));
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/clear_spirit"));
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/medium_spirit"));
    event.getMap().registerSprite(new ResourceLocation("thermionics", "fluids/dark_spirit"));
}
项目:SimpleTubes    文件:TextureRegistry.java   
@SubscribeEvent
public void onTextureStich(TextureStitchEvent.Pre event) {
    for (ResourceLocation loc : textureList) {
        event.getMap().registerSprite(loc);
    }

}
项目:uniquecrops    文件:UCEventHandlerClient.java   
@SubscribeEvent
public void loadTextures(TextureStitchEvent.Pre event) {

    try {
        Map<String, TextureAtlasSprite> mapRegisteredSprites = ReflectionHelper.getPrivateValue(TextureMap.class, event.getMap(), FIELD);
        for (int i = 1; i < 6; i++)
            mapRegisteredSprites.put("uniquecrops:blocks/invisibilia" + i, new UCInvisibiliaStitch("uniquecrops:blocks/invisibilia" + i));
        mapRegisteredSprites.put("uniquecrops:blocks/dyeplant5", new UCDyePlantStitch("uniquecrops:blocks/dyeplant5"));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void registerIcons(TextureStitchEvent.Pre event) {
    // if(event.getMap().getGlTextureId()==1){
    // System.out.println("Registered icon:
    // "+event.getMap().getGlTextureId());
    pelletIcon = event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/pellet3"));
    event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/ammo_belt_empty"));
    event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/refill_empty"));
    event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/weapon_empty_0"));
    event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/weapon_empty_1"));
    event.getMap().registerSprite(new ResourceLocation(TF2weapons.MOD_ID, "items/weapon_empty_2"));
    // }
}
项目:ExtraUtilities    文件:EventHandlerClient.java   
@SubscribeEvent
public void registerParticle(final TextureStitchEvent.Pre event) {
    if (event.map.getTextureType() != 0) {
        return;
    }
    EventHandlerClient.particle = event.map.registerIcon("extrautils:particle");
}
项目:Thelta    文件:ClientContext.java   
@SubscribeEvent
public void onTexturePreStitch(TextureStitchEvent.Pre pre) {
    state = ContextState.LoadingTextures;
    currentTextureMap = pre.getMap();
    for (AutoModel model : autoModels) {
        for (ResourceLocation location : model.getTextures()) {
            currentTextureMap.registerSprite(location);
        }
    }
    for (TheltaModule module : modules) {
        module.loadTextures(this);
    }
    state = ContextState.Intermediary;
}
项目:TRHS_Club_Mod_2016    文件:ForgeHooksClient.java   
public static void onTextureStitchedPost(TextureMap map)
{
    MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map));

    FluidRegistry.WATER.setIcons(BlockLiquid.func_149803_e("water_still"), BlockLiquid.func_149803_e("water_flow"));
    FluidRegistry.LAVA.setIcons(BlockLiquid.func_149803_e("lava_still"), BlockLiquid.func_149803_e("lava_flow"));
}
项目:ItsJustaCharm1.10.2Dead    文件:ParticleHandler.java   
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent event) {
    map = event.getMap();

    for (ModParticles particle : ModParticles.values()) {
        particle.registerSprite();
    }

}
项目:FFS    文件:FancyFluidStorage.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
    FluidHelper.initTextures(event.getMap());

    OverlayRenderHandler.overlayTexture = event.getMap().registerSprite(new ResourceLocation("ffs", "blocks/overlay/tank_overlay_anim"));
}
项目:ChameleonCreepersMod    文件:EventHandlerClient.java   
@SubscribeEvent
void onLoadResourcepack(TextureStitchEvent.Post evt)
{
    try
    {
        RenderChameleonCreeper.convertTextureToGrayScale();
    }
    catch (IOException ie)
    {
        System.out.println("Couldn't convert creeper texture to grayscale");
        ie.printStackTrace();
    }
}
项目:Aether-Legacy    文件:AetherClientEvents.java   
@SubscribeEvent
public void onTextureStichedEvent(TextureStitchEvent event)
{
    for (int i = 0; i < InventoryAccessories.EMPTY_SLOT_NAMES.length; ++i)
    {
        event.getMap().registerSprite(new ResourceLocation("aether_legacy", "items/slots/" + InventoryAccessories.EMPTY_SLOT_NAMES[i]));
    }
}
项目:CodeChickenLib    文件:CCBlockStateLoader.java   
@SubscribeEvent (priority = EventPriority.HIGHEST)
public void onTextureStitchPre(TextureStitchEvent.Pre event) {
    if (!event.getMap().getBasePath().equals("textures")) {
        CCLLog.log(Level.WARN, "Someone is calling the TextureStitchEvent.Pre for a texture map that is NOT vanillas.");
        CCLLog.log(Level.WARN, "This is a bug. There is no sense of different atlas's in vanilla so this event is NOT generic and specific to the vanilla atlas.");
        CCLLog.log(Level.WARN, "Im catching this so things don't explode. Fix your shit!");
        CCLLog.big(Level.WARN, 100, "");
        return;
    }
    grabLoader();

    loadBakery(modelLoader.blockModelShapes.getBlockStateMapper(), modelLoader.resourceManager);

    toBake.values().forEach(model -> model.getTextures().forEach(event.getMap()::registerSprite));
}
项目:CodeChickenLib    文件:TextureUtils.java   
@SubscribeEvent
public void textureLoad(TextureStitchEvent.Pre event) {
    if (!event.getMap().getBasePath().equals("textures")) {
        CCLLog.log(Level.WARN, "Someone is calling the TextureStitchEvent.Pre for a texture map that is NOT vanillas.");
        CCLLog.log(Level.WARN, "This is a bug. There is no sense of different atlas's in vanilla so this event is NOT generic and is specific to the vanilla atlas.");
        CCLLog.log(Level.WARN, "Im catching this so things don't explode. Fix your shit!");
        CCLLog.big(Level.WARN, 100, "");
        return;
    }
    for (IIconRegister reg : iconRegisters) {
        reg.registerIcons(event.getMap());
    }
}
项目:Toms-Mod    文件:EventHandler.java   
@SubscribeEvent
public void onTextureStitchEventPost(TextureStitchEvent.Post event) {
    if (Config.reloadColours) {
        Logging.logInfo("Skipping the first generation of blockcolours, models are not loaded yet", (Object[]) null);
    } else {
        this.mw.reloadBlockColours();
    }
}
项目:geomastery    文件:ClientEvents.java   
/** Registers ICONS for container slot backgrounds. */
@SubscribeEvent
public void textureStich(TextureStitchEvent.Pre event) {

    event.getMap().registerSprite(BACKPACK_TEXTURE);
    event.getMap().registerSprite(YOKE_SLOT);
}
项目:TMT-Refraction    文件:EventHandlerClient.java   
@SubscribeEvent
public void stitch(TextureStitchEvent.Pre event) {
    event.getMap().registerSprite(new ResourceLocation(Constants.MOD_ID, "particles/glow"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MOD_ID, "particles/star"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MOD_ID, "particles/sparkle_blurred"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MOD_ID, "particles/lens_flare_1"));
}
项目:Factorization    文件:FlatMod.java   
@SubscribeEvent
public void loadModels(TextureStitchEvent.Pre event) {
    IModelMaker modelMaker = new IModelMaker() {
        @Nullable
        @Override
        public IFlatModel getModel(ResourceLocation... url) {
            return new FlatModel(url);
        }
    };
    for (FlatFace face : Flat.getAllSamples()) {
        face.loadModels(modelMaker);
    }
}
项目:Factorization    文件:FzModel.java   
@SubscribeEvent
public void loadModels(TextureStitchEvent.Pre event) {
    raws.clear();
    //event.modelBakery.reg
    Minecraft mc = Minecraft.getMinecraft();

    IResourceManager irm = mc.getResourceManager();
    HashSet<ResourceLocation> textures = new HashSet<ResourceLocation>();
    for (FzModel fzm : instances) {
        fzm.model = null;
        ResourceLocation location = fzm.getLocation(irm);
        IModel rawModel = null;
        try {
            if (location != null) {
                rawModel = ModelLoaderRegistry.getModel(location);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (rawModel == null) {
            rawModel = ModelLoaderRegistry.getMissingModel();
        }
        raws.put(fzm, rawModel);
        Collection<ResourceLocation> modelTextures = rawModel.getTextures();
        textures.addAll(modelTextures);
    }
    for (ResourceLocation texture : textures) {
        event.map.registerSprite(texture);
    }
}
项目:Factorization    文件:FactorizationClientProxy.java   
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre event) {
    RenderUtil.loadSprites("factorization", FzIcons.class, "", event);
    RenderUtil.loadSprites("factorization", BarrelModel.class, "blocks/storage/", event);
    try {
        BarrelModel.template = (IRetexturableModel) ModelLoaderRegistry.getModel(new ResourceLocation("factorization:block/barrel_template"));
        IModel socketBase = ModelLoaderRegistry.getModel(new ResourceLocation("factorization:block/socket"));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
项目:Nuclear-Foundation    文件:ClientProxy.java   
@SubscribeEvent
public void onTextureStitchPre(TextureStitchEvent.Pre event) {
    // Register all of our sprites so that we can use them for the model
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID, "blocks/uranium_bits"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID, "blocks/thorium_bits"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID, "blocks/blazonium_bits"));
    event.getMap().registerSprite(new ResourceLocation(Constants.MODID, "blocks/terminium_bits"));
}
项目:LyokoEnergistics    文件:TextureEvent.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPostTextureStitch(TextureStitchEvent.Post event)
{
    if(event.map.getTextureType() == 0)
    {
        ModFluid.DigitalSea.setIcons(ModBlock.digitalSea.getBlockTextureFromSide(1), ModBlock.digitalSea.getBlockTextureFromSide(2));
    }
}
项目:CauldronGit    文件:ForgeHooksClient.java   
public static void onTextureStitchedPost(TextureMap map)
{
    MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map));

    FluidRegistry.WATER.setIcons(BlockLiquid.getLiquidIcon("water_still"), BlockLiquid.getLiquidIcon("water_flow"));
    FluidRegistry.LAVA.setIcons(BlockLiquid.getLiquidIcon("lava_still"), BlockLiquid.getLiquidIcon("lava_flow"));
}
项目:EnderCore    文件:IconUtil.java   
@Mod.EventHandler
@SubscribeEvent
public void onIconLoad(TextureStitchEvent.Pre event) {
  for (IIconProvider reg : iconProviders) {
    if (reg.getTextureType() == event.map.getTextureType()) {
      reg.registerIcons(event.map);
    }
  }
}
项目:NOVA-Core    文件:RenderUtility.java   
/**
 * Handles NOVA texture registration.
 * @param event Event
 */
@SubscribeEvent
public void preTextureHook(TextureStitchEvent.Pre event) {
    if (event.map == Minecraft.getMinecraft().getTextureMapBlocks()) {
        Game.render().blockTextures.forEach(t -> registerIcon(t, event));
        Game.render().itemTextures.forEach(t -> registerIcon(t, event));
        //TODO: This is HACKS. We should create custom sprite sheets for entities.
        Game.render().entityTextures.forEach(t -> registerIcon(t, event));
    }
}