mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-18 06:10:16 +00:00
Replace Math with FastMath for improved performance.
FastMath is a drop in replacement for the native Java math class with improved performance and fall backs to the native Java math class if necessary. https://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/util/FastMath.html This requires further testing and might cause chunk borders due the FastMath giving slightly different results than the native Java math class. I also added .idea/Terra.iml to the .gitignore
This commit is contained in:
@@ -2,6 +2,7 @@ package com.dfsek.terra.util.structure;
|
||||
|
||||
import com.dfsek.terra.procgen.math.Vector2;
|
||||
import com.dfsek.terra.structure.Rotation;
|
||||
import org.apache.commons.math3.util.FastMath;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
@@ -107,7 +108,7 @@ public final class RotationUtil {
|
||||
* @return BlockFace represented by integer.
|
||||
*/
|
||||
public static BlockFace fromRotation(int r) {
|
||||
switch(Math.floorMod(r, 16)) {
|
||||
switch(FastMath.floorMod(r, 16)) {
|
||||
case 0:
|
||||
return BlockFace.NORTH;
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user