Everything posted by ItsAMysteriousYT
-
[SOLVED]Get the width/height of an image loaded from a resourcelocation.
Is this alright? @Override public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException { return new FileInputStream(RealLifeMod.MinecraftDirectory+"/images/"+p_110590_1_.getResourcePath()); }
-
[SOLVED]Get the width/height of an image loaded from a resourcelocation.
Ah - okay. Anything else?
-
[SOLVED]Get the width/height of an image loaded from a resourcelocation.
Okay, so is everything alright in this file? Because i do not have an assets folder in that folder. package itsamysterious.mods.reallifemod; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.Set; import com.google.common.collect.ImmutableSet; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.DefaultResourcePack; import net.minecraft.client.resources.FolderResourcePack; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; import net.minecraft.client.resources.IResourcePack; import net.minecraft.client.resources.data.IMetadataSection; import net.minecraft.client.resources.data.IMetadataSerializer; import net.minecraft.util.ResourceLocation; public class Screenshotspack extends FolderResourcePack implements IResourcePack,IResourceManagerReloadListener{ public static final Set defaultResourceDomains = ImmutableSet.of("images"); public static List<String> filenames=new ArrayList<String>(); public Screenshotspack() { super(new File(RealLifeMod.MinecraftDirectory+"/images")); } @Override public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException { File f = new File(Minecraft.getMinecraft().mcDataDir,"images"); f.setReadable(true); return new FileInputStream(RealLifeMod.MinecraftDirectory+"/images/"+p_110590_1_.getResourcePath()); } @Override public boolean resourceExists(ResourceLocation p_110589_1_) { return this.getResourceStream(p_110589_1_) != null; } private InputStream getResourceStream(ResourceLocation p_110605_1_) { InputStream f=null; try { f = new FileInputStream(RealLifeMod.MinecraftDirectory+"/images/"+p_110605_1_.getResourcePath()); f.close(); } catch (Exception e) { e.printStackTrace(); } return f; } @Override public Set getResourceDomains() { return defaultResourceDomains; } @Override public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { return null; } @Override public BufferedImage getPackImage() throws IOException { return null; } @Override public String getPackName() { return "images"; } @Override public void onResourceManagerReload(IResourceManager resourceManager) { } }
-
[SOLVED]Get the width/height of an image loaded from a resourcelocation.
Hm, is there a better way then?
-
[SOLVED]Get the width/height of an image loaded from a resourcelocation.
I implemet a custom path with the IResourceLocation and add it to the defaultresourcepacklist. Now i wanna get the width and height of the images in that folder. How can i do this?
-
Invalid Session when i try joining Lan-Game with my mod?
AH - Im so stupid
-
Use GL_LIGHT0 for Lighting?
Where is the correct link? I can't find it on the homepage/forumpost.
-
Invalid Session when i try joining Lan-Game with my mod?
No, how do i do that? i tried with - email=myemail,-password=mypass but it just skipped thos arguments
-
Use GL_LIGHT0 for Lighting?
There is no Git anymore. The sourcecode has been removed.
-
Invalid Session when i try joining Lan-Game with my mod?
When i start a Lan World and then try joining it in another minecraft, it just sais this: How can i fix that? I think my mod is servercompatible, i fixed all errors and the server starts up without any complains.
-
How do I make my Truck work? Help Me!!!
Show your code
-
Use GL_LIGHT0 for Lighting?
Is there a way to use the GL_LIGHT0 with Minecraft, so that it emits light from a position and has effect on the world?
-
Set texture to paths outside of the mod
You do not need slick to do that. Minecraft does it already with e.g. maps. Ah - okay Never had a look at that.
-
Set texture to paths outside of the mod
But sometimes it is required to bind textures that are loaded from a BufferedImage and this is possible with slick.
-
Set texture to paths outside of the mod
You can use SlickUtil to load images from the system and also to bind it to a glContext. Download it here: http://slick.ninjacave.com/slick-util.zip
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
I got it working Now i only need to save the entity through world start
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Yes, deffinitly
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Break the class down into its primitive components (strings, booleans and numbers) and write those to the buffer. Can i use the writeSpawnData method from the constructor, in that bytebuffer an id that is helt in the VehicleFile. And then i could set the file from a method that gets the file from the global list of vehicle files?
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
But i hold all the values in one Class - the VehicleFile. This class generates for every txtfile in a custom folder. And i get the values from that class in the renderer and in the entity. How can i do this properly? EDIT: Can i use the writeSpawnData method from the constructor, in that bytebuffer an id that is helt in the VehicleFile. And then i could set the file from a method that gets the file from the global list of vehicle files?
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
If you need any information on the client side, you'll need to send it from the server in some way. Depending on the nature of the information, you may want to use the DataWatcher or implement IEntityAdditionalSpawnData . Okay, how do i use IAdditionalSpawnData?
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Now the entity spawns, but the files is now null which means the entity just is invisible. But i can enter it with the packet handling stuff
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Okay - ill try that, but i have to apply a file to the entity so it knows its values and the renderer know what to render. will this make any problems?
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Is everything okay with this method? Here is the error:
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Okay, i register the entity like this: public void registerEntities() { ModEntityID = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerModEntity(EntityVehicle.class, "EntityCar", ModEntityID++, RealLifeMod.instance, 80, 1, true); EntityRegistry.registerModEntity(EntityPylon.class, "EntityPylon", ModEntityID++, RealLifeMod.instance, 80, 1, true); // EntityRegistry.registerModEntity(EntitySeat.class, "EntitySeat", // EntityRegistry.findGlobalUniqueEntityId(), RealLifeMod.instance, 80, // 1, true); } Im doing this in the main class.
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
No, didn't had this befor, i tried it with the blockpos, but same problem
IPS spam blocked by CleanTalk.