More work on the calibrator and respect mcMMO greenthumb events

This commit is contained in:
h31ix committed 2012-10-06 00:32:39 -04:00
1 parent 989540d73b
commit f43c152f16
4 files changed
+190 -79

No files matched your search

@@ -37,7 +37,7 @@ public class BlockListener extends EventListener
private final Backend backend = getBackend(); private final Backend backend = getBackend();
private final CheckManager checkManager = getCheckManager(); private final CheckManager checkManager = getCheckManager();
private final Configuration config = Anticheat.getManager().getConfiguration(); private final Configuration config = Anticheat.getManager().getConfiguration();
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onBlockDamage(BlockDamageEvent event) public void onBlockDamage(BlockDamageEvent event)
{ {
@@ -666,14 +666,14 @@ public class Backend
public boolean checkSwing(Player player, Block block) public boolean checkSwing(Player player, Block block)
{ {
if(!player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !(player.getInventory().getItemInHand().getType() == Material.SHEARS && block.getType() == Material.LEAVES)) if(!isInstantBreakExempt(player))
{ {
return !justAnimated(player); if(!player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !(player.getInventory().getItemInHand().getType() == Material.SHEARS && block.getType() == Material.LEAVES))
} {
else return !justAnimated(player);
{ }
return false;
} }
return false;
} }
public boolean checkFastBreak(Player player, Block block) public boolean checkFastBreak(Player player, Block block)
@@ -2,12 +2,16 @@ package net.h31ix.anticheat.util;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
public class Calibrator implements Listener public class Calibrator implements Listener
{ {
@@ -20,8 +24,11 @@ public class Calibrator implements Listener
private long [] longs = new long[10]; private long [] longs = new long[10];
private double [] doubles = new double[10]; private double [] doubles = new double[10];
private int [] ints = new int[10]; private int [] ints = new int[10];
private int times = 0;
// Value-specific calculations // Value-specific calculations
private long projectileTime;
private long dropItemTime;
private long punchAvg; private long punchAvg;
private double blockBreakMax; private double blockBreakMax;
private double blockPlaceMax; private double blockPlaceMax;
@@ -38,6 +45,16 @@ public class Calibrator implements Listener
switch(step) switch(step)
{ {
case 0: case 0:
sendStep();
player.getInventory().setItemInHand(new ItemStack(Material.BOW));
player.getInventory().addItem(new ItemStack(Material.ARROW, 64));
player.sendMessage("Fire arrows as fast as possible (don't pull all the way back)");
break;
case 2:
player.getInventory().clear();
player.getInventory().setItemInHand(new ItemStack(Material.DIRT, 64));
player.sendMessage("Drop items as fast as possible.");
/*case 0:
sendStep(); sendStep();
player.sendMessage("Spam the left mouse button as fast as possible."); player.sendMessage("Spam the left mouse button as fast as possible.");
break; break;
@@ -47,7 +64,7 @@ public class Calibrator implements Listener
break; break;
case 3: case 3:
player.sendMessage("Place blocks from as far away as you can possibly get from them."); player.sendMessage("Place blocks from as far away as you can possibly get from them.");
break; break;*/
} }
} }
@@ -84,10 +101,19 @@ public class Calibrator implements Listener
{ {
longs[i] = 0; longs[i] = 0;
} }
for(int i =0;i<ints.length;i++)
{
ints[i] = 0;
}
for(int i =0;i<doubles.length;i++) for(int i =0;i<doubles.length;i++)
{ {
doubles[i] = 0; doubles[i] = 0;
} }
lastInt = 0;
lastDouble = 0;
lastLong = 0;
times = 0;
} }
private void sendStep() private void sendStep()
@@ -96,7 +122,8 @@ public class Calibrator implements Listener
player.sendMessage(ChatColor.GREEN+"Step "+step+"/"+TOTAL); player.sendMessage(ChatColor.GREEN+"Step "+step+"/"+TOTAL);
} }
private void getAvgLong(long avg) // Find the average time it takes to do a task
private long getAvgLong()
{ {
int count = getLongCount(); int count = getLongCount();
if(count < 10) if(count < 10)
@@ -113,20 +140,23 @@ public class Calibrator implements Listener
} }
else else
{ {
long avg = 0;
for(long l : longs) for(long l : longs)
{ {
avg+=l; avg+=l;
} }
lastLong = 0;
clear(); clear();
avg/=10; avg/=10;
player.sendMessage(ChatColor.AQUA+"Done. Average calculated at "+ChatColor.WHITE+avg); player.sendMessage(ChatColor.AQUA+"Done. Average calculated at "+ChatColor.WHITE+avg);
sendStep(); sendStep();
calibrate(); calibrate();
return avg;
} }
return -1;
} }
private void getMaxDouble(double max, double length) // Find the maximum time it takes to do a task
private double getMaxDouble(double length)
{ {
int count = getDoubleCount(); int count = getDoubleCount();
System.out.println(count); System.out.println(count);
@@ -136,6 +166,7 @@ public class Calibrator implements Listener
} }
else else
{ {
double max = 0;
for(double d : doubles) for(double d : doubles)
{ {
if(max == 0 || d > max) if(max == 0 || d > max)
@@ -147,41 +178,128 @@ public class Calibrator implements Listener
player.sendMessage(ChatColor.AQUA+"Done. Maximum calculated at "+ChatColor.WHITE+max); player.sendMessage(ChatColor.AQUA+"Done. Maximum calculated at "+ChatColor.WHITE+max);
sendStep(); sendStep();
calibrate(); calibrate();
return max;
} }
return -1;
}
// Get the absolute time it takes to do something X times
private long getAbsoluteLong()
{
int count = getLongCount();
if(count < 10)
{
if(lastLong == 0)
{
lastLong = System.currentTimeMillis();
}
else
{
longs[count] = System.currentTimeMillis();
lastLong = System.currentTimeMillis();
}
}
else
{
long val = longs[9]-longs[0];
clear();
player.sendMessage(ChatColor.AQUA+"Done. Value calculated at "+ChatColor.WHITE+val);
sendStep();
calibrate();
return val;
}
return -1;
} }
// Begin event listeners // Begin event listeners
@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event)
{
if(event.getPlayer() == player)
{
if(step == 2)
{
long v = getAbsoluteLong();
if(v != -1)
{
dropItemTime = v;
}
}
}
}
@EventHandler
public void onEntityShootBow(EntityShootBowEvent event)
{
if(event.getEntity() instanceof Player && ((Player)event.getEntity()) == player)
{
if(step == 1)
{
long v = getAbsoluteLong();
if(v != -1)
{
projectileTime = v;
}
}
}
}
@EventHandler @EventHandler
public void onPlayerInteract(PlayerInteractEvent event) public void onPlayerInteract(PlayerInteractEvent event)
{ {
if(step == 1) if(event.getPlayer() == player)
{ {
getAvgLong(punchAvg); if(step == -1)
{
long v = getAvgLong();
if(v != -1)
{
punchAvg = v;
}
}
else if(step == 1)
{
}
} }
} }
@EventHandler @EventHandler
public void onBlockBreak(BlockBreakEvent event) public void onBlockBreak(BlockBreakEvent event)
{ {
if(step == 2) if(event.getPlayer() == player)
{ {
double lengthX = Math.abs(event.getBlock().getX()-event.getPlayer().getLocation().getX()); if(step == -1)
double lengthZ = Math.abs(event.getBlock().getZ()-event.getPlayer().getLocation().getZ()); {
getMaxDouble(blockBreakMax, lengthX >= lengthZ ? lengthX : lengthZ); double lengthX = Math.abs(event.getBlock().getX()-event.getPlayer().getLocation().getX());
double lengthZ = Math.abs(event.getBlock().getZ()-event.getPlayer().getLocation().getZ());
double v = getMaxDouble(lengthX >= lengthZ ? lengthX : lengthZ);
if(v != -1)
{
blockBreakMax = v;
}
}
} }
} }
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent event) public void onBlockPlace(BlockPlaceEvent event)
{ {
if(step == 3) if(event.getPlayer() == player)
{ {
double lengthX = Math.abs(event.getBlock().getX()-event.getPlayer().getLocation().getX()); if(step == -1)
double lengthZ = Math.abs(event.getBlock().getZ()-event.getPlayer().getLocation().getZ()); {
getMaxDouble(blockPlaceMax, lengthX >= lengthZ ? lengthX : lengthZ); double lengthX = Math.abs(event.getBlock().getX()-event.getPlayer().getLocation().getX());
double lengthZ = Math.abs(event.getBlock().getZ()-event.getPlayer().getLocation().getZ());
double v = getMaxDouble(lengthX >= lengthZ ? lengthX : lengthZ);
if(v != -1)
{
blockPlaceMax = v;
}
}
} }
} }
} }
@@ -18,17 +18,15 @@
package net.h31ix.anticheat.util; package net.h31ix.anticheat.util;
import net.h31ix.anticheat.Anticheat;
import net.h31ix.anticheat.util.yaml.CommentedConfiguration; import net.h31ix.anticheat.util.yaml.CommentedConfiguration;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
/** /**
* Magic number class. Modifications to values in magic.yml will be accepted here. * Magic number class. Modifications to values in magic.yml will be accepted here.
* <p> * <p>
* Note that although each value is documented, changing it may have unintended side-effects. For instance, setting something to 0 that the plugin then uses as a dividend will result in an error. * Note that although each value is documented, changing it may have unintended side-effects. For instance, setting something to 0 that the plugin then uses as a dividend will result in an error.
* <br> * <br>
* Also realize that the smaller a value is, the less you should change it; it's probably small for a reason. The larger a value is, the safer it is to probably change it. * Also realize that the smaller a value is, the less you should change it; it's probably small for a reason. The larger a value is, the safer it is to probably change it.
* <p> * <p>
* <b>How to read the value documentation:</b> * <b>How to read the value documentation:</b>
* <br> * <br>
@@ -49,7 +47,7 @@ public class Magic
{ {
/** /**
* Time to exempt a player from moving because of entering/exiting a vehicle; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of entering/exiting a vehicle; Type=system, +Leniency=Increase.
*/ */
public final int ENTERED_EXITED_TIME; public final int ENTERED_EXITED_TIME;
/** /**
* Time to exempt a player from moving because of entering/exiting sneak mode; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of entering/exiting sneak mode; Type=system, +Leniency=Increase.
@@ -65,15 +63,15 @@ public class Magic
public final int EXIT_FLY_TIME; public final int EXIT_FLY_TIME;
/** /**
* Time to exempt a player from moving because of joining the server; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of joining the server; Type=system, +Leniency=Increase.
*/ */
public final int JOIN_TIME; public final int JOIN_TIME;
/** /**
* Time to exempt a player from fastbreak check because of using instant break; Type=seconds, +Leniency=Increase. * Time to exempt a player from fastbreak check because of using instant break; Type=seconds, +Leniency=Increase.
*/ */
public final int INSTANT_BREAK_TIME; public final int INSTANT_BREAK_TIME;
/** /**
* Time to exempt a player from moving because of taking damage; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of taking damage; Type=system, +Leniency=Increase.
*/ */
public final long DAMAGE_TIME; public final long DAMAGE_TIME;
/** /**
* Time to exempt a player from moving because of taking damage with knockback effects; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of taking damage with knockback effects; Type=system, +Leniency=Increase.
@@ -81,75 +79,71 @@ public class Magic
public final long KNOCKBACK_DAMAGE_TIME; public final long KNOCKBACK_DAMAGE_TIME;
/** /**
* Time to exempt a player from moving because of taking damage from an explosion; Type=system, +Leniency=Increase. * Time to exempt a player from moving because of taking damage from an explosion; Type=system, +Leniency=Increase.
*/
public final long EXPLOSION_DAMAGE_TIME;
/**
* Time to wait in between item drops; Type=system, +Leniency=Decrease.
*/ */
public final int DROPPED_ITEM_TIME; public final long EXPLOSION_DAMAGE_TIME;
/** /**
* Minimum time it takes to fire X projectiles; Type=system, +Leniency=Decrease. * Minimum time it takes to fire X projectiles; Type=system, +Leniency=Decrease.
*/ */
public final int PROJECTILE_TIME_MIN; public final int PROJECTILE_TIME_MIN;
/** /**
* Number of projectiles to wait for before checking how long they took to fire off; Type=integer. * Number of projectiles to wait for before checking how long they took to fire off; Type=integer.
*/ */
public final int PROJECTILE_CHECK; public final int PROJECTILE_CHECK;
/** /**
* Minimum time it takes to drop X items; Type=system, +Leniency=Decrease. * Minimum time it takes to drop X items; Type=system, +Leniency=Decrease.
*/ */
public final int DROP_TIME_MIN; public final int DROP_TIME_MIN;
/** /**
* Number of item drops to wait for before checking how long they took to drop; Type=integer. * Number of item drops to wait for before checking how long they took to drop; Type=integer.
*/ */
public final int DROP_CHECK; public final int DROP_CHECK;
/** /**
* Max number of blocks that can be broken in a given time; Type=integer, +Leniency=Increase. * Max number of blocks that can be broken in a given time; Type=integer, +Leniency=Increase.
*/ */
public final int FASTBREAK_LIMIT; public final int FASTBREAK_LIMIT;
/** /**
* Time to wait before checking block breaks; Type=system, +Leniency=Increase. * Time to wait before checking block breaks; Type=system, +Leniency=Increase.
*/ */
public final int FASTBREAK_TIMEMAX; public final int FASTBREAK_TIMEMAX;
/** /**
* Number of times fastbreak can be observed before taking action; Type=integer, +Leniency=Increase. * Number of times fastbreak can be observed before taking action; Type=integer, +Leniency=Increase.
*/ */
public final int FASTBREAK_MAXVIOLATIONS; public final int FASTBREAK_MAXVIOLATIONS;
/** /**
* Number of times fastbreak can be observed before taking action in creative mode; Type=integer, +Leniency=Increase. * Number of times fastbreak can be observed before taking action in creative mode; Type=integer, +Leniency=Increase.
*/ */
public final int FASTBREAK_MAXVIOLATIONS_CREATIVE; public final int FASTBREAK_MAXVIOLATIONS_CREATIVE;
/** /**
* Time a player is forced to wait after fastbreak has been detected; Type=system, +Leniency=Decrease. * Time a player is forced to wait after fastbreak has been detected; Type=system, +Leniency=Decrease.
*/ */
public final int FASTBREAK_MAXVIOLATIONTIME; public final int FASTBREAK_MAXVIOLATIONTIME;
/** /**
* Number of blocks that can be broken without being hit before taking action; Type=integer, +Leniency=Increase. * Number of blocks that can be broken without being hit before taking action; Type=integer, +Leniency=Increase.
*/ */
public final int FASTPLACE_ZEROLIMIT; public final int FASTPLACE_ZEROLIMIT;
/** /**
* Time to wait before checking block places; Type=system, +Leniency=Increase. * Time to wait before checking block places; Type=system, +Leniency=Increase.
*/ */
public final int FASTPLACE_TIMEMAX; public final int FASTPLACE_TIMEMAX;
/** /**
* Number of times fastplace can be observed before taking action; Type=integer, +Leniency=Increase. * Number of times fastplace can be observed before taking action; Type=integer, +Leniency=Increase.
*/ */
public final int FASTPLACE_MAXVIOLATIONS; public final int FASTPLACE_MAXVIOLATIONS;
/** /**
* Number of times fastplace can be observed before taking action in creative mode; Type=integer, +Leniency=Increase. * Number of times fastplace can be observed before taking action in creative mode; Type=integer, +Leniency=Increase.
*/ */
public final int FASTPLACE_MAXVIOLATIONS_CREATIVE; public final int FASTPLACE_MAXVIOLATIONS_CREATIVE;
/** /**
* Time a player is forced to wait after fastplace has been detected; Type=system, +Leniency=Decrease. * Time a player is forced to wait after fastplace has been detected; Type=system, +Leniency=Decrease.
*/ */
public final int FASTPLACE_MAXVIOLATIONTIME; public final int FASTPLACE_MAXVIOLATIONTIME;
/** /**
* Number of times required to punch a block before it breaks; Type=integer, +Leniency=Decrease. * Number of times required to punch a block before it breaks; Type=integer, +Leniency=Decrease.
*/ */
public final int BLOCK_PUNCH_MIN; public final int BLOCK_PUNCH_MIN;
/** /**
* Number of chat spam violations before a player is warned; Type=integer, +Leniency=Increase. * Number of chat spam violations before a player is warned; Type=integer, +Leniency=Increase.
*/ */
public final int CHAT_WARN_LEVEL; public final int CHAT_WARN_LEVEL;
/** /**
* Number of chat spam violations before a player is kicked; Type=integer, +Leniency=Increase. * Number of chat spam violations before a player is kicked; Type=integer, +Leniency=Increase.
@@ -181,7 +175,7 @@ public class Magic
public final int VELOCITY_TIME; public final int VELOCITY_TIME;
/** /**
* Time used to schedule increasing a players velocity count - probably not touching this would be good; Type=integer. * Time used to schedule increasing a players velocity count - probably not touching this would be good; Type=integer.
*/ */
public final long VELOCITY_SCHETIME; public final long VELOCITY_SCHETIME;
/** /**
* Maximum time a player is considered to have a change in velocity; Type=system, +Leniency=Increase. * Maximum time a player is considered to have a change in velocity; Type=system, +Leniency=Increase.
@@ -310,39 +304,38 @@ public class Magic
/** /**
* Maximum times a player can fail the speed check before action is taken; Type=integer, +Leniency=Increase. * Maximum times a player can fail the speed check before action is taken; Type=integer, +Leniency=Increase.
*/ */
public final int SPEED_MAX; public final int SPEED_MAX;
private FileConfiguration defaults; private FileConfiguration defaults;
private CommentedConfiguration magic; private CommentedConfiguration magic;
private Configuration config; private Configuration config;
public Magic(CommentedConfiguration magic, Configuration config, FileConfiguration defaults) public Magic(CommentedConfiguration magic, Configuration config, FileConfiguration defaults)
{ {
this.magic = magic; this.magic = magic;
this.config = config; this.config = config;
this.defaults = defaults; this.defaults = defaults;
// //
ENTERED_EXITED_TIME = getInt("ENTERED_EXITED_TIME"); ENTERED_EXITED_TIME = getInt("ENTERED_EXITED_TIME");
SNEAK_TIME = getInt("SNEAK_TIME"); SNEAK_TIME = getInt("SNEAK_TIME");
TELEPORT_TIME = getInt("TELEPORT_TIME"); TELEPORT_TIME = getInt("TELEPORT_TIME");
EXIT_FLY_TIME = getInt("EXIT_FLY_TIME"); EXIT_FLY_TIME = getInt("EXIT_FLY_TIME");
JOIN_TIME = getInt("JOIN_TIME"); JOIN_TIME = getInt("JOIN_TIME");
INSTANT_BREAK_TIME = getInt("INSTANT_BREAK_TIME"); INSTANT_BREAK_TIME = getInt("INSTANT_BREAK_TIME");
DAMAGE_TIME = getLong("DAMAGE_TIME"); DAMAGE_TIME = getLong("DAMAGE_TIME");
KNOCKBACK_DAMAGE_TIME = getLong("KNOCKBACK_DAMAGE_TIME"); KNOCKBACK_DAMAGE_TIME = getLong("KNOCKBACK_DAMAGE_TIME");
EXPLOSION_DAMAGE_TIME = getLong("EXPLOSION_DAMAGE_TIME"); EXPLOSION_DAMAGE_TIME = getLong("EXPLOSION_DAMAGE_TIME");
DROPPED_ITEM_TIME = getInt("DROPPED_ITEM_TIME"); PROJECTILE_TIME_MIN = getInt("PROJECTILE_TIME_MIN");
PROJECTILE_TIME_MIN = getInt("PROJECTILE_TIME_MIN"); PROJECTILE_CHECK = getInt("PROJECTILE_CHECK");
PROJECTILE_CHECK = getInt("PROJECTILE_CHECK"); DROP_TIME_MIN = getInt("DROP_TIME_MIN");
DROP_TIME_MIN = getInt("DROP_TIME_MIN"); DROP_CHECK = getInt("DROP_CHECK");
DROP_CHECK = getInt("DROP_CHECK"); FASTBREAK_LIMIT = getInt("FASTBREAK_LIMIT");
FASTBREAK_LIMIT = getInt("FASTBREAK_LIMIT"); FASTBREAK_TIMEMAX = getInt("FASTBREAK_TIMEMAX");
FASTBREAK_TIMEMAX = getInt("FASTBREAK_TIMEMAX");
FASTBREAK_MAXVIOLATIONS = getInt("FASTBREAK_MAXVIOLATIONS"); FASTBREAK_MAXVIOLATIONS = getInt("FASTBREAK_MAXVIOLATIONS");
FASTBREAK_MAXVIOLATIONS_CREATIVE = getInt("FASTBREAK_MAXVIOLATIONS_CREATIVE"); FASTBREAK_MAXVIOLATIONS_CREATIVE = getInt("FASTBREAK_MAXVIOLATIONS_CREATIVE");
FASTBREAK_MAXVIOLATIONTIME = getInt("FASTBREAK_MAXVIOLATIONTIME"); FASTBREAK_MAXVIOLATIONTIME = getInt("FASTBREAK_MAXVIOLATIONTIME");
FASTPLACE_ZEROLIMIT = getInt("FASTPLACE_ZEROLIMIT"); FASTPLACE_ZEROLIMIT = getInt("FASTPLACE_ZEROLIMIT");
FASTPLACE_TIMEMAX = getInt("FASTPLACE_TIMEMAX"); FASTPLACE_TIMEMAX = getInt("FASTPLACE_TIMEMAX");
FASTPLACE_MAXVIOLATIONS = getInt("FASTPLACE_MAXVIOLATIONS"); FASTPLACE_MAXVIOLATIONS = getInt("FASTPLACE_MAXVIOLATIONS");
@@ -356,7 +349,7 @@ public class Magic
WATER_CLIMB_MAX = getDouble("WATER_CLIMB_MAX"); WATER_CLIMB_MAX = getDouble("WATER_CLIMB_MAX");
Y_MAXVIOLATIONS = getInt("Y_MAXVIOLATIONS"); Y_MAXVIOLATIONS = getInt("Y_MAXVIOLATIONS");
Y_MAXVIOTIME = getInt("Y_MAXVIOTIME"); Y_MAXVIOTIME = getInt("Y_MAXVIOTIME");
VELOCITY_TIME = getInt("VELOCITY_TIME"); VELOCITY_TIME = getInt("VELOCITY_TIME");
VELOCITY_SCHETIME = getLong("VELOCITY_SCHETIME"); VELOCITY_SCHETIME = getLong("VELOCITY_SCHETIME");
VELOCITY_CHECKTIME = getLong("VELOCITY_CHECKTIME"); VELOCITY_CHECKTIME = getLong("VELOCITY_CHECKTIME");
VELOCITY_PREVENT = getLong("VELOCITY_PREVENT"); VELOCITY_PREVENT = getLong("VELOCITY_PREVENT");
@@ -389,9 +382,9 @@ public class Magic
XZ_SPEED_MAX_SNEAK = getDouble("XZ_SPEED_MAX_SNEAK"); XZ_SPEED_MAX_SNEAK = getDouble("XZ_SPEED_MAX_SNEAK");
XZ_SPEED_MAX_WATER = getDouble("XZ_SPEED_MAX_WATER"); XZ_SPEED_MAX_WATER = getDouble("XZ_SPEED_MAX_WATER");
XZ_SPEED_MAX_WATER_SPRINT = getDouble("XZ_SPEED_MAX_WATER_SPRINT"); XZ_SPEED_MAX_WATER_SPRINT = getDouble("XZ_SPEED_MAX_WATER_SPRINT");
SPEED_MAX = getInt("SPEED_MAX"); SPEED_MAX = getInt("SPEED_MAX");
} }
private int getInt(String path) private int getInt(String path)
{ {
if(magic.contains(path)) if(magic.contains(path))
@@ -406,7 +399,7 @@ public class Magic
return i; return i;
} }
} }
private double getDouble(String path) private double getDouble(String path)
{ {
if(magic.contains(path)) if(magic.contains(path))
@@ -421,7 +414,7 @@ public class Magic
return i; return i;
} }
} }
private long getLong(String path) private long getLong(String path)
{ {
if(magic.contains(path)) if(magic.contains(path))
@@ -435,7 +428,7 @@ public class Magic
config.saveMagic(magic); config.saveMagic(magic);
return i; return i;
} }
} }
} }