2018-08-12 14:03:07 +00:00
|
|
|
package com.boydti.fawe.object.mask;
|
|
|
|
|
|
|
|
import com.sk89q.worldedit.function.mask.AbstractMask;
|
|
|
|
import com.sk89q.worldedit.function.mask.Mask2D;
|
2018-12-23 16:19:33 +00:00
|
|
|
import com.sk89q.worldedit.math.BlockVector3;
|
|
|
|
|
2018-08-12 14:03:07 +00:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restricts the
|
|
|
|
*/
|
|
|
|
public class XAxisMask extends AbstractMask implements ResettableMask {
|
|
|
|
|
|
|
|
private transient int layer = -1;
|
|
|
|
|
|
|
|
@Override
|
2018-12-23 16:19:33 +00:00
|
|
|
public boolean test(BlockVector3 vector) {
|
2018-08-12 14:03:07 +00:00
|
|
|
if (layer == -1) {
|
|
|
|
layer = vector.getBlockX();
|
|
|
|
}
|
|
|
|
return vector.getBlockX() == layer;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void reset() {
|
|
|
|
this.layer = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public Mask2D toMask2D() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|