diff options
3 files changed, 37 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index 3103c5e9..bb27d75c 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -10,7 +10,7 @@ import net.minecraft.server.WorldServer; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; -public class CustomChunkGenerator implements InternalChunkGenerator { +public class CustomChunkGenerator extends InternalChunkGenerator { private final ChunkGenerator generator; private final WorldServer world; private final long seed; diff --git a/src/main/java/org/bukkit/craftbukkit/generator/InternalChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/InternalChunkGenerator.java index d98c5e66..e5ee52b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/InternalChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/InternalChunkGenerator.java @@ -4,6 +4,6 @@ package org.bukkit.craftbukkit.generator; import net.minecraft.server.IChunkProvider; import org.bukkit.generator.ChunkGenerator; -public interface InternalChunkGenerator extends ChunkGenerator, IChunkProvider { +public abstract class InternalChunkGenerator extends ChunkGenerator implements IChunkProvider { } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java index 2e83fa5c..6ab09541 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/NormalChunkGenerator.java @@ -3,14 +3,19 @@ package org.bukkit.craftbukkit.generator; import java.util.ArrayList; import java.util.List; import java.util.Random; +import net.minecraft.server.Chunk; import net.minecraft.server.ChunkProviderGenerate; +import net.minecraft.server.IChunkProvider; +import net.minecraft.server.IProgressUpdate; import net.minecraft.server.World; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.generator.BlockPopulator; -public class NormalChunkGenerator extends ChunkProviderGenerate implements InternalChunkGenerator { +public class NormalChunkGenerator extends InternalChunkGenerator { + private final ChunkProviderGenerate provider; + public NormalChunkGenerator(World world, long seed) { - super(world, seed); + provider = new ChunkProviderGenerate(world, seed); } public byte[] generate(org.bukkit.World world, Random random, int x, int z) { @@ -24,4 +29,32 @@ public class NormalChunkGenerator extends ChunkProviderGenerate implements Inter public List<BlockPopulator> getDefaultPopulators(org.bukkit.World world) { return new ArrayList<BlockPopulator>(); } + + public boolean isChunkLoaded(int i, int i1) { + return provider.isChunkLoaded(i, i1); + } + + public Chunk getOrCreateChunk(int i, int i1) { + return provider.getOrCreateChunk(i, i1); + } + + public Chunk getChunkAt(int i, int i1) { + return provider.getChunkAt(i, i1); + } + + public void getChunkAt(IChunkProvider icp, int i, int i1) { + provider.getChunkAt(icp, i, i1); + } + + public boolean saveChunks(boolean bln, IProgressUpdate ipu) { + return provider.saveChunks(bln, ipu); + } + + public boolean unloadChunks() { + return provider.unloadChunks(); + } + + public boolean b() { + return provider.b(); + } } |