本文整理汇总了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);
}
}
}
示例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_;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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_;
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例10: trim
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private ResourceLocation trim(ResourceLocation location) {
return new ResourceLocation(location.getResourceDomain(), location.getResourcePath());
}
示例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"})));
}
示例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");
}
示例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());
}
示例14: getBlockstateLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private ResourceLocation getBlockstateLocation(ResourceLocation location)
{
return new ResourceLocation(location.getResourceDomain(), "blockstates/" + location.getResourcePath() + ".json");
}
示例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_);
}
}