mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-27 10:59:20 +00:00
change name to BlockPos
This commit is contained in:
@@ -19,20 +19,20 @@ package net.momirealms.customcrops.api.mechanic.world;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ChunkPos {
|
||||
public class BlockPos {
|
||||
|
||||
private final int position;
|
||||
|
||||
public ChunkPos(int position) {
|
||||
public BlockPos(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public ChunkPos(int x, int y, int z) {
|
||||
public BlockPos(int x, int y, int z) {
|
||||
this.position = ((x & 0xF) << 28) | ((z & 0xF) << 24) | (y & 0xFFFFFF);
|
||||
}
|
||||
|
||||
public static ChunkPos getByLocation(SimpleLocation location) {
|
||||
return new ChunkPos(location.getX() % 16, location.getY(), location.getZ() % 16);
|
||||
public static BlockPos getByLocation(SimpleLocation location) {
|
||||
return new BlockPos(location.getX() % 16, location.getY(), location.getZ() % 16);
|
||||
}
|
||||
|
||||
public SimpleLocation getLocation(String world, ChunkCoordinate coordinate) {
|
||||
@@ -67,8 +67,8 @@ public class ChunkPos {
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ChunkPos chunkPos = (ChunkPos) o;
|
||||
return position == chunkPos.position;
|
||||
BlockPos blockPos = (BlockPos) o;
|
||||
return position == blockPos.position;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
package net.momirealms.customcrops.api.mechanic.world.level;
|
||||
|
||||
import net.momirealms.customcrops.api.mechanic.world.ChunkPos;
|
||||
import net.momirealms.customcrops.api.mechanic.world.BlockPos;
|
||||
import net.momirealms.customcrops.api.mechanic.world.CustomCropsBlock;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -26,15 +26,15 @@ public interface CustomCropsSection {
|
||||
|
||||
int getSectionID();
|
||||
|
||||
CustomCropsBlock getBlockAt(ChunkPos pos);
|
||||
CustomCropsBlock getBlockAt(BlockPos pos);
|
||||
|
||||
CustomCropsBlock removeBlockAt(ChunkPos pos);
|
||||
CustomCropsBlock removeBlockAt(BlockPos pos);
|
||||
|
||||
CustomCropsBlock addBlockAt(ChunkPos pos, CustomCropsBlock block);
|
||||
CustomCropsBlock addBlockAt(BlockPos pos, CustomCropsBlock block);
|
||||
|
||||
boolean canPrune();
|
||||
|
||||
CustomCropsBlock[] getBlocks();
|
||||
|
||||
Map<ChunkPos, CustomCropsBlock> getBlockMap();
|
||||
Map<BlockPos, CustomCropsBlock> getBlockMap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user