removed chunk wrapper
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package kaptainwutax.seedcracker.finder;
|
||||
|
||||
import kaptainwutax.seedcracker.world.ChunkWrapper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -31,8 +30,7 @@ public abstract class BlockFinder extends Finder {
|
||||
@Override
|
||||
public List<BlockPos> findInChunk() {
|
||||
List<BlockPos> result = new ArrayList<>();
|
||||
ChunkWrapper chunkWrapper = new ChunkWrapper(this.world, this.chunkPos);
|
||||
Chunk chunk = chunkWrapper.getChunk();
|
||||
Chunk chunk = this.world.getChunk(this.chunkPos.getCenterBlockPos());
|
||||
|
||||
for(BlockPos blockPos: this.searchPositions) {
|
||||
BlockState currentState = chunk.getBlockState(blockPos);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package kaptainwutax.seedcracker.finder;
|
||||
|
||||
import kaptainwutax.seedcracker.world.ChunkWrapper;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.BlockMirror;
|
||||
@@ -63,8 +62,7 @@ public class PieceFinder extends Finder {
|
||||
public List<BlockPos> findInChunk() {
|
||||
List<BlockPos> result = new ArrayList<>();
|
||||
|
||||
ChunkWrapper chunkWrapper = new ChunkWrapper(this.world, this.chunkPos);
|
||||
Chunk chunk = chunkWrapper.getChunk();
|
||||
Chunk chunk = this.world.getChunk(this.chunkPos.getCenterBlockPos());
|
||||
|
||||
for(BlockPos center: this.searchPositions) {
|
||||
boolean found = true;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package kaptainwutax.seedcracker.world;
|
||||
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
public class ChunkWrapper {
|
||||
|
||||
private final World world;
|
||||
private final ChunkPos chunkPos;
|
||||
private final long chunkHash;
|
||||
|
||||
public ChunkWrapper(World world, ChunkPos chunkPos) {
|
||||
this.world = world;
|
||||
this.chunkPos = chunkPos;
|
||||
this.chunkHash = chunkPos.toLong();
|
||||
}
|
||||
|
||||
public Chunk getChunk() {
|
||||
return this.world.getChunk(this.chunkPos.getCenterBlockPos());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user