2021-07-23 15:48:51 +00:00
|
|
|
package com.fastasyncworldedit.core.extent;
|
2020-09-14 10:20:26 +00:00
|
|
|
|
|
|
|
import com.sk89q.worldedit.extent.Extent;
|
|
|
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An extent that delegates actions to another extent that may change at any time.
|
|
|
|
*/
|
|
|
|
public class SupplyingExtent extends PassthroughExtent {
|
|
|
|
|
|
|
|
private final Supplier<Extent> extentSupplier;
|
|
|
|
|
|
|
|
public SupplyingExtent(Supplier<Extent> extentSupplier) {
|
|
|
|
super(extentSupplier.get());
|
|
|
|
this.extentSupplier = extentSupplier;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Extent getExtent() {
|
|
|
|
return this.extentSupplier.get();
|
|
|
|
}
|
2021-07-24 15:34:05 +00:00
|
|
|
|
2020-09-14 10:20:26 +00:00
|
|
|
}
|