mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
Implement SupplyingExtent (#613)
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
package com.boydti.fawe.object.extent;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.PassthroughExtent;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user