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:
Paldiu
2020-12-25 15:57:10 -05:00
parent dec35f76e4
commit eb9759f2d8
8 changed files with 18 additions and 18 deletions

View File

@ -2,7 +2,7 @@ package me.totalfreedom.totalfreedommod.command;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.SplittableRandom;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import net.minecraft.server.v1_16_R3.NBTTagCompound;
@ -180,7 +180,7 @@ public class Command_modifyitem extends FreedomCommand
}
cmpnd.setDouble("Amount", amount);
cmpnd.setInt("Operation", 0);
Random random = new Random();
SplittableRandom random = new SplittableRandom();
cmpnd.setIntArray("UUID", new int[]
{
random.nextInt(),