mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
Replaced All Instances of Random With SplittableRandom
SplittableRandom is faster (negligable) than Random and is also able to recursively return new instances of itself for an even more complex pseudo random generator compared to the default Random supplied by Java.
This commit is contained in:
@ -5,7 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.SplittableRandom;
|
||||
import java.util.UUID;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
@ -48,7 +48,7 @@ import org.bukkit.util.Vector;
|
||||
public class ItemFun extends FreedomService
|
||||
{
|
||||
|
||||
private final Random random = new Random();
|
||||
private final SplittableRandom random = new SplittableRandom();
|
||||
private final Map<String, List<String>> cooldownTracker = new HashMap<>();
|
||||
private final Map<Player, Float> orientationTracker = new HashMap<>();
|
||||
private final List<UUID> FIRE_BALL_UUIDS = new ArrayList<>();
|
||||
|
@ -2,7 +2,7 @@ package me.totalfreedom.totalfreedommod.fun;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.SplittableRandom;
|
||||
import java.util.Set;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
@ -17,7 +17,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||
|
||||
public class Trailer extends FreedomService
|
||||
{
|
||||
private final Random random = new Random();
|
||||
private final SplittableRandom random = new SplittableRandom();
|
||||
private final Set<String> trailPlayers = new HashSet<>(); // player name
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user