Development Milestone:
Added max machine length setting to config.
This commit is contained in:
1 parent
698aceafc0
commit
18114e3064
3 files changed
+25
-4
No files matched your search
@@ -18,6 +18,24 @@ public class ConfigManager {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| max-machine-length
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static int getMaxMachineLength() {
|
||||
int configured = RSAuger.getInstance()
|
||||
.getConfig()
|
||||
.getInt("max-machine-length", 16);
|
||||
|
||||
if (configured < 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Math.min(configured, 16);
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| RELOAD
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rsscripting.rsauger.machine;
|
||||
|
||||
import com.rsscripting.rsauger.config.ConfigManager;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@@ -132,7 +133,7 @@ public class AugerValidator {
|
||||
|
||||
int length = 0;
|
||||
|
||||
while (length < 10) {
|
||||
while (length < ConfigManager.getMaxMachineLength()) {
|
||||
|
||||
Material type =
|
||||
current.getType();
|
||||
|
||||
Reference in new issue
Block a user