- 397
- 8
- 33
Код:
public class generation_plants_wild implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId) {
case 0:
generateSurface(world, random, chunkX*16, chunkZ*16);
break;
}
}
private void generateSurface(World world, Random random, int x, int z) {
Block[] block_random = new Block[] {
};
if (world.getBiomeGenForCoords(x, z).biomeID == BiomeGenBase.forest.biomeID || world.getBiomeGenForCoords(x, z).biomeID == BiomeGenBase.forestHills.biomeID) {
for (int y = 0; y < world.provider.getHeight(); y++) {
int x1 = 8 + (x + random.nextInt(8));
int z1 = 8 + (z + random.nextInt(8));
if (world.getBlockId(x1, y - 1, z1) == Block.grass.blockID && world.isAirBlock(x1, y, z1)) {
for (int j = 0; j < 16; j++) {
world.setBlock(x1, y, z1, block_random[random.nextInt(block_random.length - 1)].blockID, random.nextInt(0), 3);
}
}
}
}
}
}
---- Minecraft Crash Report ----
// Surprise! Haha. Well, this is awkward.
Time: 01.03.15 15:58
Description: Exception in server tick loop
java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Unknown Source)
at assets.gothicmod.src.generation.generation_plants_wild.generateSurface(generation_plants_wild.java:42)
at assets.gothicmod.src.generation.generation_plants_wild.generate(generation_plants_wild.java:19)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:103)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1253)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:294)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.6.4
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.7.0_67, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 790957776 bytes (754 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
gothicmod{1.01} [GothicMod Minecraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 0 / 8; []
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
// Surprise! Haha. Well, this is awkward.
Time: 01.03.15 15:58
Description: Exception in server tick loop
java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Unknown Source)
at assets.gothicmod.src.generation.generation_plants_wild.generateSurface(generation_plants_wild.java:42)
at assets.gothicmod.src.generation.generation_plants_wild.generate(generation_plants_wild.java:19)
at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:103)
at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)
at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1253)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:294)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.6.4
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.7.0_67, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 790957776 bytes (754 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63
FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
gothicmod{1.01} [GothicMod Minecraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 0 / 8; []
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
Да, я очень криво все делаю, но в чем моя ошибка здесь?