Removed static positions from SDF
This commit is contained in:
parent
f756673128
commit
a5c3c97630
4 changed files with 7 additions and 11 deletions
|
@ -17,7 +17,6 @@ import ru.bclib.recipes.CraftingRecipes;
|
|||
import ru.bclib.registry.BaseBlockEntities;
|
||||
import ru.bclib.registry.BaseRegistry;
|
||||
import ru.bclib.util.Logger;
|
||||
import ru.bclib.util.ModUtil;
|
||||
import ru.bclib.world.generator.BCLibEndBiomeSource;
|
||||
import ru.bclib.world.generator.BCLibNetherBiomeSource;
|
||||
import ru.bclib.world.generator.GeneratorOptions;
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package ru.bclib.mixin.common;
|
||||
|
||||
import joptsimple.AbstractOptionSpec;
|
||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.NonOptionArgumentSpec;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpecBuilder;
|
||||
import net.minecraft.server.Main;
|
||||
import net.minecraft.server.dedicated.DedicatedServerSettings;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.mojang.math.Vector3f;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
public class SDFCoordModify extends SDFUnary {
|
||||
private static final Vector3f POS = new Vector3f();
|
||||
private static Vector3f pos = new Vector3f();
|
||||
private Consumer<Vector3f> function;
|
||||
|
||||
public SDFCoordModify setFunction(Consumer<Vector3f> function) {
|
||||
|
@ -15,8 +15,8 @@ public class SDFCoordModify extends SDFUnary {
|
|||
|
||||
@Override
|
||||
public float getDistance(float x, float y, float z) {
|
||||
POS.set(x, y, z);
|
||||
function.accept(POS);
|
||||
return this.source.getDistance(POS.x(), POS.y(), POS.z());
|
||||
pos.set(x, y, z);
|
||||
function.accept(pos);
|
||||
return this.source.getDistance(pos.x(), pos.y(), pos.z());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.mojang.math.Vector3f;
|
|||
import java.util.function.Function;
|
||||
|
||||
public class SDFDisplacement extends SDFUnary {
|
||||
private static final Vector3f POS = new Vector3f();
|
||||
private final Vector3f pos = new Vector3f();
|
||||
private Function<Vector3f, Float> displace;
|
||||
|
||||
public SDFDisplacement setFunction(Function<Vector3f, Float> displace) {
|
||||
|
@ -15,7 +15,7 @@ public class SDFDisplacement extends SDFUnary {
|
|||
|
||||
@Override
|
||||
public float getDistance(float x, float y, float z) {
|
||||
POS.set(x, y, z);
|
||||
return this.source.getDistance(x, y, z) + displace.apply(POS);
|
||||
pos.set(x, y, z);
|
||||
return this.source.getDistance(x, y, z) + displace.apply(pos);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue