Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 08:02:50 +02:00
Ursprung
006ccd6887
Commit
2f6de996e3
@ -4,6 +4,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class ExtentTraverser<T extends Extent> {
|
||||
@ -24,6 +25,7 @@ public class ExtentTraverser<T extends Extent> {
|
||||
return root != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public T get() {
|
||||
return root;
|
||||
}
|
||||
@ -50,6 +52,7 @@ public class ExtentTraverser<T extends Extent> {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public <U> U findAndGet(Class<U> clazz) {
|
||||
ExtentTraverser<Extent> traverser = find(clazz);
|
||||
return (traverser != null) ? (U) traverser.get() : null;
|
||||
|
@ -529,10 +529,12 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
//FAWE start - ExtentTraverser & MaskingExtents
|
||||
MaskingExtent maskingExtent = new ExtentTraverser<>(getExtent()).findAndGet(MaskingExtent.class);
|
||||
if (maskingExtent == null) {
|
||||
ExtentTraverser<ExtentBatchProcessorHolder> processorExtent =
|
||||
new ExtentTraverser<>(getExtent()).find(ExtentBatchProcessorHolder.class);
|
||||
maskingExtent =
|
||||
new ProcessorTraverser<>(processorExtent.get().getProcessor()).find(MaskingExtent.class);
|
||||
ExtentBatchProcessorHolder processorExtent =
|
||||
new ExtentTraverser<>(getExtent()).findAndGet(ExtentBatchProcessorHolder.class);
|
||||
if (processorExtent != null) {
|
||||
maskingExtent =
|
||||
new ProcessorTraverser<>(processorExtent.getProcessor()).find(MaskingExtent.class);
|
||||
}
|
||||
}
|
||||
return maskingExtent != null ? maskingExtent.getMask() : null;
|
||||
//FAWE end
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren