neural networks fully set up for velocity

This commit is contained in:
batchprogrammer314
2021-07-23 03:47:11 -05:00
parent aa12ea0e71
commit 95be5d06a1
18 changed files with 396 additions and 204 deletions

View File

@@ -96,6 +96,21 @@ public class Debugger {
* DEBUGGER METHODS
*/
public void offsets(boolean b) {
Agent agent = TerminatorPlus.getInstance().getManager().getAgent();
if (!(agent instanceof LegacyAgent)) {
print("This method currently only supports " + ChatColor.AQUA + "LegacyAgent" + ChatColor.RESET + ".");
return;
}
LegacyAgent legacyAgent = (LegacyAgent) agent;
legacyAgent.offsets = b;
print("Bot target offsets are now "
+ (legacyAgent.offsets ? ChatColor.GREEN + "ENABLED" : ChatColor.RED + "DISABLED")
+ ChatColor.RESET + ".");
}
public void confuse(int n) {
if (!(sender instanceof Player)) return;

View File

@@ -3,12 +3,15 @@ package net.nuggetmc.ai.utils;
import org.bukkit.util.NumberConversions;
import org.bukkit.util.Vector;
import java.text.DecimalFormat;
import java.util.Random;
import java.util.Set;
public class MathUtils {
public static final Random RANDOM = new Random();
public static final DecimalFormat FORMATTER_1 = new DecimalFormat("0.#");
public static final DecimalFormat FORMATTER_2 = new DecimalFormat("0.##");
public static float[] fetchYawPitch(Vector dir) {
double x = dir.getX();
@@ -79,4 +82,12 @@ public class MathUtils {
public static double square(double n) {
return n * n;
}
public static String round1Dec(double n) {
return FORMATTER_1.format(n);
}
public static String round2Dec(double n) {
return FORMATTER_2.format(n);
}
}

View File

@@ -0,0 +1,13 @@
package net.nuggetmc.ai.utils;
import net.md_5.bungee.api.ChatColor;
public class StringUtilities {
public static final String ON = ChatColor.GREEN.toString();
public static final String OFF = ChatColor.GRAY.toString();
public static String trim16(String str) {
return str.length() > 16 ? str.substring(0, 16) : str;
}
}

View File

@@ -1,7 +0,0 @@
package net.nuggetmc.ai.utils;
public class StringUtils {
public static String trim16(String str) {
return str.length() > 16 ? str.substring(0, 16) : str;
}
}