当前位置: 首页>>代码示例>>Java>>正文


Java TextureStitchEvent.Pre方法代码示例

本文整理汇总了Java中net.minecraftforge.client.event.TextureStitchEvent.Pre方法的典型用法代码示例。如果您正苦于以下问题:Java TextureStitchEvent.Pre方法的具体用法?Java TextureStitchEvent.Pre怎么用?Java TextureStitchEvent.Pre使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.client.event.TextureStitchEvent的用法示例。


在下文中一共展示了TextureStitchEvent.Pre方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: textureStuff

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));

}
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:25,代码来源:StitchEventHandler.java

示例2: handleStich

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:27,代码来源:TConEvents.java

示例3: load0

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:22,代码来源:RenderUtil.java

示例4: onStitch

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:FluidTexturesGC.java

示例5: onRegisterTexture

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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++;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:19,代码来源:EventHandlerClient.java

示例6: loadSprites

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:30,代码来源:RenderUtil.java

示例7: onPreTextureStiching

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));
    }
    
}
 
开发者ID:FlowstoneTeam,项目名称:FlowstoneEnergy,代码行数:21,代码来源:TextureStitchEventHandler.java

示例8: onStitch

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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());
		}
	}
}
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:18,代码来源:TextureMapHandler.java

示例9: onTextureStitchEvent

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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);
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:20,代码来源:CanvasTextureManager.java

示例10: onItemIconRegister

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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");
    }
}
 
开发者ID:TeamMetallurgy,项目名称:Agriculture,代码行数:20,代码来源:ExtraIcons.java

示例11: stitch

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:14,代码来源:EventHandler.java

示例12: stitchEventPre

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:8,代码来源:ClientProxy.java

示例13: registerParticles

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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());
}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:8,代码来源:ParticleManager.java

示例14: loadTextures

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));
		}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:13,代码来源:ClientEventHandler.java

示例15: onTextureStitch

import net.minecraftforge.client.event.TextureStitchEvent; //导入方法依赖的package包/类
@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"));
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:10,代码来源:ClientProxy.java


注:本文中的net.minecraftforge.client.event.TextureStitchEvent.Pre方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。