fix more derpy pos issues

This commit is contained in:
dags- 2020-02-28 21:00:14 +00:00
parent a37b0c5cc2
commit c566614f66
4 changed files with 8 additions and 7 deletions

View File

@ -47,7 +47,7 @@ public interface ColumnDecorator {
} }
default void fillDown(IChunk chunk, int x, int z, int from, int to, BlockState state) { default void fillDown(IChunk chunk, int x, int z, int from, int to, BlockState state) {
try (BlockPos.PooledMutable pos = pos()) { try (BlockPos.PooledMutable pos = ColumnDecorator.pos(x, from, z)) {
for (int dy = from; dy > to; dy--) { for (int dy = from; dy > to; dy--) {
chunk.setBlockState(pos.setPos(x, dy, z), state, false); chunk.setBlockState(pos.setPos(x, dy, z), state, false);
} }
@ -62,7 +62,7 @@ public interface ColumnDecorator {
return getNoise(x, z, seed, scale / 255F, bias / 255F); return getNoise(x, z, seed, scale / 255F, bias / 255F);
} }
static BlockPos.PooledMutable pos() { static BlockPos.PooledMutable pos(int x, int y, int z) {
return BlockPos.PooledMutable.retain(); return BlockPos.PooledMutable.retain(x, y, z);
} }
} }

View File

@ -26,6 +26,7 @@
package com.terraforged.api.chunk.surface; package com.terraforged.api.chunk.surface;
import com.terraforged.api.chunk.column.ColumnDecorator;
import com.terraforged.api.chunk.surface.builder.Combiner; import com.terraforged.api.chunk.surface.builder.Combiner;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -36,7 +37,7 @@ public interface Surface {
void buildSurface(int x, int z, int height, SurfaceContext ctx); void buildSurface(int x, int z, int height, SurfaceContext ctx);
default void fill(int x, int z, int start, int end, IChunk chunk, BlockState state) { default void fill(int x, int z, int start, int end, IChunk chunk, BlockState state) {
try (BlockPos.PooledMutable pos = BlockPos.PooledMutable.retain()) { try (BlockPos.PooledMutable pos = ColumnDecorator.pos(x, start, z)) {
if (start < end) { if (start < end) {
for (int y = start; y < end; y++) { for (int y = start; y < end; y++) {
chunk.setBlockState(pos.setPos(x, y, z), state, false); chunk.setBlockState(pos.setPos(x, y, z), state, false);

View File

@ -45,11 +45,11 @@ public class FilterSettings {
@Range(min = 0F, max = 1F) @Range(min = 0F, max = 1F)
@Comment("Controls how quickly material dissolves (during erosion)") @Comment("Controls how quickly material dissolves (during erosion)")
public float erosionRate = 0.4F; public float erosionRate = 0.45F;
@Range(min = 0F, max = 1F) @Range(min = 0F, max = 1F)
@Comment("Controls how quickly material is deposited (during erosion)") @Comment("Controls how quickly material is deposited (during erosion)")
public float depositeRate = 0.4F; public float depositeRate = 0.35F;
} }
@Serializable @Serializable

@ -1 +1 @@
Subproject commit 761cbd57e8b40211db5b9905a69f82dfcb3ae361 Subproject commit 3717ff07d10d449d8a5c77ff75cf88f00e277429