mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-04-05 08:03:13 +00:00
28 lines
729 B
Java
28 lines
729 B
Java
package com.sk89q.worldedit.shape;
|
|
|
|
import com.sk89q.worldedit.Vector;
|
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
|
import com.sk89q.worldedit.regions.Region;
|
|
import com.sk89q.worldedit.shape.ArbitraryShape;
|
|
|
|
/**
|
|
* Generates solid and hollow shapes according to materials returned by the
|
|
* {@link #getMaterial} method.
|
|
*
|
|
* @author TomyLobo
|
|
*/
|
|
public class RegionShape extends ArbitraryShape {
|
|
public RegionShape(Region extent) {
|
|
super(extent);
|
|
}
|
|
|
|
@Override
|
|
protected BaseBlock getMaterial(int x, int y, int z, BaseBlock defaultMaterial) {
|
|
if (!this.extent.contains(new Vector(x, y, z))) {
|
|
return null;
|
|
}
|
|
|
|
return defaultMaterial;
|
|
}
|
|
}
|