Skip to content

Commit b8056f9

Browse files
committed
Remove debug messages
1 parent 16b4736 commit b8056f9

3 files changed

Lines changed: 19 additions & 40 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.countercraft.movecraft.coreprotect</groupId>
88
<artifactId>Movecraft-CoreProtect</artifactId>
9-
<version>0.1.0-a.1</version>
9+
<version>0.1.0-a.2</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Movecraft-CoreProtect</name>

src/main/java/net/countercraft/movecraft/coreprotect/movecraftcoreprotect/listeners/CraftDetectListener.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.bukkit.block.Block;
1313
import org.bukkit.block.BlockState;
1414
import org.bukkit.block.Sign;
15-
import org.bukkit.block.data.BlockData;
1615
import org.bukkit.event.EventHandler;
1716
import org.bukkit.event.EventPriority;
1817
import org.bukkit.event.Listener;
@@ -38,25 +37,15 @@ public void onCraftDetect(@NotNull CraftDetectEvent e) {
3837
Block block = loc.getBlock();
3938
BlockState state = block.getState();
4039

41-
if (Config.LOG_INTERACTIONS) {
42-
if (state instanceof Sign) {
43-
MovecraftCoreProtect.getInstance().getLogger().info("Found sign at " + movecraftLocation);
44-
Sign sign = (Sign) state;
45-
if (sign.getLine(0).equalsIgnoreCase(typeName) // First line is of the correct type
46-
|| (sign.getLine(0).equalsIgnoreCase("Subcraft Rotate") // Or first line is Subcraft Rotate
47-
&& sign.getLine(1).equalsIgnoreCase(typeName)) // And second line is the correct type
48-
|| sign.getLine(0).equalsIgnoreCase("Release")) { // Or first line is Release
49-
// Log interaction with sign
50-
if (!api.logInteraction(userName, loc))
51-
throw new RuntimeException(); // Throw an exception on failure to log
52-
}
53-
else {
54-
MovecraftCoreProtect.getInstance().getLogger().info(
55-
"Skipping sign\n\t- "
56-
+ movecraftLocation + "\n\t- "
57-
+ String.join("\n\t- ", sign.getLines())
58-
);
59-
}
40+
if (Config.LOG_INTERACTIONS && state instanceof Sign) {
41+
Sign sign = (Sign) state;
42+
if (sign.getLine(0).equalsIgnoreCase(typeName) // First line is of the correct type
43+
|| (sign.getLine(0).equalsIgnoreCase("Subcraft Rotate") // Or first line is Subcraft Rotate
44+
&& sign.getLine(1).equalsIgnoreCase(typeName)) // And second line is the correct type
45+
|| sign.getLine(0).equalsIgnoreCase("Release")) { // Or first line is Release
46+
// Log interaction with sign
47+
if (!api.logInteraction(userName, loc))
48+
throw new RuntimeException(); // Throw an exception on failure to log
6049
}
6150
}
6251
if (Config.LOG_BLOCKS) {

src/main/java/net/countercraft/movecraft/coreprotect/movecraftcoreprotect/listeners/CraftReleaseListener.java

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.bukkit.block.Block;
1313
import org.bukkit.block.BlockState;
1414
import org.bukkit.block.Sign;
15-
import org.bukkit.block.data.BlockData;
1615
import org.bukkit.event.EventHandler;
1716
import org.bukkit.event.EventPriority;
1817
import org.bukkit.event.Listener;
@@ -38,24 +37,15 @@ public void onCraftRelease(@NotNull CraftReleaseEvent e) {
3837
Block block = loc.getBlock();
3938
BlockState state = block.getState();
4039

41-
if (Config.LOG_INTERACTIONS) {
42-
if (state instanceof Sign) {
43-
Sign sign = (Sign) state;
44-
if (sign.getLine(0).equalsIgnoreCase(typeName) // First line is of the correct type
45-
|| (sign.getLine(0).equalsIgnoreCase("Subcraft Rotate") // Or first line is Subcraft Rotate
46-
&& sign.getLine(1).equalsIgnoreCase(typeName)) // And second line is the correct type
47-
|| sign.getLine(0).equalsIgnoreCase("Release")) { // Or first line is Release
48-
// Log interaction with sign
49-
if (!api.logInteraction(userName, loc))
50-
throw new RuntimeException(); // Throw an exception on failure to log
51-
}
52-
else {
53-
MovecraftCoreProtect.getInstance().getLogger().info(
54-
"Skipping sign\n\t- "
55-
+ movecraftLocation + "\n\t- "
56-
+ String.join("\n\t- ", sign.getLines())
57-
);
58-
}
40+
if (Config.LOG_INTERACTIONS && state instanceof Sign) {
41+
Sign sign = (Sign) state;
42+
if (sign.getLine(0).equalsIgnoreCase(typeName) // First line is of the correct type
43+
|| (sign.getLine(0).equalsIgnoreCase("Subcraft Rotate") // Or first line is Subcraft Rotate
44+
&& sign.getLine(1).equalsIgnoreCase(typeName)) // And second line is the correct type
45+
|| sign.getLine(0).equalsIgnoreCase("Release")) { // Or first line is Release
46+
// Log interaction with sign
47+
if (!api.logInteraction(userName, loc))
48+
throw new RuntimeException(); // Throw an exception on failure to log
5949
}
6050
}
6151
if (Config.LOG_BLOCKS) {

0 commit comments

Comments
 (0)