mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
Fix for generator stuff now being class
This commit is contained in:
parent
fedcbdf256
commit
d40c690c8f
3 changed files with 37 additions and 4 deletions
|
@ -10,7 +10,7 @@ import net.minecraft.server.WorldServer;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
|
||||||
public class CustomChunkGenerator implements InternalChunkGenerator {
|
public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||||
private final ChunkGenerator generator;
|
private final ChunkGenerator generator;
|
||||||
private final WorldServer world;
|
private final WorldServer world;
|
||||||
private final long seed;
|
private final long seed;
|
||||||
|
|
|
@ -4,6 +4,6 @@ package org.bukkit.craftbukkit.generator;
|
||||||
import net.minecraft.server.IChunkProvider;
|
import net.minecraft.server.IChunkProvider;
|
||||||
import org.bukkit.generator.ChunkGenerator;
|
import org.bukkit.generator.ChunkGenerator;
|
||||||
|
|
||||||
public interface InternalChunkGenerator extends ChunkGenerator, IChunkProvider {
|
public abstract class InternalChunkGenerator extends ChunkGenerator implements IChunkProvider {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,19 @@ package org.bukkit.craftbukkit.generator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import net.minecraft.server.Chunk;
|
||||||
import net.minecraft.server.ChunkProviderGenerate;
|
import net.minecraft.server.ChunkProviderGenerate;
|
||||||
|
import net.minecraft.server.IChunkProvider;
|
||||||
|
import net.minecraft.server.IProgressUpdate;
|
||||||
import net.minecraft.server.World;
|
import net.minecraft.server.World;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
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) {
|
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) {
|
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) {
|
public List<BlockPopulator> getDefaultPopulators(org.bukkit.World world) {
|
||||||
return new ArrayList<BlockPopulator>();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue