当前位置: 首页>>代码示例>>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;未经允许,请勿转载。