mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Implemented way for new values to be added to magic.yml, and fixed issues with block dropping
This commit is contained in:
1 parent
43682dd1a9
commit
356c6b882c
5 files changed
+181
-91
No files matched your search
@@ -226,16 +226,9 @@ public class PlayerListener extends EventListener
|
|||||||
public void onPlayerDropItem(PlayerDropItemEvent event)
|
public void onPlayerDropItem(PlayerDropItemEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (checkManager.willCheck(player, CheckType.ITEM_SPAM))
|
if (checkManager.willCheck(player, CheckType.ITEM_SPAM) && backend.checkFastDrop(player))
|
||||||
{
|
{
|
||||||
if (backend.justDroppedItem(player))
|
event.setCancelled(!config.silentMode());
|
||||||
{
|
|
||||||
event.setCancelled(!config.silentMode());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
backend.logDroppedItem(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,14 @@ import java.util.Map;
|
|||||||
import net.h31ix.anticheat.util.Distance;
|
import net.h31ix.anticheat.util.Distance;
|
||||||
import net.h31ix.anticheat.util.Magic;
|
import net.h31ix.anticheat.util.Magic;
|
||||||
import net.h31ix.anticheat.util.Utilities;
|
import net.h31ix.anticheat.util.Utilities;
|
||||||
|
import net.h31ix.anticheat.util.yaml.CommentedConfiguration;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -77,23 +79,24 @@ public class Backend
|
|||||||
private Map<String, Long> brokenBlock = new HashMap<String, Long>();
|
private Map<String, Long> brokenBlock = new HashMap<String, Long>();
|
||||||
private Map<String, Long> placedBlock = new HashMap<String, Long>();
|
private Map<String, Long> placedBlock = new HashMap<String, Long>();
|
||||||
private Map<String, Long> movingExempt = new HashMap<String, Long>();
|
private Map<String, Long> movingExempt = new HashMap<String, Long>();
|
||||||
private Map<String, Long> droppedItem = new HashMap<String, Long>();
|
private Map<String, Long> blockTime = new HashMap<String, Long>();
|
||||||
|
private Map<String, Integer> blocksDropped = new HashMap<String, Integer>();
|
||||||
|
|
||||||
private Magic magic;
|
private Magic magic;
|
||||||
private AnticheatManager micromanage = null;
|
private AnticheatManager micromanage = null;
|
||||||
|
|
||||||
public Backend(AnticheatManager instance)
|
public Backend(AnticheatManager instance)
|
||||||
{
|
{
|
||||||
magic = new Magic(instance.getConfiguration().getMagic());
|
magic = new Magic(instance.getConfiguration().getMagic(), instance.getConfiguration(), CommentedConfiguration.loadConfiguration(instance.getPlugin().getResource("magic.yml")));
|
||||||
micromanage = instance;
|
micromanage = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buildAdvancedInformation(StringBuilder r)
|
public void buildAdvancedInformation(StringBuilder r)
|
||||||
{
|
{
|
||||||
r.append("Dropped Items List:" + '\n');
|
//r.append("Dropped Items List:" + '\n');
|
||||||
for (String l : droppedItem.keySet())
|
//for (String l : droppedItem.keySet())
|
||||||
{
|
{
|
||||||
r.append(l + '\n');
|
//r.append(l + '\n');
|
||||||
}
|
}
|
||||||
r.append("Moving Exempt List:" + '\n');
|
r.append("Moving Exempt List:" + '\n');
|
||||||
for (String l : movingExempt.keySet())
|
for (String l : movingExempt.keySet())
|
||||||
@@ -160,7 +163,7 @@ public class Backend
|
|||||||
{
|
{
|
||||||
micromanage.getUserManager().remove(user);
|
micromanage.getUserManager().remove(user);
|
||||||
}
|
}
|
||||||
droppedItem.remove(pN);
|
//droppedItem.remove(pN);
|
||||||
movingExempt.remove(pN);
|
movingExempt.remove(pN);
|
||||||
brokenBlock.remove(pN);
|
brokenBlock.remove(pN);
|
||||||
placedBlock.remove(pN);
|
placedBlock.remove(pN);
|
||||||
@@ -227,6 +230,24 @@ public class Backend
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkFastDrop(Player player)
|
||||||
|
{
|
||||||
|
increment(player, blocksDropped, 10);
|
||||||
|
if (!blockTime.containsKey(player.getName()))
|
||||||
|
{
|
||||||
|
blockTime.put(player.getName(), System.currentTimeMillis());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if(blocksDropped.get(player.getName()) == magic.DROP_CHECK)
|
||||||
|
{
|
||||||
|
long time = System.currentTimeMillis()-blockTime.get(player.getName());
|
||||||
|
blockTime.remove(player.getName());
|
||||||
|
blocksDropped.remove(player.getName());
|
||||||
|
return time < magic.DROP_TIME_MIN;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean checkLongReachBlock(Player player, double x, double y, double z)
|
public boolean checkLongReachBlock(Player player, double x, double y, double z)
|
||||||
{
|
{
|
||||||
return (x >= magic.BLOCK_MAX_DISTANCE || y > magic.BLOCK_MAX_DISTANCE || z > magic.BLOCK_MAX_DISTANCE);
|
return (x >= magic.BLOCK_MAX_DISTANCE || y > magic.BLOCK_MAX_DISTANCE || z > magic.BLOCK_MAX_DISTANCE);
|
||||||
@@ -1099,16 +1120,6 @@ public class Backend
|
|||||||
return isMovingExempt(player) || justVelocity(player);
|
return isMovingExempt(player) || justVelocity(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logDroppedItem(final Player player)
|
|
||||||
{
|
|
||||||
droppedItem.put(player.getName(), System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean justDroppedItem(Player player)
|
|
||||||
{
|
|
||||||
return isDoing(player, droppedItem, magic.DROPPED_ITEM_TIME);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void logEvent(@SuppressWarnings("rawtypes") final Map map, final Player player, final Object obj, long time)
|
private void logEvent(@SuppressWarnings("rawtypes") final Map map, final Player player, final Object obj, long time)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -283,4 +283,16 @@ public class Configuration
|
|||||||
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void saveMagic(CommentedConfiguration newMagic)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
newMagic.save(magicFile);
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,10 @@
|
|||||||
|
|
||||||
package net.h31ix.anticheat.util;
|
package net.h31ix.anticheat.util;
|
||||||
|
|
||||||
|
import net.h31ix.anticheat.Anticheat;
|
||||||
|
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.
|
||||||
@@ -85,13 +88,21 @@ public class Magic
|
|||||||
*/
|
*/
|
||||||
public final int DROPPED_ITEM_TIME;
|
public final int DROPPED_ITEM_TIME;
|
||||||
/**
|
/**
|
||||||
* Time to wait in between firing a given number 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.
|
||||||
|
*/
|
||||||
|
public final int DROP_TIME_MIN;
|
||||||
|
/**
|
||||||
|
* Number of item drops to wait for before checking how long they took to drop; Type=integer.
|
||||||
|
*/
|
||||||
|
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.
|
||||||
*/
|
*/
|
||||||
@@ -301,71 +312,132 @@ public class Magic
|
|||||||
*/
|
*/
|
||||||
public final int SPEED_MAX;
|
public final int SPEED_MAX;
|
||||||
|
|
||||||
public Magic(FileConfiguration magic)
|
private FileConfiguration defaults;
|
||||||
|
private CommentedConfiguration magic;
|
||||||
|
private Configuration config;
|
||||||
|
|
||||||
|
public Magic(CommentedConfiguration magic, Configuration config, FileConfiguration defaults)
|
||||||
{
|
{
|
||||||
ENTERED_EXITED_TIME = magic.getInt("ENTERED_EXITED_TIME");
|
this.magic = magic;
|
||||||
SNEAK_TIME = magic.getInt("SNEAK_TIME");
|
this.config = config;
|
||||||
TELEPORT_TIME = magic.getInt("TELEPORT_TIME");
|
this.defaults = defaults;
|
||||||
EXIT_FLY_TIME = magic.getInt("EXIT_FLY_TIME");
|
|
||||||
JOIN_TIME = magic.getInt("JOIN_TIME");
|
//
|
||||||
INSTANT_BREAK_TIME = magic.getInt("INSTANT_BREAK_TIME");
|
|
||||||
DAMAGE_TIME = magic.getLong("DAMAGE_TIME");
|
ENTERED_EXITED_TIME = getInt("ENTERED_EXITED_TIME");
|
||||||
KNOCKBACK_DAMAGE_TIME = magic.getLong("KNOCKBACK_DAMAGE_TIME");
|
SNEAK_TIME = getInt("SNEAK_TIME");
|
||||||
EXPLOSION_DAMAGE_TIME = magic.getLong("EXPLOSION_DAMAGE_TIME");
|
TELEPORT_TIME = getInt("TELEPORT_TIME");
|
||||||
DROPPED_ITEM_TIME = magic.getInt("DROPPED_ITEM_TIME");
|
EXIT_FLY_TIME = getInt("EXIT_FLY_TIME");
|
||||||
PROJECTILE_TIME_MIN = magic.getInt("PROJECTILE_TIME_MIN");
|
JOIN_TIME = getInt("JOIN_TIME");
|
||||||
PROJECTILE_CHECK = magic.getInt("PROJECTILE_CHECK");
|
INSTANT_BREAK_TIME = getInt("INSTANT_BREAK_TIME");
|
||||||
FASTBREAK_LIMIT = magic.getInt("FASTBREAK_LIMIT");
|
DAMAGE_TIME = getLong("DAMAGE_TIME");
|
||||||
FASTBREAK_TIMEMAX = magic.getInt("FASTBREAK_TIMEMAX");
|
KNOCKBACK_DAMAGE_TIME = getLong("KNOCKBACK_DAMAGE_TIME");
|
||||||
FASTBREAK_MAXVIOLATIONS = magic.getInt("FASTBREAK_MAXVIOLATIONS");
|
EXPLOSION_DAMAGE_TIME = getLong("EXPLOSION_DAMAGE_TIME");
|
||||||
FASTBREAK_MAXVIOLATIONS_CREATIVE = magic.getInt("FASTBREAK_MAXVIOLATIONS_CREATIVE");
|
DROPPED_ITEM_TIME = getInt("DROPPED_ITEM_TIME");
|
||||||
FASTBREAK_MAXVIOLATIONTIME = magic.getInt("FASTBREAK_MAXVIOLATIONTIME");
|
PROJECTILE_TIME_MIN = getInt("PROJECTILE_TIME_MIN");
|
||||||
FASTPLACE_ZEROLIMIT = magic.getInt("FASTPLACE_ZEROLIMIT");
|
PROJECTILE_CHECK = getInt("PROJECTILE_CHECK");
|
||||||
FASTPLACE_TIMEMAX = magic.getInt("FASTPLACE_TIMEMAX");
|
DROP_TIME_MIN = getInt("DROP_TIME_MIN");
|
||||||
FASTPLACE_MAXVIOLATIONS = magic.getInt("FASTPLACE_MAXVIOLATIONS");
|
DROP_CHECK = getInt("DROP_CHECK");
|
||||||
FASTPLACE_MAXVIOLATIONS_CREATIVE = magic.getInt("FASTPLACE_MAXVIOLATIONS_CREATIVE");
|
FASTBREAK_LIMIT = getInt("FASTBREAK_LIMIT");
|
||||||
FASTPLACE_MAXVIOLATIONTIME = magic.getInt("FASTPLACE_MAXVIOLATIONTIME");
|
FASTBREAK_TIMEMAX = getInt("FASTBREAK_TIMEMAX");
|
||||||
BLOCK_PUNCH_MIN = magic.getInt("BLOCK_PUNCH_MIN");
|
FASTBREAK_MAXVIOLATIONS = getInt("FASTBREAK_MAXVIOLATIONS");
|
||||||
CHAT_WARN_LEVEL = magic.getInt("CHAT_WARN_LEVEL");
|
FASTBREAK_MAXVIOLATIONS_CREATIVE = getInt("FASTBREAK_MAXVIOLATIONS_CREATIVE");
|
||||||
CHAT_KICK_LEVEL = magic.getInt("CHAT_KICK_LEVEL");
|
FASTBREAK_MAXVIOLATIONTIME = getInt("FASTBREAK_MAXVIOLATIONTIME");
|
||||||
CHAT_BAN_LEVEL = magic.getInt("CHAT_BAN_LEVEL");
|
FASTPLACE_ZEROLIMIT = getInt("FASTPLACE_ZEROLIMIT");
|
||||||
FLIGHT_LIMIT = magic.getInt("FLIGHT_LIMIT");
|
FASTPLACE_TIMEMAX = getInt("FASTPLACE_TIMEMAX");
|
||||||
WATER_CLIMB_MAX = magic.getDouble("WATER_CLIMB_MAX");
|
FASTPLACE_MAXVIOLATIONS = getInt("FASTPLACE_MAXVIOLATIONS");
|
||||||
Y_MAXVIOLATIONS = magic.getInt("Y_MAXVIOLATIONS");
|
FASTPLACE_MAXVIOLATIONS_CREATIVE = getInt("FASTPLACE_MAXVIOLATIONS_CREATIVE");
|
||||||
Y_MAXVIOTIME = magic.getInt("Y_MAXVIOTIME");
|
FASTPLACE_MAXVIOLATIONTIME = getInt("FASTPLACE_MAXVIOLATIONTIME");
|
||||||
VELOCITY_TIME = magic.getInt("VELOCITY_TIME");
|
BLOCK_PUNCH_MIN = getInt("BLOCK_PUNCH_MIN");
|
||||||
VELOCITY_SCHETIME = magic.getLong("VELOCITY_SCHETIME");
|
CHAT_WARN_LEVEL = getInt("CHAT_WARN_LEVEL");
|
||||||
VELOCITY_CHECKTIME = magic.getLong("VELOCITY_CHECKTIME");
|
CHAT_KICK_LEVEL = getInt("CHAT_KICK_LEVEL");
|
||||||
VELOCITY_PREVENT = magic.getLong("VELOCITY_PREVENT");
|
CHAT_BAN_LEVEL = getInt("CHAT_BAN_LEVEL");
|
||||||
VELOCITY_MAXTIMES = magic.getInt("VELOCITY_MAXTIMES");
|
FLIGHT_LIMIT = getInt("FLIGHT_LIMIT");
|
||||||
NOFALL_LIMIT = magic.getInt("NOFALL_LIMIT");
|
WATER_CLIMB_MAX = getDouble("WATER_CLIMB_MAX");
|
||||||
ASCENSION_COUNT_MAX = magic.getInt("ASCENSION_COUNT_MAX");
|
Y_MAXVIOLATIONS = getInt("Y_MAXVIOLATIONS");
|
||||||
WATER_ASCENSION_VIOLATION_MAX = magic.getInt("WATER_ASCENSION_VIOLATION_MAX");
|
Y_MAXVIOTIME = getInt("Y_MAXVIOTIME");
|
||||||
WATER_SPEED_VIOLATION_MAX = magic.getInt("WATER_SPEED_VIOLATION_MAX");
|
VELOCITY_TIME = getInt("VELOCITY_TIME");
|
||||||
SPRINT_FOOD_MIN = magic.getInt("SPRINT_FOOD_MIN");
|
VELOCITY_SCHETIME = getLong("VELOCITY_SCHETIME");
|
||||||
ANIMATION_MIN = magic.getInt("ANIMATION_MIN");
|
VELOCITY_CHECKTIME = getLong("VELOCITY_CHECKTIME");
|
||||||
CHAT_MIN = magic.getInt("CHAT_MIN");
|
VELOCITY_PREVENT = getLong("VELOCITY_PREVENT");
|
||||||
CHAT_REPEAT_MIN = magic.getInt("CHAT_REPEAT_MIN");
|
VELOCITY_MAXTIMES = getInt("VELOCITY_MAXTIMES");
|
||||||
SPRINT_MIN = magic.getDouble("SPRINT_MIN");
|
NOFALL_LIMIT = getInt("NOFALL_LIMIT");
|
||||||
BLOCK_BREAK_MIN = magic.getDouble("BLOCK_BREAK_MIN");
|
ASCENSION_COUNT_MAX = getInt("ASCENSION_COUNT_MAX");
|
||||||
BLOCK_PLACE_MIN = magic.getDouble("BLOCK_PLACE_MIN");
|
WATER_ASCENSION_VIOLATION_MAX = getInt("WATER_ASCENSION_VIOLATION_MAX");
|
||||||
HEAL_TIME_MIN = magic.getLong("HEAL_TIME_MIN");
|
WATER_SPEED_VIOLATION_MAX = getInt("WATER_SPEED_VIOLATION_MAX");
|
||||||
EAT_TIME_MIN = magic.getLong("EAT_TIME_MIN");
|
SPRINT_FOOD_MIN = getInt("SPRINT_FOOD_MIN");
|
||||||
BOW_ERROR = magic.getDouble("BOW_ERROR");
|
ANIMATION_MIN = getInt("ANIMATION_MIN");
|
||||||
BLOCK_MAX_DISTANCE = magic.getDouble("BLOCK_MAX_DISTANCE");
|
CHAT_MIN = getInt("CHAT_MIN");
|
||||||
ENTITY_MAX_DISTANCE = magic.getDouble("ENTITY_MAX_DISTANCE");
|
CHAT_REPEAT_MIN = getInt("CHAT_REPEAT_MIN");
|
||||||
LADDER_Y_MAX = magic.getDouble("LADDER_Y_MAX");
|
SPRINT_MIN = getDouble("SPRINT_MIN");
|
||||||
LADDER_Y_MIN = magic.getDouble("LADDER_Y_MIN");
|
BLOCK_BREAK_MIN = getDouble("BLOCK_BREAK_MIN");
|
||||||
Y_SPEED_MAX = magic.getDouble("Y_SPEED_MAX");
|
BLOCK_PLACE_MIN = getDouble("BLOCK_PLACE_MIN");
|
||||||
Y_MAXDIFF = magic.getDouble("Y_MAXDIFF");
|
HEAL_TIME_MIN = getLong("HEAL_TIME_MIN");
|
||||||
Y_TIME = magic.getLong("Y_TIME ");
|
EAT_TIME_MIN = getLong("EAT_TIME_MIN");
|
||||||
XZ_SPEED_MAX = magic.getDouble("XZ_SPEED_MAX");
|
BOW_ERROR = getDouble("BOW_ERROR");
|
||||||
XZ_SPEED_MAX_SPRINT = magic.getDouble("XZ_SPEED_MAX_SPRINT");
|
BLOCK_MAX_DISTANCE = getDouble("BLOCK_MAX_DISTANCE");
|
||||||
XZ_SPEED_MAX_FLY = magic.getDouble("XZ_SPEED_MAX_FLY");
|
ENTITY_MAX_DISTANCE = getDouble("ENTITY_MAX_DISTANCE");
|
||||||
XZ_SPEED_MAX_POTION = magic.getDouble("XZ_SPEED_MAX_POTION");
|
LADDER_Y_MAX = getDouble("LADDER_Y_MAX");
|
||||||
XZ_SPEED_MAX_SNEAK = magic.getDouble("XZ_SPEED_MAX_SNEAK");
|
LADDER_Y_MIN = getDouble("LADDER_Y_MIN");
|
||||||
XZ_SPEED_MAX_WATER = magic.getDouble("XZ_SPEED_MAX_WATER");
|
Y_SPEED_MAX = getDouble("Y_SPEED_MAX");
|
||||||
XZ_SPEED_MAX_WATER_SPRINT = magic.getDouble("XZ_SPEED_MAX_WATER_SPRINT");
|
Y_MAXDIFF = getDouble("Y_MAXDIFF");
|
||||||
SPEED_MAX = magic.getInt("SPEED_MAX");
|
Y_TIME = getLong("Y_TIME");
|
||||||
|
XZ_SPEED_MAX = getDouble("XZ_SPEED_MAX");
|
||||||
|
XZ_SPEED_MAX_SPRINT = getDouble("XZ_SPEED_MAX_SPRINT");
|
||||||
|
XZ_SPEED_MAX_FLY = getDouble("XZ_SPEED_MAX_FLY");
|
||||||
|
XZ_SPEED_MAX_POTION = getDouble("XZ_SPEED_MAX_POTION");
|
||||||
|
XZ_SPEED_MAX_SNEAK = getDouble("XZ_SPEED_MAX_SNEAK");
|
||||||
|
XZ_SPEED_MAX_WATER = getDouble("XZ_SPEED_MAX_WATER");
|
||||||
|
XZ_SPEED_MAX_WATER_SPRINT = getDouble("XZ_SPEED_MAX_WATER_SPRINT");
|
||||||
|
SPEED_MAX = getInt("SPEED_MAX");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getInt(String path)
|
||||||
|
{
|
||||||
|
if(magic.contains(path))
|
||||||
|
{
|
||||||
|
return magic.getInt(path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i = defaults.getInt(path);
|
||||||
|
System.out.println("Loading "+path+" into magic");
|
||||||
|
System.out.println("DEFAULT: "+i);
|
||||||
|
magic.set(path, i);
|
||||||
|
config.saveMagic(magic);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getDouble(String path)
|
||||||
|
{
|
||||||
|
if(magic.contains(path))
|
||||||
|
{
|
||||||
|
return magic.getDouble(path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double i = defaults.getDouble(path);
|
||||||
|
magic.set(path, i);
|
||||||
|
config.saveMagic(magic);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getLong(String path)
|
||||||
|
{
|
||||||
|
if(magic.contains(path))
|
||||||
|
{
|
||||||
|
return magic.getLong(path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
long i = defaults.getLong(path);
|
||||||
|
magic.set(path, i);
|
||||||
|
config.saveMagic(magic);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,8 @@ KNOCKBACK_DAMAGE_TIME: 4000
|
|||||||
EXPLOSION_DAMAGE_TIME: 5000
|
EXPLOSION_DAMAGE_TIME: 5000
|
||||||
PROJECTILE_TIME_MIN: 1500
|
PROJECTILE_TIME_MIN: 1500
|
||||||
PROJECTILE_CHECK: 10
|
PROJECTILE_CHECK: 10
|
||||||
|
DROP_TIME_MIN: 800
|
||||||
|
DROP_CHECK: 10
|
||||||
FASTBREAK_LIMIT: 3
|
FASTBREAK_LIMIT: 3
|
||||||
FASTBREAK_TIMEMAX: 500
|
FASTBREAK_TIMEMAX: 500
|
||||||
FASTBREAK_MAXVIOLATIONS: 2
|
FASTBREAK_MAXVIOLATIONS: 2
|
||||||
|
|||||||
Reference in new issue
Block a user