mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Replace sys out with logger factory
This commit is contained in:
parent
6b37d678df
commit
0d89125a8e
@ -236,9 +236,9 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
final PlotSquared plotSquared = new PlotSquared(this, "Bukkit");
|
final PlotSquared plotSquared = new PlotSquared(this, "Bukkit");
|
||||||
|
|
||||||
if (PlotSquared.platform().getServerVersion()[1] < 13) {
|
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.");
|
logger.info("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.");
|
logger.info("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("The server will now be shutdown to prevent any corruption.");
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1300,7 +1300,6 @@ public class PlotSquared {
|
|||||||
String commitString = br.readLine();
|
String commitString = br.readLine();
|
||||||
String dateString = br.readLine();
|
String dateString = br.readLine();
|
||||||
this.version = PlotVersion.tryParse(versionString, commitString, dateString);
|
this.version = PlotVersion.tryParse(versionString, commitString, dateString);
|
||||||
System.out.println("Version is " + this.version);
|
|
||||||
}
|
}
|
||||||
} catch (IOException throwable) {
|
} catch (IOException throwable) {
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
|
@ -32,11 +32,15 @@ import com.plotsquared.core.plot.flag.implementations.UseFlag;
|
|||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
public class FlagTest {
|
public class FlagTest {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger("P2/" + FlagTest.class.getSimpleName());
|
||||||
|
|
||||||
private ItemType testBlock;
|
private ItemType testBlock;
|
||||||
|
|
||||||
@Before public void setUp() throws Exception {
|
@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
|
// //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);
|
// Optional<? extends Collection> flag = plot.getFlag(use);
|
||||||
// if (flag.isPresent()) {
|
// if (flag.isPresent()) {
|
||||||
// System.out.println(Flags.USE.valueToString(flag.get()));
|
// logger.info(Flags.USE.valueToString(flag.get()));
|
||||||
// testBlock = ItemTypes.BONE_BLOCK;
|
// testBlock = ItemTypes.BONE_BLOCK;
|
||||||
// flag.get().add(testBlock);
|
// 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);
|
// Optional<Set<BlockType>> flag2 = plot.getFlag(Flags.USE);
|
||||||
// if (flag2.isPresent()) {
|
// if (flag2.isPresent()) {
|
||||||
// // assertThat(flag2.get(), (Matcher<? super Set<BlockType>>) IsCollectionContaining.hasItem(testBlock));
|
// // assertThat(flag2.get(), (Matcher<? super Set<BlockType>>) IsCollectionContaining.hasItem(testBlock));
|
||||||
|
@ -27,13 +27,17 @@ package com.plotsquared.core.plot;
|
|||||||
|
|
||||||
import com.plotsquared.core.PlotVersion;
|
import com.plotsquared.core.PlotVersion;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class PlotVersionTest {
|
public class PlotVersionTest {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotVersionTest.class.getSimpleName());
|
||||||
|
|
||||||
@Test public void tryParse() {
|
@Test public void tryParse() {
|
||||||
//These are all random values chosen to form the test class.
|
//These are all random values chosen to form the test class.
|
||||||
PlotVersion version = new PlotVersion("4.340", "f06903f", "19.08.05");
|
PlotVersion version = new PlotVersion("4.340", "f06903f", "19.08.05");
|
||||||
System.out.println(version.versionString);
|
logger.info(version.versionString);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user