Jump to content

CreativeMD

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by CreativeMD

  1. You are totally right, but i don't know how. I only have to overwrite one method startGame() private void startGame() throws LWJGLException { this.gameSettings = new GameSettings(this, this.mcDataDir); if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { this.displayWidth = this.gameSettings.overrideWidth; this.displayHeight = this.gameSettings.overrideHeight; } if (this.fullscreen) { Display.setFullscreen(true); this.displayWidth = Display.getDisplayMode().getWidth(); this.displayHeight = Display.getDisplayMode().getHeight(); if (this.displayWidth <= 0) { this.displayWidth = 1; } if (this.displayHeight <= 0) { this.displayHeight = 1; } } else { Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); } Display.setResizable(true); Display.setTitle("Minecraft 1.6.4"); this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); if (Util.getOSType() != EnumOS.MACOS) { try { Display.setIcon(new ByteBuffer[] {this.readImage(new File(this.fileAssets, "/icons/icon_16x16.png")), this.readImage(new File(this.fileAssets, "/icons/icon_32x32.png"))}); } catch (IOException ioexception) { ioexception.printStackTrace(); } } try { ForgeHooksClient.createDisplay(); } catch (LWJGLException lwjglexception) { lwjglexception.printStackTrace(); try { Thread.sleep(1000L); } catch (InterruptedException interruptedexception) { ; } if (this.fullscreen) { this.updateDisplayMode(); } Display.create(); } OpenGlHelper.initializeTextures(); this.guiAchievement = new GuiAchievement(this); this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); this.mcResourceManager.registerReloadListener(this.mcLanguageManager); this.refreshResources(); this.renderEngine = new TextureManager(this.mcResourceManager); this.mcResourceManager.registerReloadListener(this.renderEngine); this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.fileAssets); this.mcResourceManager.registerReloadListener(this.sndManager); this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); if (this.gameSettings.language != null) { this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode()); this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); } this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); this.mcResourceManager.registerReloadListener(this.fontRenderer); this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); LoaderDummyContainer.loadScreen("Start loading mods...", 0); FMLClientHandler.instance().beginMinecraftLoading(this, this.defaultResourcePacks, this.mcResourceManager); LoaderDummyContainer.loadScreen("Start loading recources...", 200); this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); RenderManager.instance.itemRenderer = new ItemRenderer(this); this.entityRenderer = new EntityRenderer(this); this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); this.mouseHelper = new MouseHelper(); this.checkGLError("Pre startup"); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glClearDepth(1.0D); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glCullFace(GL11.GL_BACK); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); this.checkGLError("Startup"); this.renderGlobal = new RenderGlobal(this); this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); FMLClientHandler.instance().finishMinecraftLoading(); this.checkGLError("Post startup"); this.ingameGUI = new GuiIngameForge(this); if (this.serverName != null) { this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); } else { this.displayGuiScreen(new GuiMainMenu()); } this.loadingScreen = new LoadingScreenRenderer(this); if (this.gameSettings.fullScreen && !this.fullscreen) { this.toggleFullscreen(); } FMLClientHandler.instance().onInitializationComplete(); LoaderDummyContainer.loadScreen("Complete loading mods...", 700); } Can you show me how to do this? @dude22072 I'm sorry but this | arg0.contains("net.minecraft.client.Minecraft") has no influence on that.
  2. Hi, i'm trying to program a new mod, which changes the way minecraft starts. It should show up a progressbar. So this mod has to be a coremod to, but i have some problem. I get this error: Unable to launch java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft at net.minecraft.client.main.Main.main(SourceFile:37) This happens right after this patch: @Override public byte[] transform(String arg0, String arg1, byte[] arg2) { if (arg0.equals("atv") | arg0.contains("net.minecraft.client.Minecraft")) { System.out.println("********* INSIDE OBFUSCATED MINECRAFTLOADER TRANSFORMER ABOUT TO PATCH: " + arg0); arg2 = patchClassInJar(arg0, arg2, arg0, LoaderPatchingLoader.location); } /*if (arg0.equals("aee") | arg0.contains("net.minecraft.world.chunk.storage.AnvilChunkLoader")) { System.out.println("********* INSIDE OBFUSCATED GENERATION TRANSFORMER ABOUT TO PATCH: " + arg0); arg2 = patchClassInJar(arg0, arg2, arg1, LoaderPatchingLoader.location); }*/ if (arg0.equals("cpw.mods.fml.common.LoadController")) { System.out.println("********* INSIDE OBFUSCATED MINECRAFTLOADER TRANSFORMER ABOUT TO PATCH: " + arg0); arg2 = patchClassInJar(arg0, arg2, arg1, LoaderPatchingLoader.location); } return arg2; } public byte[] patchClassInJar(String name, byte[] bytes, String ObfName, File location) { try { //open the jar as zip ZipFile zip = new ZipFile(location); //find the file inside the zip that is called te.class or net.minecraft.entity.monster.EntityCreeper.class //replacing the . to / so it would look for net/minecraft/entity/monster/EntityCreeper.class ZipEntry entry = zip.getEntry(name.replace('.', '/') + ".class"); if (entry == null) { System.out.println(name + " not found in " + location.getName()); } else { //serialize the class file into the bytes array InputStream zin = zip.getInputStream(entry); bytes = new byte[(int) entry.getSize()]; zin.read(bytes); zin.close(); System.out.println("[" + "MinecraftLoader" + "]: " + "Class " + name + " patched!"); } zip.close(); } catch (Exception e) { throw new RuntimeException("Error overriding " + name + " from " + location.getName(), e); } //return the new bytes return bytes; } Yes, i my file contains the atv.class file. Download this mod: https://www.dropbox.com/s/uhtzr9oql436hnh/MinecraftLoader%200.1%20mc1.6.4.jar This is not the first time for me working with this, but i don't know what i'm doing wrong, because it does obviously patch that file.
  3. I have a question. Does it makes to wait for 1.7.4 to update my Mod?
  4. Is there a very simple why to convert a file to a string? The File from CompressedStreamTools.
  5. I'm working on my mod CraftingManager. I programming a way to add new recipes. I save the recipes in the config file. I have to save the NBTData and that can only be a string.
  6. What? Of course i do, did you read my question?
  7. Oh i think you understood me wrong. I want to save the whole NBT Data in a string.
  8. Hi, is there a way to save the NBTData to a string and load it from? I know there is a method toString(), but a method to parse From String doesn't exit. Also the toString() method doesn't save the type of an entry. Is there a way to do it or should i do it on my own?
  9. No, my mod is working perfectly, but someone ask me if i could ask if this could be a standard feature of forge: http://www.minecraftforum.net/topic/1879772- You could actually add this in as a PR (Pull-Request, allows you to change Forge classes and submit the changes to go into the official source) for Forge, make it a bit easier for mods to do this. Would surely change Forge a lot, I'm looking for adding Retrogen ores (ores that generate after the world loads, aka ores that can generate in non-generated chunks) in my mod, so this would help .
  10. Ok, the World Generation Manager allows you to regenerate a specific mod but therefore i need the worldGenerators of the mods. So i edited the base class (GameRegistry). So it would be very cool if there is an event for this and that the worldGenerators are public. What i mean is that it's currently private static. So you have no access to it. If you could change it to public static, other ways that modders would have to make their on list (with the event when a worldgenerator is added). I hope you understand it :-)
  11. Hi, it would be very cool, if Forge could at a new event: OnWorldGenerator added and if they could change the worldgenerators from private to public because there is no way to get information out of the GameRegistry class. It would be very helpful for my mod World Generation Manager.
  12. There is no error, i just forget to set the default value. Thanks for everything.
  13. For some reason this doesn't work
  14. Yes, i used this tutorial, but i have to add a field to this class, and these tutorial only shows how to patch a method. So i have no idea how to do it and also no idea why there is an error?
  15. How do i use this, do you have an example?
  16. Yes, it would be incompatible, but how can i do this in another way?
  17. Nobody? Some more information Patching Code: Chunk.java: (It doesn't madder if this is modified, it also crashes with a vanilla one)
  18. Hi, i have a really difficult problem. I'm working on a core mod, but i can't patch the adq class. I have no idea why this is happening. Every other patch works perfect. I changed the Forge version, i tried to patch a normal chunk.class (from mcp), but it is always the same error. But if i patch the adq class directly out of the forge universal jar it works. Can anyone help? The error:
  19. @ILuvYouCompanionCube Sorry, that it takes me so long to answer: You already give me the solution to this problem, so i didn't understand why you still helped me. Thanks to all, for the fast and really god help.
  20. Hm, i think you understood me wrong, i have an idea how this could work, but i just have to try it out. This could take some time. But thanks for every help.
  21. Yes, i'm using it, but for regnerate the needed mods. I have no access to the NBTData of the chunk so i can't save the information in the chunks data. So far so good, i will have to try it out. Thanks for fast and good answers.
  22. First, you probadly think that I'm not so much experienced in programming, but i had just no clue about this specific topic. (Don't understand that wrong!!!!!!!!! ) So my mod RandomAdditions adds a new items physic, to see how it works just visit my mod topic. Therefore i only have to overwrite some methods, but for my second mod this isn't possible. It allows you to regenerate a mod's worldgenerator. So i have to edit GameRegistry and overwrite the method registerWorldGenerator and change the field worldgenerators to public (need it for other things). I also have to replace the class Chunk because i have to add a new field for the mods that were generated in it. The last methods are the onChunkLoad and onChunkUnload (or some thing like that) in the AnvilChunkLoader class. I hope i could give you a little overview about this problem.
  23. Thanks, i have only one question more, can i also edit or replace Forge Files? I will try it out, but i would be very good to know this.
  24. Hi, Is there i way to add a field to a base class? I read this tutorial http://www.minecraftforge.net/wiki/Using_Access_Transformers. The auhtor writes about editing field, but not adding a field. I'm not really in this topic, i just started, because since 1.6 jar mods are really hard to install. So i have to transform my both jar mods to core mods: http://www.minecraftforum.net/topic/1795185-162universalrandom-additions-v056-pillar-air-jump-jetpack-and-much-more-2000-downloads/#entry22245488 http://www.minecraftforum.net/topic/1879772-162-world-generation-manager-v02-regenerate-a-specific-mod/ Thanks previously
×
×
  • Create New...

Important Information

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