Cleanup unused code.

This commit is contained in:
MattBDev
2020-03-05 16:07:20 -05:00
parent 417cbd585f
commit 915ab43f6e
31 changed files with 192 additions and 358 deletions

View File

@ -1052,7 +1052,7 @@ public class BrushCommands {
tool.setFill(null);
tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission);
player.print("Set brush to " + factory);
player.print(TextComponent.of("Set brush to " + factory));
}
@Command(

View File

@ -161,11 +161,11 @@ public class ChunkCommands {
throw new StopExecutionException(TextComponent.of("Failed to write chunk list: " + e.getMessage()));
}
actor.print(String.format("%d chunk(s) have been marked for deletion the next time the server starts.",
newBatch.getChunkCount()));
actor.print(TextComponent.of(String.format("%d chunk(s) have been marked for deletion the next time the server starts.",
newBatch.getChunkCount())));
if (currentInfo.batches.size() > 1) {
actor.printDebug(String.format("%d chunks total marked for deletion. (May have overlaps).",
currentInfo.batches.stream().mapToInt(ChunkDeletionInfo.ChunkBatch::getChunkCount).sum()));
actor.printDebug(TextComponent.of(String.format("%d chunks total marked for deletion. (May have overlaps).",
currentInfo.batches.stream().mapToInt(ChunkDeletionInfo.ChunkBatch::getChunkCount).sum())));
}
actor.print(TextComponent.of("You can mark more chunks for deletion, or to stop now, run: ", TextColor.LIGHT_PURPLE)
.append(TextComponent.of("/stop", TextColor.AQUA)

View File

@ -182,7 +182,7 @@ public class HistorySubCommands {
RollbackDatabase db = DBHandler.IMP
.getDatabase(world);
db.logEdit(rollback);
actor.print("Logging: " + historyFile);
actor.print(TextComponent.of("Logging: " + historyFile));
}
}
} catch (IllegalArgumentException e) {
@ -192,7 +192,7 @@ public class HistorySubCommands {
}
}
}
actor.print("Done import!");
actor.print(TextComponent.of("Done import!"));
}
}
@ -289,7 +289,7 @@ public class HistorySubCommands {
return elem;
} else {
// TODO
return TextComponent.of("");
return TextComponent.empty();
}
}
});

View File

@ -27,7 +27,6 @@ import static com.sk89q.worldedit.regions.Regions.asFlatRegion;
import static com.sk89q.worldedit.regions.Regions.maximumBlockY;
import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.FaweCache;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.FaweLimit;
@ -71,7 +70,6 @@ import com.sk89q.worldedit.util.TreeGenerator.TreeType;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.ArrayList;
@ -132,7 +130,7 @@ public class RegionCommands {
@CommandPermissions("worldedit.region.test")
@Logging(REGION)
public void test(Player player, EditSession editSession, @Arg(desc = "test") double testValue) throws WorldEditException {
player.print("" + testValue);
player.print(TextComponent.of(testValue));
}
@Command(
@ -141,7 +139,7 @@ public class RegionCommands {
)
@CommandPermissions("worldedit.light.fix")
public void fixLighting(Player player) throws WorldEditException {
player.print("Temporarily not working");
player.print(TextComponent.of("Temporarily not working"));
// final Location loc = player.getLocation();
// Region selection = player.getSelection();
// if (selection == null) {
@ -162,7 +160,7 @@ public class RegionCommands {
final Location loc = player.getLocation();
int block = editSession.getBlockLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
int sky = editSession.getSkyLight(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
player.print("Light: " + block + " | " + sky);
player.print(TextComponent.of("Light: " + block + " | " + sky));
}
@Command(
@ -171,7 +169,7 @@ public class RegionCommands {
)
@CommandPermissions("worldedit.light.remove")
public void removeLighting(Player player) {
player.print("Temporarily not working");
player.print(TextComponent.of("Temporarily not working"));
// Region selection = player.getSelection();
// if (selection == null) {
// final int cx = player.getLocation().getBlockX() >> 4;
@ -196,7 +194,7 @@ public class RegionCommands {
}
CompoundTag nbt = editSession.getFullBlock(pos.toBlockPoint()).getNbtData();
if (nbt != null) {
player.print(nbt.getValue().toString());
player.print(TextComponent.of(nbt.getValue().toString()));
} else {
player.printError(TranslatableComponent.of("fawe.navigation.no.block"));
}
@ -208,7 +206,7 @@ public class RegionCommands {
)
@CommandPermissions("worldedit.light.set")
public void setlighting(Player player, EditSession editSession, @Selection Region region, @Range(from = 0, to = 15) int value) {
player.print("Temporarily not working");
player.print(TextComponent.of("Temporarily not working"));
}
@Command(
@ -217,7 +215,7 @@ public class RegionCommands {
)
@CommandPermissions("worldedit.light.set")
public void setskylighting(Player player, @Selection Region region, @Range(from = 0, to= 15) int value) {
player.print("Temporarily not working");
player.printInfo(TextComponent.of("Temporarily not working"));
}
@Command(

View File

@ -76,7 +76,7 @@ public class WorldEditCommands {
public void version(Actor actor) {
FaweVersion fVer = Fawe.get().getVersion();
String fVerStr = fVer == null ? "unknown" : "-" + fVer.build;
actor.print("FastAsyncWorldEdit" + fVerStr + " created by Empire92");
actor.print(TextComponent.of("FastAsyncWorldEdit" + fVerStr + " created by Empire92"));
if (fVer != null) {
FaweVersion version = Fawe.get().getVersion();
@ -170,7 +170,7 @@ public class WorldEditCommands {
name = "cui",
desc = "Complete CUI handshake (internal usage)"
)
@CommandPermissions({})
@CommandPermissions()
public void cui(Player player, LocalSession session) {
session.setCUISupport(true);
session.dispatchCUISetup(player);