mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Add max-projectile-speed option
Projectils can load chunks pretty intensively if too fast.
This commit is contained in:
parent
93d36779f0
commit
8bcef6022b
5 changed files with 19 additions and 2 deletions
|
@ -335,4 +335,6 @@ public interface ISettings extends IConf {
|
||||||
boolean logCommandBlockCommands();
|
boolean logCommandBlockCommands();
|
||||||
|
|
||||||
Set<Predicate<String>> getNickBlacklist();
|
Set<Predicate<String>> getNickBlacklist();
|
||||||
|
|
||||||
|
double getMaxProjectileSpeed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,6 +557,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
isSafeUsermap = _isSafeUsermap();
|
isSafeUsermap = _isSafeUsermap();
|
||||||
logCommandBlockCommands = _logCommandBlockCommands();
|
logCommandBlockCommands = _logCommandBlockCommands();
|
||||||
nickBlacklist = _getNickBlacklist();
|
nickBlacklist = _getNickBlacklist();
|
||||||
|
maxProjectileSpeed = _getMaxProjectileSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _lateLoadItemSpawnBlacklist() {
|
void _lateLoadItemSpawnBlacklist() {
|
||||||
|
@ -1611,4 +1612,15 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
public Set<Predicate<String>> getNickBlacklist() {
|
public Set<Predicate<String>> getNickBlacklist() {
|
||||||
return nickBlacklist;
|
return nickBlacklist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double maxProjectileSpeed;
|
||||||
|
|
||||||
|
private double _getMaxProjectileSpeed() {
|
||||||
|
return config.getDouble("max-projectile-speed", 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getMaxProjectileSpeed() {
|
||||||
|
return maxProjectileSpeed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,11 @@ public class Commandfireball extends EssentialsCommand {
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
try {
|
try {
|
||||||
speed = FloatUtil.parseDouble(args[1]);
|
speed = FloatUtil.parseDouble(args[1]);
|
||||||
|
speed = Double.max(0, Double.min(speed, ess.getSettings().getMaxProjectileSpeed()));
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length > 2 && args[2].equalsIgnoreCase("ride")) {
|
if (args.length > 2 && args[2].equalsIgnoreCase("ride") && user.isAuthorized("essentials.fireball.ride")) {
|
||||||
ride = true;
|
ride = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -614,6 +614,9 @@ sethome-multiple:
|
||||||
# change the compass' direction to point towards their first home.
|
# change the compass' direction to point towards their first home.
|
||||||
compass-towards-home-perm: false
|
compass-towards-home-perm: false
|
||||||
|
|
||||||
|
# Set the maximum speed for projectiles spawned with /fireball.
|
||||||
|
max-projectile-speed: 8
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
# | EssentialsEco | #
|
# | EssentialsEco | #
|
||||||
|
|
|
@ -2,5 +2,4 @@ package net.ess3.api;
|
||||||
|
|
||||||
|
|
||||||
public interface ISettings extends com.earth2me.essentials.ISettings {
|
public interface ISettings extends com.earth2me.essentials.ISettings {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue