Jump to content

ManIkWeet

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by ManIkWeet

  1. Reading the code a bit more, this seems to be true. Strange, that means that either the saving of a chunk happens REALLY fast (less than a millisecond), or does nothing at all...
  2. Hello, I want to generate a lot of chunks, and noticed that the saving is done through the event bus as idicated by the following code in AnvilChunkLoader: MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(par2Chunk, nbttagcompound)); As far as I understand, things in this EVENT_BUS don't happen right away, but I want it to happen right away so I don't run out of memory. So, how to force all the events in the EVENT_BUS?
  3. I wonder if I am doing something wrong or if this is a vanilla issue: I made a command that randomly generates 100 areas of 12x12 chunks, the more areas are made, the longer is takes to make an area? Perfect copy+paste to try it yourself: @EventHandler public void serverLoad(FMLServerStartingEvent event) { event.registerServerCommand(new RandomGenerateCommand()); } class RandomGenerateCommand implements ICommand { private final List aliases; public RandomGenerateCommand() { this.aliases = new ArrayList(); this.aliases.add("rgen"); this.aliases.add("randomgenerate"); } @Override public String getCommandName() { return "randomgenerate"; } @Override public String getCommandUsage(ICommandSender icommandsender) { return "/randomgenerate"; } @Override public List getCommandAliases() { return this.aliases; } @Override public void processCommand(ICommandSender icommandsender, String[] astring) { World worldObj = null;// = Minecraft.getMinecraft().theWorld; for (WorldServer ws : MinecraftServer.getServer().worldServers) { if (ws.provider.getDimensionName().equals("Overworld")) { worldObj = ws; break; } } if (worldObj != null && worldObj.getChunkProvider() instanceof ChunkProviderServer) { ChunkProviderServer cps = (ChunkProviderServer) worldObj.getChunkProvider(); Random r = new Random(); for (int loops = 0; loops < 100; loops++) { //lets generate 100 random chunk areas of 12x12 int randomX = r.nextInt(5000) >> 4; int randomZ = r.nextInt(5000) >> 4; List<Chunk> chunks = new ArrayList(); long startTime = System.currentTimeMillis(); for (int i = -1; i < 12; i++) {//-1 to make sure the 12x12 area is completely populated with trees/ores/etc for (int j = -1; j < 12; j++) {//-1 to make sure the 12x12 area is completely populated with trees/ores/etc Chunk chunk = worldObj.getChunkProvider().loadChunk(randomX + i, randomZ + j); chunks.add(chunk); } } for (Chunk c : chunks) { cps.unloadChunksIfNotNearSpawn(c.xPosition, c.zPosition); } cps.unloadQueuedChunks(); cps.unloadQueuedChunks();//unload twice because default minecraft has a limit of 100 chunks System.out.println("Done " + (loops + 1) + " out of 100 iterations of 12x12 chunk areas, took " + (((double) System.currentTimeMillis() - (double) startTime) / 1000d) + " seconds!"); } } } @Override public boolean canCommandSenderUseCommand(ICommandSender icommandsender) { return true; } @Override public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring) { return null; } @Override public boolean isUsernameIndex(String[] astring, int i) { return false; } @Override public int compareTo(Object o) { return 0; } } Just throw it at the bottom of a default mod main file, and get the imports An example output that I keep getting: 2014-06-13 12:35:27 [iNFO] [sTDOUT] Done 1 out of 100 iterations of 12x12 chunk areas, took 3.017 seconds! 2014-06-13 12:35:30 [iNFO] [sTDOUT] Done 2 out of 100 iterations of 12x12 chunk areas, took 3.662 seconds! 2014-06-13 12:35:34 [iNFO] [sTDOUT] Done 3 out of 100 iterations of 12x12 chunk areas, took 3.331 seconds! 2014-06-13 12:35:39 [iNFO] [sTDOUT] Done 4 out of 100 iterations of 12x12 chunk areas, took 5.328 seconds! 2014-06-13 12:35:44 [iNFO] [sTDOUT] Done 5 out of 100 iterations of 12x12 chunk areas, took 4.681 seconds! 2014-06-13 12:35:49 [iNFO] [sTDOUT] Done 6 out of 100 iterations of 12x12 chunk areas, took 5.419 seconds! 2014-06-13 12:35:54 [iNFO] [sTDOUT] Done 7 out of 100 iterations of 12x12 chunk areas, took 5.114 seconds! 2014-06-13 12:36:00 [iNFO] [sTDOUT] Done 8 out of 100 iterations of 12x12 chunk areas, took 5.776 seconds! 2014-06-13 12:36:06 [iNFO] [sTDOUT] Done 9 out of 100 iterations of 12x12 chunk areas, took 6.266 seconds! 2014-06-13 12:36:13 [iNFO] [sTDOUT] Done 10 out of 100 iterations of 12x12 chunk areas, took 6.909 seconds! 2014-06-13 12:36:21 [iNFO] [sTDOUT] Done 11 out of 100 iterations of 12x12 chunk areas, took 7.489 seconds! 2014-06-13 12:36:28 [iNFO] [sTDOUT] Done 12 out of 100 iterations of 12x12 chunk areas, took 7.517 seconds! 2014-06-13 12:36:36 [iNFO] [sTDOUT] Done 13 out of 100 iterations of 12x12 chunk areas, took 8.09 seconds! 2014-06-13 12:36:45 [iNFO] [sTDOUT] Done 14 out of 100 iterations of 12x12 chunk areas, took 8.892 seconds! 2014-06-13 12:36:55 [iNFO] [sTDOUT] Done 15 out of 100 iterations of 12x12 chunk areas, took 9.447 seconds! 2014-06-13 12:37:06 [iNFO] [sTDOUT] Done 16 out of 100 iterations of 12x12 chunk areas, took 11.165 seconds! 2014-06-13 12:37:16 [iNFO] [sTDOUT] Done 17 out of 100 iterations of 12x12 chunk areas, took 10.264 seconds! 2014-06-13 12:37:27 [iNFO] [sTDOUT] Done 18 out of 100 iterations of 12x12 chunk areas, took 10.723 seconds! 2014-06-13 12:37:38 [iNFO] [sTDOUT] Done 19 out of 100 iterations of 12x12 chunk areas, took 11.193 seconds! 2014-06-13 12:37:50 [iNFO] [sTDOUT] Done 20 out of 100 iterations of 12x12 chunk areas, took 11.688 seconds! 2014-06-13 12:38:01 [iNFO] [sTDOUT] Done 21 out of 100 iterations of 12x12 chunk areas, took 11.085 seconds! 2014-06-13 12:38:12 [iNFO] [sTDOUT] Done 22 out of 100 iterations of 12x12 chunk areas, took 11.476 seconds! 2014-06-13 12:38:24 [iNFO] [sTDOUT] Done 23 out of 100 iterations of 12x12 chunk areas, took 11.779 seconds! 2014-06-13 12:38:37 [iNFO] [sTDOUT] Done 24 out of 100 iterations of 12x12 chunk areas, took 12.761 seconds! 2014-06-13 12:38:49 [iNFO] [sTDOUT] Done 25 out of 100 iterations of 12x12 chunk areas, took 12.609 seconds! 2014-06-13 12:39:02 [iNFO] [sTDOUT] Done 26 out of 100 iterations of 12x12 chunk areas, took 12.666 seconds! 2014-06-13 12:39:15 [iNFO] [sTDOUT] Done 27 out of 100 iterations of 12x12 chunk areas, took 12.811 seconds! 2014-06-13 12:39:28 [iNFO] [sTDOUT] Done 28 out of 100 iterations of 12x12 chunk areas, took 13.095 seconds! 2014-06-13 12:39:42 [iNFO] [sTDOUT] Done 29 out of 100 iterations of 12x12 chunk areas, took 13.594 seconds! 2014-06-13 12:39:55 [iNFO] [sTDOUT] Done 30 out of 100 iterations of 12x12 chunk areas, took 13.82 seconds! 2014-06-13 12:40:10 [iNFO] [sTDOUT] Done 31 out of 100 iterations of 12x12 chunk areas, took 14.903 seconds! 2014-06-13 12:40:24 [iNFO] [sTDOUT] Done 32 out of 100 iterations of 12x12 chunk areas, took 13.493 seconds! 2014-06-13 12:40:38 [iNFO] [sTDOUT] Done 33 out of 100 iterations of 12x12 chunk areas, took 13.975 seconds! 2014-06-13 12:40:52 [iNFO] [sTDOUT] Done 34 out of 100 iterations of 12x12 chunk areas, took 13.926 seconds! 2014-06-13 12:41:06 [iNFO] [sTDOUT] Done 35 out of 100 iterations of 12x12 chunk areas, took 14.261 seconds! 2014-06-13 12:41:21 [iNFO] [sTDOUT] Done 36 out of 100 iterations of 12x12 chunk areas, took 14.7 seconds! 2014-06-13 12:41:35 [iNFO] [sTDOUT] Done 37 out of 100 iterations of 12x12 chunk areas, took 14.727 seconds! 2014-06-13 12:41:51 [iNFO] [sTDOUT] Done 38 out of 100 iterations of 12x12 chunk areas, took 15.55 seconds! 2014-06-13 12:42:08 [iNFO] [sTDOUT] Done 39 out of 100 iterations of 12x12 chunk areas, took 16.707 seconds! 2014-06-13 12:42:25 [iNFO] [sTDOUT] Done 40 out of 100 iterations of 12x12 chunk areas, took 17.356 seconds! 2014-06-13 12:42:43 [iNFO] [sTDOUT] Done 41 out of 100 iterations of 12x12 chunk areas, took 18.202 seconds! 2014-06-13 12:43:02 [iNFO] [sTDOUT] Done 42 out of 100 iterations of 12x12 chunk areas, took 18.464 seconds! 2014-06-13 12:43:20 [iNFO] [sTDOUT] Done 43 out of 100 iterations of 12x12 chunk areas, took 18.743 seconds! 2014-06-13 12:43:40 [iNFO] [sTDOUT] Done 44 out of 100 iterations of 12x12 chunk areas, took 19.21 seconds! So either I am overlooking something or vanilla minecraft has a serious leak when it comes to generating chunks... Please enlighten me
  4. You'd probably have to send a (custom) packed to the internal minecraft server that would then in response spawn the entity server-side
  5. Hi, I am working on making a command to generate chunks, currently I use the following code (stripped for ease): EntityPlayer player = (EntityPlayer) icommandsender; World worldObj = player.worldObj; ChunkProviderServer cps = (ChunkProviderServer) worldObj.getChunkProvider(); for (int i = 0; i < 100; ++i) { List<Chunk> chunks = new ArrayList<>(); for (int j = 0; j < 100; ++j) { Chunk chunk = worldObj.getChunkProvider().provideChunk(i, j); chunks.add(chunk); } for (Chunk c : chunks) { cps.unloadChunksIfNotNearSpawn(c.xPosition, c.zPosition); } cps.unloadQueuedChunks(); } When it's done executing, I get a bunch of: 2014-06-12 20:41:49 [WARNING] [Minecraft-Server] Memory connection overburdened; after processing 2500 packets, we still have 7809 to go! 2014-06-12 20:41:49 [WARNING] [Minecraft-Server] Memory connection overburdened; after processing 2500 packets, we still have 5308 to go! 2014-06-12 20:41:49 [WARNING] [Minecraft-Server] Memory connection overburdened; after processing 2500 packets, we still have 2808 to go! 2014-06-12 20:41:49 [WARNING] [Minecraft-Server] Memory connection overburdened; after processing 2500 packets, we still have 307 to go! Which indicates that during the generation some information is being sent to the client, so my question is basically: How to get the server load a chunk without sending it to the player executing the command? Edit: Just fixed the issue by not allowing a player to send the command, as it's not meant to be used in that way anyway.
  6. Yeah that is actually possible, Lex says that loading any chunk, will automatically generate it Well I went ahead and made my own mod to do it, getting close to done so I won't check out WorldBorder
  7. Hello, I want to unload a chunk that is created by the following: Chunk chunk = worldObj.getChunkFromChunkCoords(50, 50); I did try some methods but none of them seemed to unload the chunk. Preferably I want to unload the chunk in the same tick as I called whatever function unloads it. Thanks
  8. I prefer spending an hour or 2 pre-generating a world (on a more powerful CPU) than having a fully packed server lag horrible every time someone walks a bit faster than normal Also, I am actually working on making the mod myself...
  9. Hi, I want to make sure a chunk gets loaded, or generated if it doesn't exist. If I use the following, the chunk generates but there are no ores/trees/tallgrass/etc; there are caves and normal terrain: worldObj.getChunkProvider().loadChunk(chunkx, chunkz); How to do it right? Edit: Got it, maybe I should look at the functions before I ask next time For those interested: worldObj.getChunkProvider().loadChunk(chunkx, chunkz); worldObj.getChunkProvider().populate(null, chunkx, chunkz);
  10. Hello there, Is there a mod that allows you to (use a command) to pre-generate a world full of mods? I am currently using "Minecraft Land Generator" but it takes forever for the server to start with the ~150 mods. If this doesn't exist, how difficult would it be to make a mod that force-loads chunks and thus generates them? (Minecraft 1.6.4 by the way) Thanks in advance
  11. Modular Powersuits by MachineMuse already has 3d armor models. You can find the mod here. As far as I know it's open source too.
  12. Managed to fix it: Appearantly I needed to add "1.6.2.jar" to the libraries. Now the only thing missing is the nifty crafting bench icon for the window, I can live with that. Edit: There are no sounds, any clue on how to fix that? Edit2: I changed the working directory to "../../MinecraftCoderPack/forge/mcp/jars", everything works now.
  13. My setup: New project. Change Sources to /forge/mcp/src/minecraft/ Manually add all libraries. Run options: -Main Class: net.minecraft.launchwrapper.Launch -Arguments: --version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker - VM Options: -Djava.library.path="../../MinecraftCoderPack/forge/mcp/jars/versions/1.6.2/1.6.2-natives/" Minecraft opens up and then instantly crashes (the frame flashes), I get the following error: It looks like I am missing resources, but I have no clue how to add them.
×
×
  • Create New...

Important Information

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