I'm coding a small plugin that basically needs to do two things: Alter the size and rarity of natural spawning ore veins Whenever a vein is generated (I assume this is done by a BlockPopulator) retrieve and store the locations of the ore blocks. Is there an easy way to do this without writing my own generator from scratch?
You can write your own ore BlockPopulator and add it to the default generator. I don't think you can remove the default ore populator, though.
odd this plugin example gives me an error on /moon Code: 10:50:56 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'moon ' in plugin BukkitFullOfMoon v0.1.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:16 6) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:4 73) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler. java:821) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:33) at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:7 8) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452) at net.minecraft.server.ThreadServerApplication.run(SourceFile:490) Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.createWorld(Ljava/lang /String;Lorg/bukkit/World$Environment;Lorg/bukkit/generator/ChunkGenerator;)Lorg /bukkit/World; at com.dinnerbone.bukkit.moon.BukkitMoon.getMoon(BukkitMoon.java:38) at com.dinnerbone.bukkit.moon.MoonCommandExec.onCommand(MoonCommandExec. java:13) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 12 more
thanks for looking into it xpansive. Dinnerbone, I'd be eternally grateful if you could fix this little snafu.
Hi thanks for this but I've a problem. I searched on this topic if I could find how to generate mountains in my world generator. What I just want is generate small hills with a heigh difference of 5 or something, so yes really small smooth hills like the flatlands biome in minecraft. I tested the following code (the noice generator with the 'height' variable part); PHP: private NoiseGenerator generator; private NoiseGenerator getGenerator(World world) { if (generator == null) { generator = new SimplexNoiseGenerator(world); } return generator; } private int getHeight(World world, double x, double y, int variance) { NoiseGenerator gen = getGenerator(world); double result = gen.noise(x, y); result *= variance; return NoiseGenerator.floor(result); } public byte[] generate(World world, Random random, int cx, int cz) { byte[] result = new byte[32768]; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { int height = getHeight(world, cx + x * 0.0625, cz + z * 0.0625, 2) + 60; for (int y = 0; y < height; y++) { result[(x * 16 + z) * 128 + y] = (byte)Material.SPONGE.getId(); } } } return result; } but this doesn't look really smooth I want to spread it out to make it smoother but when I change some numbers in here; PHP: int height = getHeight(world, cx + x * 0.0625, cz + z * 0.0625, 2) + 60; it won't work too. Could anyone help me with a explenation for noice generators to generate smooth hills? That would be really cool! Thanks in advance, Tim Visée
I already found the solution. You could find the solution here; forums.bukkit.org/threads/how-to-generate-smooth-hills-for-my-world-generator.72145
I have been spinning around a problem that I think is actually buried in Bukkit. Specifically I was working on my CityWorld generator and was getting crazy NULL reference exception that I could not find. Eventually (about four hours later) I traced it down to the returning of certain Biomes via generateBlockSections. It seems that if you return SCRUBLAND eventually a null exception is thrown way down deep in Bukkit. From my glancing at the bukkit code via JD, it looks like the following biomes are not "referenced" in CraftBlock.class' static initializer... • ICE_DESERT • RAINFOREST • SAVANNA • SEASONAL_FOREST • SHRUBLAND • TUNDRA I might be wrong but not using those biomes definitely make things work better. I am heading over to post an official bug report but figured I would alert the fellow world generators of the potential issue. [BUG - https://bukkit.atlassian.net/browse/BUKKIT-1684]
Hmm, strange in my world generator (Dungeon Maze, released soon) I didn't have this problem, well I think, not sure. When I really don't have this problem I don't know what happend
Anyone found a way to do biomes? Notch promised to but only went over noise generators, then jtjj222 teased us with 5 extremely nice tutorials and then got too busy... Does ANYONE have the time and know how to do a tutorial on biomes?!?
Use the biomegrid object to set/get biome data from the chunk generator. Use World.getBlock().getBiome() (I think) from a block populator. I will write up a tutorial later today
Is there a way to make the world type "The End" with just a ChunkGenerator ? Im trying to make the first loaded world The End.
Hi, is it normal that I get a ton of compile errors with 1.5 API? There is no Event.Type, There is no WorldListener, There is no Event.Priority. How could one port this snippet to 1.5 API? Thanks in advance. Well I did it: Code: public void onEnable(){ PluginManager pm = this.getServer().getPluginManager(); pm.registerEvent(WorldInitEvent.class, new Listener (){}, EventPriority.NORMAL, new EventExecutor() { public void execute(Listener listener, Event event) throws EventException { WorldInitEvent initEvent = (WorldInitEvent) event; initEvent.getWorld().getPopulators().add(new MyPopulator()); getLogger().log(Level.FINEST, "injected MyPopulator"); } }, this); }
Are there any good tutorials out there for customized ore generation using Vanilla terrain generation? jtj222 mentioned something about block populators, but I feel like i need a written tutorial to get it down.
A word of warning, in case no-one has mentioned it as of 1.5 the plugin will reload when "/reload all" is called, but the populator isn't reloaed, so stored references to the plugin will become invalid, this is importat, if you need to shedule delated tasks
I have a problem with generating terrain, I've looked through the forums but with no results. I'm trying to create a generator that, for certain chunks, will use the original generator but for others I want to use my own generator. I was thinking of simply doing: Code: public byte[][] generateBlockSections(World world, Random random, int chunkX, int chunkZ, BiomeGrid biomeGrid) { if(...) { byte[][] result = new byte[world.getMaxHeight() / 16][]; ... // generate my own terrain return result; }else{ return defaultGenerator.generateBlockSections(world, random, chunkX, chunkZ, biomeGrid); // use default generator } } Where defaultGenerator is ChunkGenerator from the main world (normal generator) but it turns out that getGenerator method executed on world with default chunk generator returns null. Is there a way to pass certain chunks back to the default generator? Thanks