Add tracing feature to EditSessions (Upstream 1301) (#1112)

Co-authored-by: Octavia Togami <octavia.togami@gmail.com>
Co-authored-by: dordsor21 <dordsor21@gmail.com>
Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
Matt
2021-09-19 16:02:41 -04:00
committed by GitHub
parent f405994346
commit 4f68fb0e26
52 changed files with 1248 additions and 279 deletions

View File

@@ -19,18 +19,36 @@
package com.sk89q.worldedit;
import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.util.eventbus.EventBus;
import com.sk89q.worldedit.world.World;
import javax.annotation.Nullable;
/**
* Internal use only.
* Internal use only. Unused for now, but present in case upstream make it API.
*/
class TracedEditSession extends EditSession {
TracedEditSession(EventBus eventBus, World world, int maxBlocks, BlockBag blockBag, EditSessionEvent event) {
super(eventBus, world, maxBlocks, blockBag, event);
//FAWE start - does not work with FAWE's ways of doing things...
@Deprecated
//FAWE end
TracedEditSession(
EventBus eventBus, @Nullable World world, int maxBlocks, @Nullable BlockBag blockBag,
@Nullable Actor actor,
boolean tracing
) {
super(new EditSessionBuilder(eventBus)
.world(world)
.maxBlocks(maxBlocks)
.blockBag(blockBag)
.actor(actor)
.tracing(tracing));
}
TracedEditSession(EditSessionBuilder builder) {
super(builder);
}
private final Throwable stacktrace = new Throwable("Creation trace.");