Fix compiling

This commit is contained in:
N0tMyFaultOG 2020-12-21 20:33:49 +01:00
parent 397692d113
commit 8c3a0a8275
No known key found for this signature in database
GPG Key ID: 823348042DA95A81
3 changed files with 57 additions and 50 deletions

View File

@ -75,6 +75,8 @@ import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.Storage; import com.plotsquared.core.configuration.Storage;
import com.plotsquared.core.configuration.caption.ChatFormatter;
import com.plotsquared.core.configuration.file.YamlConfiguration;
import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.generator.GeneratorWrapper; import com.plotsquared.core.generator.GeneratorWrapper;
import com.plotsquared.core.generator.IndependentPlotGenerator; import com.plotsquared.core.generator.IndependentPlotGenerator;
@ -984,8 +986,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
} }
return map; return map;
})); }));
metrics.addCustomChart(new Metrics.SimplePie("premium", metrics.addCustomChart(new Metrics.SimplePie("premium", () -> PremiumVerification.isPremium() ? "Premium" : "Non-Premium"));
() -> PremiumVerification.isPremium() ? "Premium" : "Non-Premium"));
metrics.addCustomChart(new Metrics.SimplePie("worlds", () -> Settings.Enabled_Components.WORLDS ? "true" : "false")); metrics.addCustomChart(new Metrics.SimplePie("worlds", () -> Settings.Enabled_Components.WORLDS ? "true" : "false"));
metrics.addCustomChart(new Metrics.SimplePie("economy", () -> Settings.Enabled_Components.ECONOMY ? "true" : "false")); metrics.addCustomChart(new Metrics.SimplePie("economy", () -> Settings.Enabled_Components.ECONOMY ? "true" : "false"));
metrics.addCustomChart(new Metrics.SimplePie("plot_expiry", () -> Settings.Enabled_Components.PLOT_EXPIRY ? "true" : "false")); metrics.addCustomChart(new Metrics.SimplePie("plot_expiry", () -> Settings.Enabled_Components.PLOT_EXPIRY ? "true" : "false"));

View File

@ -27,6 +27,7 @@ package com.plotsquared.core.command;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import com.google.inject.Inject;
import com.intellectualsites.paster.IncendoPaster; import com.intellectualsites.paster.IncendoPaster;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
@ -55,6 +56,15 @@ import java.util.concurrent.TimeUnit;
requiredType = RequiredType.NONE) requiredType = RequiredType.NONE)
public class DebugPaste extends SubCommand { public class DebugPaste extends SubCommand {
private final File configFile;
private final File worldfile;
@Inject public DebugPaste(@ConfigFile @Nonnull final File configFile,
@WorldFile @Nonnull final File worldFile) {
this.configFile = configFile;
this.worldfile = worldFile;
}
@Override public boolean onCommand(final PlotPlayer<?> player, String[] args) { @Override public boolean onCommand(final PlotPlayer<?> player, String[] args) {
TaskManager.runTaskAsync(() -> { TaskManager.runTaskAsync(() -> {
try { try {
@ -111,7 +121,8 @@ public class DebugPaste extends SubCommand {
if (Files.size(logFile.toPath()) > 14_000_000) { if (Files.size(logFile.toPath()) > 14_000_000) {
throw new IOException("The latest.log is larger than 14MB. Please reboot your server and submit a new paste."); throw new IOException("The latest.log is larger than 14MB. Please reboot your server and submit a new paste.");
} }
incendoPaster.addFile(logFile); incendoPaster
.addFile(logFile);
} catch (IOException ignored) { } catch (IOException ignored) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("debugpaste.latest_log"), TranslatableCaption.of("debugpaste.latest_log"),
@ -120,14 +131,13 @@ public class DebugPaste extends SubCommand {
} }
try { try {
incendoPaster.addFile(PlotSquared.get().configFile); incendoPaster.addFile(this.configFile);
} catch (final IllegalArgumentException ignored) {
incendoPaster.addFile(PlotSquared.get().worldsFile);
} catch (final IllegalArgumentException ignored) { } catch (final IllegalArgumentException ignored) {
player.sendMessage(TranslatableCaption.of("debugpaste.empty_file"), player.sendMessage(TranslatableCaption.of("debugpaste.empty_file"),
Template.of("file", "settings.yml")); Template.of("file", "settings.yml"));
} }
incendoPaster.addFile(PlotSquared.get().translationFile); try {
incendoPaster.addFile(this.worldfile);
} catch (final IllegalArgumentException ignored) { } catch (final IllegalArgumentException ignored) {
player.sendMessage(TranslatableCaption.of("debugpaste.empty_file"), player.sendMessage(TranslatableCaption.of("debugpaste.empty_file"),
Template.of("file", "worlds.yml")); Template.of("file", "worlds.yml"));

View File

@ -335,19 +335,15 @@ public abstract class SchematicHandler {
if (yy > 255) { if (yy > 255) {
continue; continue;
} }
for (int rz = zzb - p1z; rz <= (zzt - p1z); rz++) { for (int rz = 0; rz <= blockArrayClipboard.getDimensions().getZ(); rz++) {
for (int rx = xxb - p1x; rx <= (xxt - p1x); rx++) { for (int rx = 0; rx < blockArrayClipboard.getDimensions().getX(); rx++) {
int xx = p1x + rx; int xx = p1x + rx;
int zz = p1z + rz; int zz = p1z + rz;
BaseBlock id = blockArrayClipboard BaseBlock id = blockArrayClipboard.getFullBlock(BlockVector3.at(rx, ry, rz));
.getFullBlock(BlockVector3.at(rx, ry, rz));
queue.setBlock(xx, yy, zz, id); queue.setBlock(xx, yy, zz, id);
if (ry == 0) { if (ry == 0) {
BiomeType biome = BiomeType biome = blockArrayClipboard.getBiome(BlockVector3.at(rx, ry, rz));
blockArrayClipboard.getBiome(BlockVector2.at(rx, rz)); queue.setBiome(xx, yy, zz, biome);
queue.setBiome(xx, zz, biome);
}
}
} }
} }
} }