Jump to content

ItsAMysteriousYT

Members
  • Posts

    785
  • Joined

  • Last visited

Everything posted by ItsAMysteriousYT

  1. Is this alright? @Override public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException { return new FileInputStream(RealLifeMod.MinecraftDirectory+"/images/"+p_110590_1_.getResourcePath()); }
  2. 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) { } }
  3. 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?
  4. Where is the correct link? I can't find it on the homepage/forumpost.
  5. No, how do i do that? i tried with - email=myemail,-password=mypass but it just skipped thos arguments
  6. There is no Git anymore. The sourcecode has been removed.
  7. 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.
  8. 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?
  9. You do not need slick to do that. Minecraft does it already with e.g. maps. Ah - okay Never had a look at that.
  10. But sometimes it is required to bind textures that are loaded from a BufferedImage and this is possible with slick.
  11. 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
  12. I got it working Now i only need to save the entity through world start
  13. 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?
  14. 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?
  15. 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?
  16. 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
  17. 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?
  18. 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.
  19. No, didn't had this befor, i tried it with the blockpos, but same problem
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.