mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-06 06:06:40 +00:00
Removal of Lombok
Lombok implementation removal. I have also gone through and replaced things with inline methods and variables, lambdas, and simplified loops down, removed unnecessary guard clauses, and overall cleaned up every single class. This took a long time, please do remember to follow proper naming conventions, don't include unnecessary guard clauses, follow exception rules and comment rules, and please PLEASE remember to use the DIAMOND OPERATOR rather than just inferring RAW TYPES!!! Thank you!!
This commit is contained in:
@ -14,8 +14,18 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
public class Command_deafen extends FreedomCommand
|
||||
{
|
||||
|
||||
private static final Random random = new Random();
|
||||
public static final double STEPS = 10.0;
|
||||
private static final Random random = new Random();
|
||||
|
||||
private static Location randomOffset(Location a)
|
||||
{
|
||||
return a.clone().add(randomDoubleRange() * 5.0, randomDoubleRange() * 5.0, randomDoubleRange() * 5.0);
|
||||
}
|
||||
|
||||
private static Double randomDoubleRange()
|
||||
{
|
||||
return -1.0 + (random.nextDouble() * ((1.0 - -1.0) + 1.0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
@ -30,7 +40,7 @@ public class Command_deafen extends FreedomCommand
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
playerSender.playSound(randomOffset(playerSender.getLocation(), 5.0), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch);
|
||||
playerSender.playSound(randomOffset(playerSender.getLocation()), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch);
|
||||
}
|
||||
}.runTaskLater(plugin, Math.round(20.0 * percent * 2.0));
|
||||
}
|
||||
@ -38,14 +48,4 @@ public class Command_deafen extends FreedomCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Location randomOffset(Location a, double magnitude)
|
||||
{
|
||||
return a.clone().add(randomDoubleRange(-1.0, 1.0) * magnitude, randomDoubleRange(-1.0, 1.0) * magnitude, randomDoubleRange(-1.0, 1.0) * magnitude);
|
||||
}
|
||||
|
||||
private static Double randomDoubleRange(double min, double max)
|
||||
{
|
||||
return min + (random.nextDouble() * ((max - min) + 1.0));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user