mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 06:38:35 +00:00
Reimplement biome pattern (#681)
* Reimplement biome pattern * Improve suggestions and messages
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
package com.boydti.fawe.object.pattern;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
|
||||
public class BiomeApplyingPattern extends AbstractExtentPattern {
|
||||
private final BiomeType biomeType;
|
||||
|
||||
public BiomeApplyingPattern(Extent extent, BiomeType biomeType) {
|
||||
super(extent);
|
||||
this.biomeType = biomeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 position) {
|
||||
getExtent().setBiome(position, this.biomeType);
|
||||
// don't change the block, everything should remain the same
|
||||
return getExtent().getFullBlock(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
return extent.setBiome(set, this.biomeType);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user