Replace sys out with logger factory

This commit is contained in:
N0tMyFaultOG 2020-10-08 20:52:02 +02:00
parent 6b37d678df
commit 0d89125a8e
4 changed files with 14 additions and 7 deletions

View File

@ -236,9 +236,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final PlotSquared plotSquared = new PlotSquared(this, "Bukkit");
if (PlotSquared.platform().getServerVersion()[1] < 13) {
System.out.println("You can't use this version of PlotSquared on a server less than Minecraft 1.13.2.");
System.out.println("Please check the download page for the link to the legacy versions.");
System.out.println("The server will now be shutdown to prevent any corruption.");
logger.info("You can't use this version of PlotSquared on a server less than Minecraft 1.13.2.");
logger.info("Please check the download page for the link to the legacy versions.");
logger.info("The server will now be shutdown to prevent any corruption.");
Bukkit.shutdown();
return;
}

View File

@ -1300,7 +1300,6 @@ public class PlotSquared {
String commitString = br.readLine();
String dateString = br.readLine();
this.version = PlotVersion.tryParse(versionString, commitString, dateString);
System.out.println("Version is " + this.version);
}
} catch (IOException throwable) {
throwable.printStackTrace();

View File

@ -32,11 +32,15 @@ import com.plotsquared.core.plot.flag.implementations.UseFlag;
import com.sk89q.worldedit.world.item.ItemType;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
public class FlagTest {
private static final Logger logger = LoggerFactory.getLogger("P2/" + FlagTest.class.getSimpleName());
private ItemType testBlock;
@Before public void setUp() throws Exception {
@ -50,11 +54,11 @@ public class FlagTest {
// //plot.setFlag(use, use.parseValue("33,33:1,6:4")); //TODO fix this so FlagTest will run during compile
// Optional<? extends Collection> flag = plot.getFlag(use);
// if (flag.isPresent()) {
// System.out.println(Flags.USE.valueToString(flag.get()));
// logger.info(Flags.USE.valueToString(flag.get()));
// testBlock = ItemTypes.BONE_BLOCK;
// flag.get().add(testBlock);
// }
// flag.ifPresent(collection -> System.out.println(Flags.USE.valueToString(collection)));
// flag.ifPresent(collection -> logger.info(Flags.USE.valueToString(collection)));
// Optional<Set<BlockType>> flag2 = plot.getFlag(Flags.USE);
// if (flag2.isPresent()) {
// // assertThat(flag2.get(), (Matcher<? super Set<BlockType>>) IsCollectionContaining.hasItem(testBlock));

View File

@ -27,13 +27,17 @@ package com.plotsquared.core.plot;
import com.plotsquared.core.PlotVersion;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PlotVersionTest {
private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotVersionTest.class.getSimpleName());
@Test public void tryParse() {
//These are all random values chosen to form the test class.
PlotVersion version = new PlotVersion("4.340", "f06903f", "19.08.05");
System.out.println(version.versionString);
logger.info(version.versionString);
}
}