當前位置: 首頁>>代碼示例>>Java>>正文


Java ResourceLocation.getResourceDomain方法代碼示例

本文整理匯總了Java中net.minecraft.util.ResourceLocation.getResourceDomain方法的典型用法代碼示例。如果您正苦於以下問題:Java ResourceLocation.getResourceDomain方法的具體用法?Java ResourceLocation.getResourceDomain怎麽用?Java ResourceLocation.getResourceDomain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.ResourceLocation的用法示例。


在下文中一共展示了ResourceLocation.getResourceDomain方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: lootTableLoaded

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
@SubscribeEvent
public void lootTableLoaded(LootTableLoadEvent event)
{
	ResourceLocation poolName = event.getName();

	String injectTablePath = "inject/" + poolName.getResourceDomain() + "/" + poolName.getResourcePath();

	if (!LootTableInjector.INJECTED_LOOT_TABLES.contains(injectTablePath))
	{
		return;
	}

	LootTable injectTable = event.getLootTableManager().getLootTableFromLocation(new ResourceLocation(BetterThanWeagles.MODID, injectTablePath));
	for (int i = 0; i < LootTableInjector.MAX_POOLS; i++)
	{
		LootPool pool = injectTable.getPool(String.format("inject%d", i));
		if (pool != null)
		{
			event.getTable().addPool(pool);
		}
	}
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:23,代碼來源:LootTableInjector.java

示例2: func_191382_c

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation func_191382_c(ResourceLocation p_191382_1_)
{
    String s = p_191382_1_.getResourcePath();

    if (!"lang/swg_de.lang".equals(s) && s.startsWith("lang/") && s.endsWith(".lang"))
    {
        int i = s.indexOf(95);

        if (i != -1)
        {
            final String s1 = s.substring(0, i + 1) + s.substring(i + 1, s.indexOf(46, i)).toUpperCase() + ".lang";
            return new ResourceLocation(p_191382_1_.getResourceDomain(), "")
            {
                public String getResourcePath()
                {
                    return s1;
                }
            };
        }
    }

    return p_191382_1_;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:LegacyV2Adapter.java

示例3: readTemplateFromJar

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
/**
 * reads a template from the minecraft jar
 */
private boolean readTemplateFromJar(ResourceLocation id)
{
    String s = id.getResourceDomain();
    String s1 = id.getResourcePath();
    InputStream inputstream = null;
    boolean flag;

    try
    {
        inputstream = MinecraftServer.class.getResourceAsStream("/assets/" + s + "/structures/" + s1 + ".nbt");
        this.readTemplateFromStream(s1, inputstream);
        return true;
    }
    catch (Throwable var10)
    {
        flag = false;
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }

    return flag;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:28,代碼來源:TemplateManager.java

示例4: getHdFontLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private static ResourceLocation getHdFontLocation(ResourceLocation fontLoc)
   {
String fontName = fontLoc.getResourcePath();
String texturesStr = "textures/";
String mcpatcherStr = "obsidian/";

if (!fontName.startsWith(texturesStr))
{
    return fontLoc;
}
else
{
    fontName = fontName.substring(texturesStr.length());
    fontName = mcpatcherStr + fontName;
    ResourceLocation fontLocHD = new ResourceLocation(fontLoc.getResourceDomain(), fontName);
    return Config.hasResource(Config.getResourceManager(), fontLocHD) ? fontLocHD : fontLoc;
}
   }
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:FontRenderer.java

示例5: readFontProperties

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
public static Properties readFontProperties(ResourceLocation p_readFontProperties_0_)
{
    String s = p_readFontProperties_0_.getResourcePath();
    Properties properties = new Properties();
    String s1 = ".png";

    if (!s.endsWith(s1))
    {
        return properties;
    }
    else
    {
        String s2 = s.substring(0, s.length() - s1.length()) + ".properties";

        try
        {
            ResourceLocation resourcelocation = new ResourceLocation(p_readFontProperties_0_.getResourceDomain(), s2);
            InputStream inputstream = Config.getResourceStream(Config.getResourceManager(), resourcelocation);

            if (inputstream == null)
            {
                return properties;
            }

            Config.log("Loading " + s2);
            properties.load(inputstream);
        }
        catch (FileNotFoundException var7)
        {
            ;
        }
        catch (IOException ioexception)
        {
            ioexception.printStackTrace();
        }

        return properties;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:40,代碼來源:FontUtils.java

示例6: getHdFontLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
public static ResourceLocation getHdFontLocation(ResourceLocation p_getHdFontLocation_0_)
{
    if (!Config.isCustomFonts())
    {
        return p_getHdFontLocation_0_;
    }
    else if (p_getHdFontLocation_0_ == null)
    {
        return p_getHdFontLocation_0_;
    }
    else
    {
        String s = p_getHdFontLocation_0_.getResourcePath();
        String s1 = "textures/";
        String s2 = "mcpatcher/";

        if (!s.startsWith(s1))
        {
            return p_getHdFontLocation_0_;
        }
        else
        {
            s = s.substring(s1.length());
            s = s2 + s;
            ResourceLocation resourcelocation = new ResourceLocation(p_getHdFontLocation_0_.getResourceDomain(), s);
            return Config.hasResource(Config.getResourceManager(), resourcelocation) ? resourcelocation : p_getHdFontLocation_0_;
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:30,代碼來源:FontUtils.java

示例7: getTextureLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation getTextureLocation(String p_getTextureLocation_1_)
{
    if (p_getTextureLocation_1_ == null)
    {
        return null;
    }
    else
    {
        ResourceLocation resourcelocation = new ResourceLocation(p_getTextureLocation_1_);
        String s = resourcelocation.getResourceDomain();
        String s1 = resourcelocation.getResourcePath();

        if (!s1.contains("/"))
        {
            s1 = "textures/blocks/" + s1;
        }

        String s2 = s1 + ".png";
        ResourceLocation resourcelocation1 = new ResourceLocation(s, s2);
        boolean flag = Config.hasResource(resourcelocation1);

        if (!flag)
        {
            Config.warn("File not found: " + s2);
        }

        return resourcelocation1;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:30,代碼來源:CustomItemProperties.java

示例8: getSpriteLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation getSpriteLocation(ResourceLocation p_getSpriteLocation_1_)
{
    String s = p_getSpriteLocation_1_.getResourcePath();
    s = StrUtils.removePrefix(s, "textures/");
    s = StrUtils.removeSuffix(s, ".png");
    ResourceLocation resourcelocation = new ResourceLocation(p_getSpriteLocation_1_.getResourceDomain(), s);
    return resourcelocation;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:9,代碼來源:CustomItemProperties.java

示例9: RitualInfusion

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
public RitualInfusion(ResourceLocation registryName, NonNullList<Ingredient> input, NonNullList<ItemStack> output, int timeInTicks, int circles, int altarStartingPower, int powerPerTick, EnumInfusionType type) {
	super(new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + "_" + type.name().toLowerCase()), input, output, timeInTicks, circles, altarStartingPower, powerPerTick);
	this.type = type;
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:5,代碼來源:RitualInfusion.java

示例10: trim

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation trim(ResourceLocation location) {
	return new ResourceLocation(location.getResourceDomain(), location.getResourcePath());
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:4,代碼來源:DummyModelLoader.java

示例11: completeResourceLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
public ResourceLocation completeResourceLocation(ResourceLocation location, int p_147634_2_)
{
    return this.isAbsoluteLocation(location) ? (p_147634_2_ == 0 ? new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".png") : new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + "mipmap" + p_147634_2_ + ".png")) : (p_147634_2_ == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", new Object[] {this.basePath, location.getResourcePath(), ".png"})): new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {this.basePath, location.getResourcePath(), Integer.valueOf(p_147634_2_), ".png"})));
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:5,代碼來源:TextureMap.java

示例12: getModelLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation getModelLocation(ResourceLocation p_177580_1_)
{
    return new ResourceLocation(p_177580_1_.getResourceDomain(), "models/" + p_177580_1_.getResourcePath() + ".json");
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:ModelBakery.java

示例13: getBlockLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
protected ResourceLocation getBlockLocation(String location)
{
    ResourceLocation tmp = new ResourceLocation(location);
    return new ResourceLocation(tmp.getResourceDomain(), "block/" + tmp.getResourcePath());
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:6,代碼來源:ForgeBlockStateV1.java

示例14: getBlockstateLocation

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private ResourceLocation getBlockstateLocation(ResourceLocation location)
{
    return new ResourceLocation(location.getResourceDomain(), "blockstates/" + location.getResourcePath() + ".json");
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:5,代碼來源:ModelBakery.java

示例15: loadSoundResource

import net.minecraft.util.ResourceLocation; //導入方法依賴的package包/類
private void loadSoundResource(ResourceLocation location, SoundList sounds)
{
    boolean flag = !this.sndRegistry.containsKey(location);
    SoundEventAccessorComposite soundeventaccessorcomposite;

    if (!flag && !sounds.canReplaceExisting())
    {
        soundeventaccessorcomposite = (SoundEventAccessorComposite)this.sndRegistry.getObject(location);
    }
    else
    {
        if (!flag)
        {
            logger.debug("Replaced sound event location {}", new Object[] {location});
        }

        soundeventaccessorcomposite = new SoundEventAccessorComposite(location, 1.0D, 1.0D, sounds.getSoundCategory());
        this.sndRegistry.registerSound(soundeventaccessorcomposite);
    }

    for (final SoundList.SoundEntry soundlist$soundentry : sounds.getSoundList())
    {
        String s = soundlist$soundentry.getSoundEntryName();
        ResourceLocation resourcelocation = new ResourceLocation(s);
        final String s1 = s.contains(":") ? resourcelocation.getResourceDomain() : location.getResourceDomain();
        Object lvt_10_1_;

        switch (soundlist$soundentry.getSoundEntryType())
        {
            case FILE:
                ResourceLocation resourcelocation1 = new ResourceLocation(s1, "sounds/" + resourcelocation.getResourcePath() + ".ogg");
                InputStream inputstream = null;

                try
                {
                    inputstream = this.mcResourceManager.getResource(resourcelocation1).getInputStream();
                }
                catch (FileNotFoundException var18)
                {
                    logger.warn("File {} does not exist, cannot add it to event {}", new Object[] {resourcelocation1, location});
                    continue;
                }
                catch (IOException ioexception)
                {
                    logger.warn((String)("Could not load sound file " + resourcelocation1 + ", cannot add it to event " + location), (Throwable)ioexception);
                    continue;
                }
                finally
                {
                    IOUtils.closeQuietly(inputstream);
                }

                lvt_10_1_ = new SoundEventAccessor(new SoundPoolEntry(resourcelocation1, (double)soundlist$soundentry.getSoundEntryPitch(), (double)soundlist$soundentry.getSoundEntryVolume(), soundlist$soundentry.isStreaming()), soundlist$soundentry.getSoundEntryWeight());
                break;

            case SOUND_EVENT:
                lvt_10_1_ = new ISoundEventAccessor<SoundPoolEntry>()
                {
                    final ResourceLocation field_148726_a = new ResourceLocation(s1, soundlist$soundentry.getSoundEntryName());
                    public int getWeight()
                    {
                        SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a);
                        return soundeventaccessorcomposite1 == null ? 0 : soundeventaccessorcomposite1.getWeight();
                    }
                    public SoundPoolEntry cloneEntry()
                    {
                        SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a);
                        return soundeventaccessorcomposite1 == null ? SoundHandler.missing_sound : soundeventaccessorcomposite1.cloneEntry();
                    }
                };

                break;
            default:
                throw new IllegalStateException("IN YOU FACE");
        }

        soundeventaccessorcomposite.addSoundToEventPool((ISoundEventAccessor<SoundPoolEntry>)lvt_10_1_);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:80,代碼來源:SoundHandler.java


注:本文中的net.minecraft.util.ResourceLocation.getResourceDomain方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。