mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-03 11:56:40 +00:00
Add biome support
Add a BiomeTypes interface Add methods in ServerInterface to retrieve the implemented BiomeTypes Add a getBiome method to LocalWorld and subclasses Add /biomeinfo & /biomelist commands Add a BiomeTypeMask Closes #181
This commit is contained in:
26
src/main/java/com/sk89q/worldedit/spout/SpoutBiomeTypes.java
Normal file
26
src/main/java/com/sk89q/worldedit/spout/SpoutBiomeTypes.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.sk89q.worldedit.spout;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sk89q.worldedit.BiomeType;
|
||||
import com.sk89q.worldedit.BiomeTypes;
|
||||
import com.sk89q.worldedit.UnknownBiomeTypeException;
|
||||
|
||||
public class SpoutBiomeTypes implements BiomeTypes {
|
||||
|
||||
@Override
|
||||
public boolean has(String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeType get(String name) throws UnknownBiomeTypeException {
|
||||
throw new UnknownBiomeTypeException(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BiomeType> all() {
|
||||
return Collections.<BiomeType>emptyList();
|
||||
}
|
||||
}
|
@ -23,6 +23,7 @@ import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.minecraft.util.commands.CommandsManager;
|
||||
import com.sk89q.worldedit.LocalPlayer;
|
||||
import com.sk89q.worldedit.BiomeTypes;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.ServerInterface;
|
||||
import org.spout.api.Game;
|
||||
@ -40,10 +41,12 @@ public class SpoutServerInterface extends ServerInterface {
|
||||
public Game game;
|
||||
public WorldEditPlugin plugin;
|
||||
private final SpoutRawCommandExecutor executor;
|
||||
private SpoutBiomeTypes biomes;
|
||||
|
||||
public SpoutServerInterface(WorldEditPlugin plugin, Game game) {
|
||||
this.plugin = plugin;
|
||||
this.game = game;
|
||||
this.biomes = new SpoutBiomeTypes();
|
||||
this.executor = new SpoutRawCommandExecutor(plugin);
|
||||
}
|
||||
|
||||
@ -64,6 +67,11 @@ public class SpoutServerInterface extends ServerInterface {
|
||||
plugin.loadConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiomeTypes getBiomes() {
|
||||
return biomes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int schedule(long delay, long period, Runnable task) {
|
||||
return game.getScheduler().scheduleSyncRepeatingTask(plugin, task, delay, period);
|
||||
|
@ -19,12 +19,14 @@
|
||||
|
||||
package com.sk89q.worldedit.spout;
|
||||
|
||||
import com.sk89q.worldedit.BiomeType;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.EntityType;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -176,6 +178,16 @@ public class SpoutWorld extends LocalWorld {
|
||||
return world.getBlockMaterial(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getLightLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get biome type
|
||||
*
|
||||
* @param pt
|
||||
* @return
|
||||
*/
|
||||
public BiomeType getBiome(Vector2D pt) {
|
||||
return new BiomeType("Unknown");
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate an area.
|
||||
*
|
||||
|
Reference in New Issue
Block a user