Posted May 7, 201510 yr Hi, it's possible to transform a url (wich locate an image png) to a resource location? i know how to download the image but i can't transform it to a resource location
May 7, 201510 yr Hi, it's possible to transform a url (wich locate an image png) to a resource location? i know how to download the image but i can't transform it to a resource location Nope it is not... And what you're doing is (can be better) done in completely other way... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
May 7, 201510 yr elix, what? You are wrong (about 1st thing) It is possible. I am assuming you are asking about loading .png file from anywhere. In that case you can implement IResourcePack that allows you to generate virtual resources with getInputStream. Once you generate resources you can put them into Minecraft#defaultResourcePacks using reflection (ReflectionObfuscationHelper). Note: getInputStream allows any input, you can probably use direct stream from Http, just make sure to use multi-threading when you are downloading files. 1.7.10 is no longer supported by forge, you are on your own.
May 8, 201510 yr elix, what? You are wrong (about 1st thing) It is possible. I am assuming you are asking about loading .png file from anywhere. In that case you can implement IResourcePack that allows you to generate virtual resources with getInputStream. Once you generate resources you can put them into Minecraft#defaultResourcePacks using reflection (ReflectionObfuscationHelper). Note: getInputStream allows any input, you can probably use direct stream from Http, just make sure to use multi-threading when you are downloading files. He wanted to transform Image to ResourceLocation, which is not possible. ResourceLocation is just reference, "path", to resource with modid and internal path. What he needed to use, you said above... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
May 8, 201510 yr elix, what? You are wrong (about 1st thing) It is possible. I am assuming you are asking about loading .png file from anywhere. In that case you can implement IResourcePack that allows you to generate virtual resources with getInputStream. Once you generate resources you can put them into Minecraft#defaultResourcePacks using reflection (ReflectionObfuscationHelper). Note: getInputStream allows any input, you can probably use direct stream from Http, just make sure to use multi-threading when you are downloading files. He wanted to transform Image to ResourceLocation, which is not possible. ResourceLocation is just reference, "path", to resource with modid and internal path. What he needed to use, you said above... No. It is actually possible. Think about skin, it is also from URL! So, Look into the class 'DynamicTexture'. It will give you a hint. + This thread will also help you: http://www.minecraftforge.net/forum/index.php/topic,25161.msg127886.html#msg127886 I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 8, 201510 yr elix, what? You are wrong (about 1st thing) It is possible. I am assuming you are asking about loading .png file from anywhere. In that case you can implement IResourcePack that allows you to generate virtual resources with getInputStream. Once you generate resources you can put them into Minecraft#defaultResourcePacks using reflection (ReflectionObfuscationHelper). Note: getInputStream allows any input, you can probably use direct stream from Http, just make sure to use multi-threading when you are downloading files. He wanted to transform Image to ResourceLocation, which is not possible. ResourceLocation is just reference, "path", to resource with modid and internal path. What he needed to use, you said above... No. It is actually possible. Think about skin, it is also from URL! So, Look into the class 'DynamicTexture'. It will give you a hint. + This thread will also help you: http://www.minecraftforge.net/forum/index.php/topic,25161.msg127886.html#msg127886 ResourceLocation and Dynamic texture or New resource pack are different things. Resource location is just 2 strings showing mc resource path... But in order to display that texture, you need or DynaimcTexture or dynamic resource pack... Again, ResourceLocation is just a location, path and not texture it self... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
May 9, 201510 yr ResourceLocation and Dynamic texture or New resource pack are different things. Resource location is just 2 strings showing mc resource path... But in order to display that texture, you need or DynaimcTexture or dynamic resource pack... Again, ResourceLocation is just a location, path and not texture it self... Yes, you're right. I might see illusion or something... (I saw something setting ResourceLocation in DynamicTexture code) Anyway, Dynamic Texture will be needed to do what OP wanted to do. EDIT: I'd upse my previous admission, see TextureManager#getDynamicTextureLocation code. It registers the DynamicTexture with key 'ResourceLocation'. So in this case ResourceLocation is actually an abstract expression of resource location, as key for the resource I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.