mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
Remove FastMath
hotspot has intrinsics for almost everything we use it for
This commit is contained in:
@@ -2,10 +2,4 @@ version = version("1.0.0")
|
||||
|
||||
dependencies {
|
||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
||||
}
|
||||
|
||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
||||
relocate("net.jafama", "com.dfsek.terra.addons.flora.lib.jafama")
|
||||
}
|
||||
|
||||
+3
-5
@@ -7,8 +7,6 @@
|
||||
|
||||
package com.dfsek.terra.addons.flora.flora.gen;
|
||||
|
||||
import net.jafama.FastMath;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
@@ -60,7 +58,7 @@ public class TerraFlora implements Structure {
|
||||
}
|
||||
|
||||
private ProbabilityCollection<BlockState> getStateCollection(int layer) {
|
||||
return layers.get(FastMath.max(FastMath.min(layer, layers.size() - 1), 0));
|
||||
return layers.get(Math.max(Math.min(layer, layers.size() - 1), 0));
|
||||
}
|
||||
|
||||
private EnumSet<Direction> getFaces(Vector3Int b, WritableWorld world) {
|
||||
@@ -82,8 +80,8 @@ public class TerraFlora implements Structure {
|
||||
Direction.class);
|
||||
if(doRotation && faces.size() == 0) return false; // Don't plant if no faces are valid.
|
||||
|
||||
for(int i = 0; FastMath.abs(i) < size; i += c) { // Down if ceiling, up if floor
|
||||
int lvl = (FastMath.abs(i));
|
||||
for(int i = 0; Math.abs(i) < size; i += c) { // Down if ceiling, up if floor
|
||||
int lvl = (Math.abs(i));
|
||||
BlockState data = getStateCollection((ceiling ? lvl : size - lvl - 1)).get(distribution, location.getX(), location.getY(),
|
||||
location.getZ(), world.getSeed());
|
||||
if(doRotation) {
|
||||
|
||||
Reference in New Issue
Block a user