本文整理汇总了Java中net.minecraft.util.ResourceLocation.getResourcePath方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceLocation.getResourcePath方法的具体用法?Java ResourceLocation.getResourcePath怎么用?Java ResourceLocation.getResourcePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.ResourceLocation
的用法示例。
在下文中一共展示了ResourceLocation.getResourcePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: loadModel
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
public IModel loadModel(ResourceLocation modelLocation) throws Exception
{
if(modelLocation.equals(MODEL_MISSING) && loader.missingModel != null)
{
return loader.getMissingModel();
}
String modelPath = modelLocation.getResourcePath();
if(modelLocation.getResourcePath().startsWith("models/"))
{
modelPath = modelPath.substring("models/".length());
}
ResourceLocation armatureLocation = new ResourceLocation(modelLocation.getResourceDomain(), "armatures/" + modelPath + ".json");
ModelBlockAnimation animation = ModelBlockAnimation.loadVanillaAnimation(loader.resourceManager, armatureLocation);
ModelBlock model = loader.loadModel(modelLocation);
IModel iModel = loader.new VanillaModelWrapper(modelLocation, model, false, animation);
if(loader.missingModel == null && modelLocation.equals(MODEL_MISSING))
{
loader.missingModel = iModel;
}
return iModel;
}
示例3: makeProperties
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private static RandomMobsProperties makeProperties(ResourceLocation p_makeProperties_0_)
{
String s = p_makeProperties_0_.getResourcePath();
ResourceLocation resourcelocation = getPropertyLocation(p_makeProperties_0_);
if (resourcelocation != null)
{
RandomMobsProperties randommobsproperties = parseProperties(resourcelocation, p_makeProperties_0_);
if (randommobsproperties != null)
{
return randommobsproperties;
}
}
ResourceLocation[] aresourcelocation = getTextureVariants(p_makeProperties_0_);
return new RandomMobsProperties(s, aresourcelocation);
}
示例4: getInputStream
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
public InputStream getInputStream(ResourceLocation location) throws IOException
{
InputStream inputstream = this.getResourceStream(location);
if (inputstream != null)
{
return inputstream;
}
else
{
InputStream inputstream1 = this.getInputStreamAssets(location);
if (inputstream1 != null)
{
return inputstream1;
}
else
{
throw new FileNotFoundException(location.getResourcePath());
}
}
}
示例5: getProperties
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private static RandomMobsProperties getProperties(ResourceLocation p_getProperties_0_)
{
String s = p_getProperties_0_.getResourcePath();
RandomMobsProperties randommobsproperties = (RandomMobsProperties)locationProperties.get(s);
if (randommobsproperties == null)
{
randommobsproperties = makeProperties(p_getProperties_0_);
locationProperties.put(s, randommobsproperties);
}
return randommobsproperties;
}
示例6: 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/items/" + 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;
}
}
示例7: getNSMapLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
public static ResourceLocation getNSMapLocation(ResourceLocation location, String mapName)
{
String s = location.getResourcePath();
String[] astring = s.split(".png");
String s1 = astring[0];
return new ResourceLocation(location.getResourceDomain(), s1 + "_" + mapName + ".png");
}
示例8: 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;
}
}
示例9: getHdFontLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private 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_;
}
}
}
示例10: HarshenTemplate
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
protected HarshenTemplate(ResourceLocation location) {
String s = location.getResourceDomain();
String s1 = location.getResourcePath();
InputStream stream = null;
boolean flag;
try
{
stream = getClass().getResourceAsStream("/assets/" + HarshenCastle.MODID + "/structures/" + s1 + ".nbt");
NBTTagCompound compound = CompressedStreamTools.readCompressed(stream);
if (!compound.hasKey("DataVersion", 99))
{
compound.setInteger("DataVersion", 500);
}
Template template = new Template();
DataFixer fixer;
try
{
fixer = Minecraft.getMinecraft().getDataFixer();
}
catch (Throwable e) {
fixer = FMLServerHandler.instance().getDataFixer();
}
template.read(fixer.process(FixTypes.STRUCTURE, compound));
this.blocks.clear();
NBTTagList nbttaglist = compound.getTagList("size", 3);
this.size = new BlockPos(nbttaglist.getIntAt(0), nbttaglist.getIntAt(1), nbttaglist.getIntAt(2));
NBTTagList nbttaglist4 = compound.getTagList("pos", 3);
if(nbttaglist4.hasNoTags())
this.pos = BlockPos.ORIGIN;
else
this.pos = new BlockPos(nbttaglist4.getIntAt(0), nbttaglist4.getIntAt(1), nbttaglist4.getIntAt(2));
BasicPalette template$basicpalette = new BasicPalette();
NBTTagList nbttaglist1 = compound.getTagList("palette", 10);
for (int i = 0; i < nbttaglist1.tagCount(); ++i)
{
template$basicpalette.addMapping(NBTUtil.readBlockState(nbttaglist1.getCompoundTagAt(i)), i);
}
NBTTagList nbttaglist3 = compound.getTagList("blocks", 10);
for (int j = 0; j < nbttaglist3.tagCount(); ++j)
{
NBTTagCompound nbttagcompound = nbttaglist3.getCompoundTagAt(j);
NBTTagList nbttaglist2 = nbttagcompound.getTagList("pos", 3);
BlockPos blockpos = new BlockPos(nbttaglist2.getIntAt(0), nbttaglist2.getIntAt(1), nbttaglist2.getIntAt(2));
IBlockState iblockstate = template$basicpalette.stateFor(nbttagcompound.getInteger("state"));
NBTTagCompound nbttagcompound1;
if (nbttagcompound.hasKey("nbt"))
{
nbttagcompound1 = nbttagcompound.getCompoundTag("nbt");
}
else
{
nbttagcompound1 = null;
}
if(!(iblockstate.getBlock() instanceof BlockStructure))
this.blocks.add(new Template.BlockInfo(blockpos, iblockstate, nbttagcompound1));
}
}
catch (Throwable var10)
{
}
finally
{
IOUtils.closeQuietly(stream);
}
}
示例11: getBlockStateLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private ResourceLocation getBlockStateLocation(ResourceLocation p_177584_1_)
{
return new ResourceLocation(p_177584_1_.getResourceDomain(), "blockstates/" + p_177584_1_.getResourcePath() + ".json");
}
示例12: getItemLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
private ResourceLocation getItemLocation(String p_177583_1_)
{
ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_);
return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath());
}
示例13: getItemLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
protected ResourceLocation getItemLocation(String location)
{
ResourceLocation resourcelocation = new ResourceLocation(location.replaceAll("#.*", ""));
return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath());
}
示例14: 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());
}
示例15: getTextureLocation
import net.minecraft.util.ResourceLocation; //导入方法依赖的package包/类
public static ResourceLocation getTextureLocation(ResourceLocation p_getTextureLocation_0_)
{
if (working)
{
return p_getTextureLocation_0_;
}
else
{
ResourceLocation entity;
try
{
working = true;
if (!initialized)
{
initialize();
}
if (renderGlobal != null)
{
Entity entity1 = renderGlobal.renderedEntity;
if (!(entity1 instanceof EntityLiving))
{
ResourceLocation resourcelocation2 = p_getTextureLocation_0_;
return resourcelocation2;
}
EntityLiving entityliving = (EntityLiving)entity1;
String s = p_getTextureLocation_0_.getResourcePath();
if (!s.startsWith("textures/entity/"))
{
ResourceLocation resourcelocation3 = p_getTextureLocation_0_;
return resourcelocation3;
}
RandomMobsProperties randommobsproperties = getProperties(p_getTextureLocation_0_);
if (randommobsproperties == null)
{
ResourceLocation resourcelocation4 = p_getTextureLocation_0_;
return resourcelocation4;
}
ResourceLocation resourcelocation1 = randommobsproperties.getTextureLocation(p_getTextureLocation_0_, entityliving);
return resourcelocation1;
}
entity = p_getTextureLocation_0_;
}
finally
{
working = false;
}
return entity;
}
}