Skip to content

Commit 2ece7b0

Browse files
committed
added config
1 parent 51f345b commit 2ece7b0

File tree

10 files changed

+16
-4
lines changed

10 files changed

+16
-4
lines changed

src/main/java/net/potato/tuff/TuffX.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class TuffX extends JavaPlugin implements Listener, PluginMessageListener
3939
public static final String CHANNEL = "eagler:below_y0";
4040
public ViaBlockIds viablockids;
4141

42-
private static final int CHUNKS_PER_TICK = 2;
42+
private static int CHUNKS_PER_TICK;
4343

4444
private final Map<UUID, Queue<Vector>> requestQueue = new ConcurrentHashMap<>();
4545

@@ -48,12 +48,18 @@ public class TuffX extends JavaPlugin implements Listener, PluginMessageListener
4848

4949
private BukkitTask processorTask;
5050

51+
private boolean debug;
52+
5153
private void logDebug(String message) {
52-
getLogger().log(Level.INFO, "[TuffX-Debug] " + message);
54+
if (debug) getLogger().log(Level.INFO, "[TuffX-Debug] " + message);
5355
}
5456

5557
@Override
5658
public void onEnable() {
59+
saveDefaultConfig();
60+
this.CHUNKS_PER_TICK = getConfig().getInt("chunks-per-tick", 6);
61+
this.debug = getConfig().getBoolean("debug-mode", false);
62+
5763
getServer().getMessenger().registerOutgoingPluginChannel(this, CHANNEL);
5864
getServer().getMessenger().registerIncomingPluginChannel(this, CHANNEL, this);
5965
getServer().getPluginManager().registerEvents(this, this);

src/main/resources/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
#no config
1+
#debug mode
2+
debug-mode: false
3+
#amount of chunks to send per tick to players
4+
chunks-per-tick: 6

target/TuffX.jar

298 Bytes
Binary file not shown.

target/classes/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
#no config
1+
#debug mode
2+
debug-mode: false
3+
#amount of chunks to send per tick to players
4+
chunks-per-tick: 6
0 Bytes
Binary file not shown.
30 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
377 Bytes
Binary file not shown.

target/original-TuffX.jar

298 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)