當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。