本文整理汇总了Java中net.minecraft.client.resources.IResourcePack.getInputStream方法的典型用法代码示例。如果您正苦于以下问题:Java IResourcePack.getInputStream方法的具体用法?Java IResourcePack.getInputStream怎么用?Java IResourcePack.getInputStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.resources.IResourcePack
的用法示例。
在下文中一共展示了IResourcePack.getInputStream方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadResources
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
private static void loadResources(IResourcePack p_loadResources_0_, String[] p_loadResources_1_, Map p_loadResources_2_)
{
try
{
for (int i = 0; i < p_loadResources_1_.length; ++i)
{
String s = p_loadResources_1_[i];
ResourceLocation resourcelocation = new ResourceLocation(s);
if (p_loadResources_0_.resourceExists(resourcelocation))
{
InputStream inputstream = p_loadResources_0_.getInputStream(resourcelocation);
if (inputstream != null)
{
loadLocaleData(inputstream, p_loadResources_2_);
}
}
}
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
}
示例2: getBedrockImage
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static BufferedImage getBedrockImage() {
if (TConTextureResourcePackBedrockium.bedrockImage == null) {
final ResourceLocation bedrockLocation = new ResourceLocation("minecraft", "textures/blocks/bedrock.png");
try {
final DefaultResourcePack mcDefaultResourcePack = (DefaultResourcePack)ObfuscationReflectionHelper.getPrivateValue((Class)Minecraft.class, (Object)Minecraft.getMinecraft(), new String[] { "field_110450_ap", "mcDefaultResourcePack" });
InputStream inputStream = mcDefaultResourcePack.getInputStream(bedrockLocation);
final List<ResourcePackRepository.Entry> t = (List<ResourcePackRepository.Entry>)Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries();
for (final ResourcePackRepository.Entry entry : t) {
final IResourcePack resourcePack = entry.getResourcePack();
if (resourcePack.resourceExists(bedrockLocation)) {
inputStream = resourcePack.getInputStream(bedrockLocation);
}
}
TConTextureResourcePackBedrockium.bedrockImage = ImageIO.read(inputStream);
}
catch (IOException e) {
throw Throwables.propagate((Throwable)e);
}
}
return TConTextureResourcePackBedrockium.bedrockImage;
}
示例3: getStream
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public InputStream getStream(final ResourceLocation location) {
InputStream stream = null;
for (final IResourcePack iResourcePack : this.getPacks()) {
if (iResourcePack.resourceExists(location)) {
try {
stream = iResourcePack.getInputStream(location);
}
catch (IOException ex) {}
}
}
return stream;
}
示例4: getTextureAnimations
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static TextureAnimation[] getTextureAnimations(IResourcePack p_getTextureAnimations_0_)
{
String[] astring = ResUtils.collectFiles(p_getTextureAnimations_0_, (String)"mcpatcher/anim", (String)".properties", (String[])null);
if (astring.length <= 0)
{
return null;
}
else
{
List list = new ArrayList();
for (int i = 0; i < astring.length; ++i)
{
String s = astring[i];
Config.dbg("Texture animation: " + s);
try
{
ResourceLocation resourcelocation = new ResourceLocation(s);
InputStream inputstream = p_getTextureAnimations_0_.getInputStream(resourcelocation);
Properties properties = new Properties();
properties.load(inputstream);
TextureAnimation textureanimation = makeTextureAnimation(properties, resourcelocation);
if (textureanimation != null)
{
ResourceLocation resourcelocation1 = new ResourceLocation(textureanimation.getDstTex());
if (Config.getDefiningResourcePack(resourcelocation1) != p_getTextureAnimations_0_)
{
Config.dbg("Skipped: " + s + ", target texture not loaded from same resource pack");
}
else
{
list.add(textureanimation);
}
}
}
catch (FileNotFoundException filenotfoundexception)
{
Config.warn("File not found: " + filenotfoundexception.getMessage());
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
}
TextureAnimation[] atextureanimation = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()]));
return atextureanimation;
}
}
示例5: updateIcons
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap p_updateIcons_0_, IResourcePack p_updateIcons_1_)
{
String[] astring = ResUtils.collectFiles(p_updateIcons_1_, "mcpatcher/ctm/", ".properties", getDefaultCtmPaths());
Arrays.sort((Object[])astring);
List list = makePropertyList(tileProperties);
List list1 = makePropertyList(blockProperties);
for (int i = 0; i < astring.length; ++i)
{
String s = astring[i];
Config.dbg("ConnectedTextures: " + s);
try
{
ResourceLocation resourcelocation = new ResourceLocation(s);
InputStream inputstream = p_updateIcons_1_.getInputStream(resourcelocation);
if (inputstream == null)
{
Config.warn("ConnectedTextures file not found: " + s);
}
else
{
Properties properties = new Properties();
properties.load(inputstream);
ConnectedProperties connectedproperties = new ConnectedProperties(properties, s);
if (connectedproperties.isValid(s))
{
connectedproperties.updateIcons(p_updateIcons_0_);
addToTileList(connectedproperties, list);
addToBlockList(connectedproperties, list1);
}
}
}
catch (FileNotFoundException var11)
{
Config.warn("ConnectedTextures file not found: " + s);
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
blockProperties = propertyListToArray(list1);
tileProperties = propertyListToArray(list);
multipass = detectMultipass();
Config.dbg("Multipass connected textures: " + multipass);
}
示例6: updateIcons
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap p_updateIcons_0_, IResourcePack p_updateIcons_1_)
{
String[] astring = collectFiles(p_updateIcons_1_, "mcpatcher/ctm/", ".properties");
Arrays.sort((Object[])astring);
List list = makePropertyList(tileProperties);
List list1 = makePropertyList(blockProperties);
for (int i = 0; i < astring.length; ++i)
{
String s = astring[i];
Config.dbg("ConnectedTextures: " + s);
try
{
ResourceLocation resourcelocation = new ResourceLocation(s);
InputStream inputstream = p_updateIcons_1_.getInputStream(resourcelocation);
if (inputstream == null)
{
Config.warn("ConnectedTextures file not found: " + s);
}
else
{
Properties properties = new Properties();
properties.load(inputstream);
ConnectedProperties connectedproperties = new ConnectedProperties(properties, s);
if (connectedproperties.isValid(s))
{
connectedproperties.updateIcons(p_updateIcons_0_);
addToTileList(connectedproperties, list);
addToBlockList(connectedproperties, list1);
}
}
}
catch (FileNotFoundException var11)
{
Config.warn("ConnectedTextures file not found: " + s);
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
}
blockProperties = propertyListToArray(list1);
tileProperties = propertyListToArray(list);
multipass = detectMultipass();
Config.dbg("Multipass connected textures: " + multipass);
}
示例7: getTextureAnimations
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static TextureAnimation[] getTextureAnimations(IResourcePack p_getTextureAnimations_0_)
{
String[] astring = ResUtils.collectFiles(p_getTextureAnimations_0_, (String)"mcpatcher/anim/", (String)".properties", (String[])null);
if (astring.length <= 0)
{
return null;
}
else
{
List list = new ArrayList();
for (int i = 0; i < astring.length; ++i)
{
String s = astring[i];
Config.dbg("Texture animation: " + s);
try
{
ResourceLocation resourcelocation = new ResourceLocation(s);
InputStream inputstream = p_getTextureAnimations_0_.getInputStream(resourcelocation);
Properties properties = new Properties();
properties.load(inputstream);
TextureAnimation textureanimation = makeTextureAnimation(properties, resourcelocation);
if (textureanimation != null)
{
ResourceLocation resourcelocation1 = new ResourceLocation(textureanimation.getDstTex());
if (Config.getDefiningResourcePack(resourcelocation1) != p_getTextureAnimations_0_)
{
Config.dbg("Skipped: " + s + ", target texture not loaded from same resource pack");
}
else
{
list.add(textureanimation);
}
}
}
catch (FileNotFoundException filenotfoundexception)
{
Config.warn("File not found: " + filenotfoundexception.getMessage());
}
catch (IOException ioexception)
{
ioexception.printStackTrace();
}
}
TextureAnimation[] atextureanimation = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()]));
return atextureanimation;
}
}
示例8: openPackDescriptor
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openPackDescriptor(@Nonnull final IResourcePack pack) throws IOException {
return pack.getInputStream(this.manifest);
}
示例9: openAcoustics
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openAcoustics(@Nonnull final IResourcePack pack) throws IOException {
return pack.getInputStream(this.acoustics);
}
示例10: openPrimitiveMap
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@Nullable
public InputStream openPrimitiveMap(@Nonnull final IResourcePack pack) throws IOException {
return pack.getInputStream(this.primitivemap);
}
示例11: openScript
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private InputStream openScript(@Nonnull final IResourcePack pack) throws IOException {
return pack.getInputStream(SCRIPT);
}
示例12: updateIcons
import net.minecraft.client.resources.IResourcePack; //导入方法依赖的package包/类
public static void updateIcons(TextureMap textureMap, IResourcePack rp)
{
String[] names = collectFiles(rp, "mcpatcher/ctm/", ".properties");
Arrays.sort(names);
List tileList = makePropertyList(tileProperties);
List blockList = makePropertyList(blockProperties);
for (int i = 0; i < names.length; ++i)
{
String name = names[i];
Config.dbg("ConnectedTextures: " + name);
try
{
ResourceLocation e = new ResourceLocation(name);
InputStream in = rp.getInputStream(e);
if (in == null)
{
Config.warn("ConnectedTextures file not found: " + name);
}
else
{
Properties props = new Properties();
props.load(in);
ConnectedProperties cp = new ConnectedProperties(props, name);
if (cp.isValid(name))
{
cp.updateIcons(textureMap);
addToTileList(cp, tileList);
addToBlockList(cp, blockList);
}
}
}
catch (FileNotFoundException var11)
{
Config.warn("ConnectedTextures file not found: " + name);
}
catch (IOException var12)
{
var12.printStackTrace();
}
}
blockProperties = propertyListToArray(blockList);
tileProperties = propertyListToArray(tileList);
multipass = detectMultipass();
Config.dbg("Multipass connected textures: " + multipass);
}