Don't force load

didn't realize this loads the chunk, I just need to delay unloading until the operation is complete
This commit is contained in:
Jesse Boyd 2019-10-23 16:44:36 +01:00
parent a8df8a805f
commit 938dde68b2
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 32 additions and 18 deletions

View File

@ -64,17 +64,17 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
this.world = (CraftWorld) world;
this.X = X;
this.Z = Z;
if (forceLoad) {
this.world.getHandle().setForceLoaded(X, Z, this.forceLoad = true);
}
// if (forceLoad) {
// this.world.getHandle().setForceLoaded(X, Z, this.forceLoad = true);
// }
}
@Override
protected void finalize() {
if (forceLoad) {
this.world.getHandle().setForceLoaded(X, Z, forceLoad = false);
}
}
// @Override
// protected void finalize() {
// if (forceLoad) {
// this.world.getHandle().setForceLoaded(X, Z, forceLoad = false);
// }
// }
@Override
public BiomeType getBiomeType(int x, int z) {

View File

@ -12,6 +12,7 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.pattern.Pattern;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public abstract class Scroll implements ScrollTool {
@ -28,6 +29,13 @@ public abstract class Scroll implements ScrollTool {
TARGET
}
public static Scroll fromArguments(BrushTool tool, Player player, LocalSession session, String actionArgs, boolean message) {
String[] split = actionArgs.split(" ");
Action mode = Action.valueOf(split[0].toUpperCase());
List<String> args = Arrays.asList(Arrays.copyOfRange(split, 1, split.length));
return fromArguments(tool, player, session, mode, args, message);
}
public static com.boydti.fawe.object.brush.scroll.Scroll fromArguments(BrushTool tool, Player player, LocalSession session, Action mode, List<String> arguments, boolean message) throws InputParseException {
ParserContext parserContext = new ParserContext();
parserContext.setActor(player);

View File

@ -52,6 +52,7 @@ import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.formatting.component.ErrorFormat;
import com.sk89q.worldedit.util.formatting.component.PaginationBox;
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
@ -59,7 +60,6 @@ import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import com.sk89q.worldedit.util.io.Closer;
import com.sk89q.worldedit.util.io.file.FilenameException;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.enginehub.piston.annotation.Command;
import org.enginehub.piston.annotation.CommandContainer;
import org.enginehub.piston.annotation.param.Arg;
@ -649,7 +649,7 @@ public class SchematicCommands {
break;
}
TextComponent.Builder msg = TextComponent.builder();
TextComponentProducer msg = new TextComponentProducer();
msg.append(TextComponent.of(" - ", color));
@ -663,21 +663,27 @@ public class SchematicCommands {
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Add to clipboard"))));
}
if (type != UtilityCommands.URIType.DIRECTORY) {
msg.append(TextComponent.of("[X]", TextColor.DARK_RED).clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, delete + " " + path)));
msg.append(TextComponent.of("[X]", TextColor.DARK_RED)
.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, delete + " " + path))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("delete")))
);
} else if (hasShow) {
msg.append(TextComponent.of("[O]", TextColor.DARK_AQUA).clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, showCmd + " " + path)));
msg.append(TextComponent.of("[O]", TextColor.DARK_AQUA)
.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, showCmd + " " + path))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("visualize")))
);
}
TextComponent msgElem = TextComponent.of(name, color);
if (type != UtilityCommands.URIType.DIRECTORY) {
msgElem.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, loadSingle + " " + path))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Load")));
msgElem = msgElem.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, loadSingle + " " + path));
msgElem = msgElem.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Load")));
} else {
msgElem.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, list + " " + path))
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("List")));
msgElem = msgElem.clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, list + " " + path));
msgElem = msgElem.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("List")));
}
msg.append(msgElem);
return msg.build();
return msg.create();
}
});
PaginationBox paginationBox = PaginationBox.fromStrings("Available schematics", pageCommand, components);