chore: address deprecations in vector classes

This commit is contained in:
dordsor21 2024-05-27 18:48:46 +01:00 committed by Jordan
parent 7318685613
commit 36d2c85fdb
244 changed files with 1493 additions and 1515 deletions

View File

@ -27,7 +27,6 @@ import com.google.common.collect.Sets;
import com.google.common.util.concurrent.Futures;
import com.mojang.datafixers.util.Either;
import com.mojang.serialization.Lifecycle;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseItem;
@ -531,7 +530,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().connection.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNativeBinary(nbtData)
@ -581,10 +580,10 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getBlockX(), position.getBlockY(), position.getBlockZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch());
final BlockPos blockPos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
@ -605,7 +604,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean canPlaceAt(org.bukkit.World world, BlockVector3 position, BlockState blockState) {
int internalId = BlockStateIdAccess.getBlockStateId(blockState);
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.getX(), position.getY(), position.getZ()));
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.x(), position.y(), position.z()));
}
@Override
@ -725,7 +724,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
@ -738,7 +737,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
@ -757,7 +756,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.left().orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
@ -797,7 +796,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;

View File

@ -472,7 +472,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

View File

@ -786,9 +786,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);
synchronized (nmsWorld) {

View File

@ -570,7 +570,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().connection.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNativeBinary(nbtData)
@ -631,10 +631,10 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getBlockX(), position.getBlockY(), position.getBlockZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch());
final BlockPos blockPos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
@ -655,7 +655,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean canPlaceAt(org.bukkit.World world, BlockVector3 position, BlockState blockState) {
int internalId = BlockStateIdAccess.getBlockStateId(blockState);
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.getX(), position.getY(), position.getZ()));
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.x(), position.y(), position.z()));
}
@Override
@ -776,7 +776,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
@ -789,7 +789,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
@ -808,7 +808,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.left().orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
@ -848,7 +848,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;

View File

@ -472,7 +472,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

View File

@ -784,9 +784,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);
synchronized (nmsWorld) {

View File

@ -530,7 +530,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().connection.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNativeBinary(nbtData)
@ -580,10 +580,10 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getBlockX(), position.getBlockY(), position.getBlockZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch());
final BlockPos blockPos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
@ -604,7 +604,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean canPlaceAt(org.bukkit.World world, BlockVector3 position, BlockState blockState) {
int internalId = BlockStateIdAccess.getBlockStateId(blockState);
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.getX(), position.getY(), position.getZ()));
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.x(), position.y(), position.z()));
}
@Override
@ -725,7 +725,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
@ -738,7 +738,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
@ -757,7 +757,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.left().orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
@ -797,7 +797,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;

View File

@ -475,7 +475,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

View File

@ -771,9 +771,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);
synchronized (nmsWorld) {

View File

@ -530,7 +530,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
((CraftPlayer) player).getHandle().connection.send(ClientboundBlockEntityDataPacket.create(
new StructureBlockEntity(
new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
),
__ -> (net.minecraft.nbt.CompoundTag) fromNativeBinary(nbtData)
@ -580,10 +580,10 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getBlockX(), position.getBlockY(), position.getBlockZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch());
final BlockPos blockPos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
@ -604,7 +604,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean canPlaceAt(org.bukkit.World world, BlockVector3 position, BlockState blockState) {
int internalId = BlockStateIdAccess.getBlockStateId(blockState);
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.getX(), position.getY(), position.getZ()));
return blockData.canSurvive(((CraftWorld) world).getHandle(), new BlockPos(position.x(), position.y(), position.z()));
}
@Override
@ -725,7 +725,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
@ -738,7 +738,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
@ -757,7 +757,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.left().orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
@ -797,7 +797,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;

View File

@ -475,7 +475,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

View File

@ -771,9 +771,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);
synchronized (nmsWorld) {

View File

@ -577,7 +577,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundBinaryTag nbtData) {
var structureBlock = new StructureBlockEntity(
new BlockPos(pos.getX(), pos.getY(), pos.getZ()),
new BlockPos(pos.x(), pos.y(), pos.z()),
Blocks.STRUCTURE_BLOCK.defaultBlockState()
);
structureBlock.setLevel(((CraftPlayer) player).getHandle().level());
@ -644,11 +644,11 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
return false;
}
fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack);
fakePlayer.absMoveTo(position.getX(), position.getY(), position.getZ(),
fakePlayer.absMoveTo(position.x(), position.y(), position.z(),
(float) face.toVector().toYaw(), (float) face.toVector().toPitch()
);
final BlockPos blockPos = new BlockPos(position.getX(), position.getY(), position.getZ());
final BlockPos blockPos = new BlockPos(position.x(), position.y(), position.z());
final Vec3 blockVec = Vec3.atLowerCornerOf(blockPos);
final net.minecraft.core.Direction enumFacing = adapt(face);
BlockHitResult rayTrace = new BlockHitResult(blockVec, enumFacing, blockPos, false);
@ -674,7 +674,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
net.minecraft.world.level.block.state.BlockState blockData = Block.stateById(internalId);
return blockData.canSurvive(
((CraftWorld) world).getHandle(),
new BlockPos(position.getX(), position.getY(), position.getZ())
new BlockPos(position.x(), position.y(), position.z())
);
}
@ -802,7 +802,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
for (BlockVector3 vec : region) {
BlockPos pos = new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
BlockPos pos = new BlockPos(vec.x(), vec.y(), vec.z());
ChunkAccess chunk = chunks.get(new ChunkPos(pos));
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(pos);
int internalId = Block.getId(blockData);
@ -815,7 +815,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
}
extent.setBlock(vec, state.toBaseBlock());
if (options.shouldRegenBiomes()) {
Biome origBiome = chunk.getNoiseBiome(vec.getX(), vec.getY(), vec.getZ()).value();
Biome origBiome = chunk.getNoiseBiome(vec.x(), vec.y(), vec.z()).value();
BiomeType adaptedBiome = adapt(serverWorld, origBiome);
if (adaptedBiome != null) {
extent.setBiome(vec, adaptedBiome);
@ -834,7 +834,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
//noinspection unchecked
chunkLoadings.add(
((CompletableFuture<ChunkResult<ChunkAccess>>)
getChunkFutureMethod.invoke(chunkManager, chunk.getX(), chunk.getZ(), ChunkStatus.FEATURES, true))
getChunkFutureMethod.invoke(chunkManager, chunk.x(), chunk.z(), ChunkStatus.FEATURES, true))
.thenApply(either -> either.orElse(null))
);
} catch (IllegalAccessException | InvocationTargetException e) {
@ -874,7 +874,7 @@ public final class PaperweightAdapter implements BukkitImplAdapter<net.minecraft
public boolean clearContainerBlockContents(org.bukkit.World world, BlockVector3 pt) {
ServerLevel originalWorld = ((CraftWorld) world).getHandle();
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()));
BlockEntity entity = originalWorld.getBlockEntity(new BlockPos(pt.x(), pt.y(), pt.z()));
if (entity instanceof Clearable) {
((Clearable) entity).clearContent();
return true;

View File

@ -484,7 +484,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
net.minecraft.world.level.block.state.BlockState blockState1 = Block.stateById(internalId);
return blockState1.hasPostProcess(
getServerLevel(world),
new BlockPos(blockVector3.getX(), blockVector3.getY(), blockVector3.getZ())
new BlockPos(blockVector3.x(), blockVector3.y(), blockVector3.z())
);
}

View File

@ -773,9 +773,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
for (final Map.Entry<BlockVector3, CompoundTag> entry : tiles.entrySet()) {
final CompoundTag nativeTag = entry.getValue();
final BlockVector3 blockHash = entry.getKey();
final int x = blockHash.getX() + bx;
final int y = blockHash.getY();
final int z = blockHash.getZ() + bz;
final int x = blockHash.x() + bx;
final int y = blockHash.y();
final int z = blockHash.z() + bz;
final BlockPos pos = new BlockPos(x, y, z);
synchronized (nmsWorld) {

View File

@ -99,7 +99,7 @@ public interface IBukkitAdapter {
checkNotNull(position);
return new org.bukkit.Location(
world,
position.getX(), position.getY(), position.getZ()
position.x(), position.y(), position.z()
);
}
@ -119,7 +119,7 @@ public interface IBukkitAdapter {
checkNotNull(location);
return new org.bukkit.Location(
world,
location.getX(), location.getY(), location.getZ(),
location.x(), location.y(), location.z(),
location.getYaw(),
location.getPitch()
);

View File

@ -354,7 +354,7 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
@Override
public boolean apply(final Extent extent, final BlockVector3 get, final BlockVector3 set) throws WorldEditException {
return extent.setBlock(set.getX(), set.getY(), set.getZ(), source.getFullBlock(get.getX(), get.getY(), get.getZ()));
return extent.setBlock(set.x(), set.y(), set.z(), source.getFullBlock(get.x(), get.y(), get.z()));
}
}
@ -374,8 +374,8 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
@Override
public boolean apply(final Extent extent, final BlockVector3 get, final BlockVector3 set) throws WorldEditException {
return extent.setBlock(set.getX(), set.getY(), set.getZ(), source.getFullBlock(get.getX(), get.getY(), get.getZ()))
&& extent.setBiome(set.getX(), set.getY(), set.getZ(), biomeGetter.apply(get));
return extent.setBlock(set.x(), set.y(), set.z(), source.getFullBlock(get.x(), get.y(), get.z()))
&& extent.setBiome(set.x(), set.y(), set.z(), biomeGetter.apply(get));
}
}
@ -468,22 +468,22 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
private long[] getChunkCoordsRegen(Region region, int border) { //needs to be square num of chunks
BlockVector3 oldMin = region.getMinimumPoint();
BlockVector3 newMin = BlockVector3.at(
(oldMin.getX() >> 4 << 4) - border * 16,
oldMin.getY(),
(oldMin.getZ() >> 4 << 4) - border * 16
(oldMin.x() >> 4 << 4) - border * 16,
oldMin.y(),
(oldMin.z() >> 4 << 4) - border * 16
);
BlockVector3 oldMax = region.getMaximumPoint();
BlockVector3 newMax = BlockVector3.at(
(oldMax.getX() >> 4 << 4) + (border + 1) * 16 - 1,
oldMax.getY(),
(oldMax.getZ() >> 4 << 4) + (border + 1) * 16 - 1
(oldMax.x() >> 4 << 4) + (border + 1) * 16 - 1,
oldMax.y(),
(oldMax.z() >> 4 << 4) + (border + 1) * 16 - 1
);
Region adjustedRegion = new CuboidRegion(newMin, newMax);
return adjustedRegion.getChunks().stream()
.sorted(Comparator
.comparingInt(BlockVector2::getZ)
.thenComparingInt(BlockVector2::getX)) //needed for RegionLimitedWorldAccess
.mapToLong(c -> MathMan.pairInt(c.getX(), c.getZ()))
.comparingInt(BlockVector2::z)
.thenComparingInt(BlockVector2::x)) //needed for RegionLimitedWorldAccess
.mapToLong(c -> MathMan.pairInt(c.x(), c.z()))
.toArray();
}

View File

@ -56,7 +56,7 @@ public class WorldGuardFeature extends BukkitMaskManager implements Listener {
if (region instanceof ProtectedPolygonalRegion casted) {
BlockVector3 max = region.getMaximumPoint();
BlockVector3 min = region.getMinimumPoint();
return new Polygonal2DRegion(null, casted.getPoints(), min.getBlockY(), max.getBlockY());
return new Polygonal2DRegion(null, casted.getPoints(), min.y(), max.y());
}
return new AdaptedRegion(region);
}

View File

@ -94,15 +94,15 @@ public class FaweDelegateSchematicHandler {
return;
}
BlockVector3 dimension = schematic.getClipboard().getDimensions();
final int WIDTH = dimension.getX();
final int LENGTH = dimension.getZ();
final int HEIGHT = dimension.getY();
final int WIDTH = dimension.x();
final int LENGTH = dimension.z();
final int HEIGHT = dimension.y();
final int worldHeight = plot.getArea().getMaxGenHeight() - plot.getArea().getMinGenHeight() + 1;
// Validate dimensions
CuboidRegion region = plot.getLargestRegion();
boolean sizeMismatch =
((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || (
(region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT
((region.getMaximumPoint().x() - region.getMinimumPoint().x() + xOffset + 1) < WIDTH) || (
(region.getMaximumPoint().z() - region.getMinimumPoint().z() + zOffset + 1) < LENGTH) || (HEIGHT
> worldHeight);
if (!Settings.Schematics.PASTE_MISMATCHES && sizeMismatch) {
if (actor != null) {
@ -111,8 +111,8 @@ public class FaweDelegateSchematicHandler {
TaskManager.runTask(whenDone);
return;
}
if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || (
(region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT
if (((region.getMaximumPoint().x() - region.getMinimumPoint().x() + xOffset + 1) < WIDTH) || (
(region.getMaximumPoint().z() - region.getMinimumPoint().z() + zOffset + 1) < LENGTH) || (HEIGHT
> worldHeight)) {
if (whenDone != null) {
TaskManager.runTask(whenDone);
@ -141,7 +141,7 @@ public class FaweDelegateSchematicHandler {
} else {
y_offset_actual = yOffset + pw.getMinBuildHeight() + editSession.getHighestTerrainBlock(region
.getMinimumPoint()
.getX() + 1, region.getMinimumPoint().getZ() + 1, pw.getMinGenHeight(), pw.getMaxGenHeight()
.x() + 1, region.getMinimumPoint().z() + 1, pw.getMinGenHeight(), pw.getMaxGenHeight()
);
}
}
@ -150,7 +150,7 @@ public class FaweDelegateSchematicHandler {
}
final BlockVector3 to = BlockVector3
.at(region.getMinimumPoint().getX() + xOffset, y_offset_actual, region.getMinimumPoint().getZ() + zOffset);
.at(region.getMinimumPoint().x() + xOffset, y_offset_actual, region.getMinimumPoint().z() + zOffset);
final Clipboard clipboard = schematic.getClipboard();
clipboard.setOrigin(clipboard.getRegion().getMinimumPoint());
clipboard.paste(editSession, to, true, false, true);

View File

@ -159,8 +159,8 @@ public class PlotSquaredFeature extends FaweMaskManager {
regions = WEManager.getMask(pp);
if (regions.size() == 1) {
CuboidRegion region = regions.iterator().next();
if (region.getMinimumPoint().getX() == Integer.MIN_VALUE
&& region.getMaximumPoint().getX() == Integer.MAX_VALUE) {
if (region.getMinimumPoint().x() == Integer.MIN_VALUE
&& region.getMaximumPoint().x() == Integer.MAX_VALUE) {
regions.clear();
}
}

View File

@ -240,7 +240,7 @@ public enum BukkitAdapter {
Vector3 position = location;
return new org.bukkit.Location(
adapt((World) location.getExtent()),
position.getX(), position.getY(), position.getZ(),
position.x(), position.y(), position.z(),
location.getYaw(),
location.getPitch()
);
@ -258,7 +258,7 @@ public enum BukkitAdapter {
checkNotNull(position);
return new org.bukkit.Location(
world,
position.getX(), position.getY(), position.getZ()
position.x(), position.y(), position.z()
);
}
@ -274,7 +274,7 @@ public enum BukkitAdapter {
checkNotNull(position);
return new org.bukkit.Location(
world,
position.getX(), position.getY(), position.getZ()
position.x(), position.y(), position.z()
);
}
@ -290,7 +290,7 @@ public enum BukkitAdapter {
checkNotNull(location);
return new org.bukkit.Location(
world,
location.getX(), location.getY(), location.getZ(),
location.x(), location.y(), location.z(),
location.getYaw(),
location.getPitch()
);

View File

@ -242,9 +242,9 @@ public class BukkitPlayer extends AbstractPlayerActor {
//FAWE end
return TaskManager.taskManager().sync(() -> player.teleport(new Location(
finalWorld,
pos.getX(),
pos.getY(),
pos.getZ(),
pos.x(),
pos.y(),
pos.z(),
yaw,
pitch
)));
@ -422,7 +422,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
@Override
public <B extends BlockStateHolder<B>> void sendFakeBlock(BlockVector3 pos, B block) {
Location loc = new Location(player.getWorld(), pos.getX(), pos.getY(), pos.getZ());
Location loc = new Location(player.getWorld(), pos.x(), pos.y(), pos.z());
if (block == null) {
player.sendBlockChange(loc, player.getWorld().getBlockAt(loc).getBlockData());
} else {

View File

@ -247,7 +247,7 @@ public class BukkitWorld extends AbstractWorld {
//FAWE start - safe edit region
testCoords(pt);
//FAWE end
return getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getLightLevel();
return getWorld().getBlockAt(pt.x(), pt.y(), pt.z()).getLightLevel();
}
@Override
@ -284,7 +284,7 @@ public class BukkitWorld extends AbstractWorld {
return false;
}
Block block = getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
Block block = getWorld().getBlockAt(pt.x(), pt.y(), pt.z());
BlockState state = PaperLib.getBlockState(block, false).getState();
if (!(state instanceof InventoryHolder)) {
return false;
@ -363,8 +363,8 @@ public class BukkitWorld extends AbstractWorld {
//FAWE end
World world = getWorld();
//FAWE start
int X = pt.getBlockX() >> 4;
int Z = pt.getBlockZ() >> 4;
int X = pt.x() >> 4;
int Z = pt.z() >> 4;
if (Fawe.isMainThread()) {
world.getChunkAt(X, Z);
} else if (PaperLib.isPaper()) {
@ -413,7 +413,7 @@ public class BukkitWorld extends AbstractWorld {
public void fixAfterFastMode(Iterable<BlockVector2> chunks) {
World world = getWorld();
for (BlockVector2 chunkPos : chunks) {
world.refreshChunk(chunkPos.getBlockX(), chunkPos.getBlockZ());
world.refreshChunk(chunkPos.x(), chunkPos.z());
}
}
@ -495,13 +495,13 @@ public class BukkitWorld extends AbstractWorld {
//FAWE start - safe edit region
testCoords(pt);
//FAWE end
getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).breakNaturally();
getWorld().getBlockAt(pt.x(), pt.y(), pt.z()).breakNaturally();
}
//FAWE start
@Override
public Collection<BaseItemStack> getBlockDrops(BlockVector3 position) {
return getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()).getDrops().stream()
return getWorld().getBlockAt(position.x(), position.y(), position.z()).getDrops().stream()
.map(BukkitAdapter::adapt).collect(Collectors.toList());
}
//FAWE end
@ -538,7 +538,7 @@ public class BukkitWorld extends AbstractWorld {
}
}
if (WorldEditPlugin.getInstance().getLocalConfiguration().unsupportedVersionEditing) {
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
Block bukkitBlock = getWorld().getBlockAt(position.x(), position.y(), position.z());
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
} else {
throw new RuntimeException(new UnsupportedVersionEditException());
@ -562,7 +562,7 @@ public class BukkitWorld extends AbstractWorld {
}
}
}
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
Block bukkitBlock = getWorld().getBlockAt(position.x(), position.y(), position.z());
bukkitBlock.setBlockData(BukkitAdapter.adapt(block), sideEffects.doesApplyAny());
return true;
}
@ -584,8 +584,8 @@ public class BukkitWorld extends AbstractWorld {
if (!Settings.settings().REGION_RESTRICTIONS_OPTIONS.RESTRICT_TO_SAFE_RANGE) {
return;
}
int x = position.getX();
int z = position.getZ();
int x = position.x();
int z = position.z();
if (x > 30000000 || z > 30000000 || x < -30000000 || z < -30000000) {
throw FaweCache.OUTSIDE_SAFE_REGION;
}
@ -636,9 +636,9 @@ public class BukkitWorld extends AbstractWorld {
testCoords(position);
//FAWE end
if (HAS_3D_BIOMES) {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ()));
return BukkitAdapter.adapt(getWorld().getBiome(position.x(), position.y(), position.z()));
} else {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockZ()));
return BukkitAdapter.adapt(getWorld().getBiome(position.x(), position.z()));
}
}
@ -649,9 +649,9 @@ public class BukkitWorld extends AbstractWorld {
testCoords(position);
//FAWE end
if (HAS_3D_BIOMES) {
getWorld().setBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ(), BukkitAdapter.adapt(biome));
getWorld().setBiome(position.x(), position.y(), position.z(), BukkitAdapter.adapt(biome));
} else {
getWorld().setBiome(position.getBlockX(), position.getBlockZ(), BukkitAdapter.adapt(biome));
getWorld().setBiome(position.x(), position.z(), BukkitAdapter.adapt(biome));
}
return true;
}

View File

@ -339,11 +339,11 @@ public class FaweAPI {
final BlockVector3 bot = selection.getMinimumPoint();
final BlockVector3 top = selection.getMaximumPoint();
final int minX = bot.getBlockX() >> 4;
final int minZ = bot.getBlockZ() >> 4;
final int minX = bot.x() >> 4;
final int minZ = bot.z() >> 4;
final int maxX = top.getBlockX() >> 4;
final int maxZ = top.getBlockZ() >> 4;
final int maxX = top.x() >> 4;
final int maxZ = top.z() >> 4;
int count = 0;

View File

@ -50,9 +50,9 @@ public class BlendBall implements Brush {
final int outsetSize = (int) (size + 1);
double brushSizeSquared = size * size;
int tx = position.getBlockX();
int ty = position.getBlockY();
int tz = position.getBlockZ();
int tx = position.x();
int ty = position.y();
int tz = position.z();
int[] frequency = new int[BlockTypes.size()];

View File

@ -81,9 +81,9 @@ public class CatenaryBrush implements Brush, ResettableTool {
return pos1.add(pos2).divide(2).toBlockPoint();
}
double curveLen = pos1.distance(pos2) * lenPercent;
double dy = pos2.getY() - pos1.getY();
double dx = pos2.getX() - pos1.getX();
double dz = pos2.getZ() - pos1.getZ();
double dy = pos2.y() - pos1.y();
double dx = pos2.x() - pos1.x();
double dz = pos2.z() - pos1.z();
double dh = Math.sqrt(dx * dx + dz * dz);
double g = Math.sqrt(curveLen * curveLen - dy * dy) / 2;
double a = 0.00001;

View File

@ -54,9 +54,9 @@ public class CommandBrush implements Brush {
position.subtract(radius, radius, radius),
position.add(radius, radius, radius)
);
String replaced = command.replace("{x}", Integer.toString(position.getBlockX()))
.replace("{y}", Integer.toString(position.getBlockY()))
.replace("{z}", Integer.toString(position.getBlockZ()))
String replaced = command.replace("{x}", Integer.toString(position.x()))
.replace("{y}", Integer.toString(position.y()))
.replace("{z}", Integer.toString(position.z()))
.replace("{world}", editSession.getWorld().getName())
.replace("{size}", Integer.toString(radius));

View File

@ -65,11 +65,11 @@ public class CopyPastaBrush implements Brush, ResettableTool {
mask = Masks.alwaysTrue();
}
final ResizableClipboardBuilder builder = new ResizableClipboardBuilder(editSession.getWorld());
final int minY = position.getBlockY();
final int minY = position.y();
mask = new AbstractDelegateMask(mask) {
@Override
public boolean test(BlockVector3 vector) {
if (super.test(vector) && vector.getBlockY() >= minY) {
if (super.test(vector) && vector.y() >= minY) {
BaseBlock block = editSession.getFullBlock(vector);
if (!block.getBlockType().getMaterial().isAir()) {
builder.add(vector, BlockTypes.AIR.getDefaultState().toBaseBlock(), block);

View File

@ -63,9 +63,9 @@ public class ErodeBrush implements Brush {
Clipboard buffer1 = new CPUOptimizedClipboard(region);
Clipboard buffer2 = new CPUOptimizedClipboard(region);
final int bx = target.getBlockX();
final int by = target.getBlockY();
final int bz = target.getBlockZ();
final int bx = target.x();
final int by = target.y();
final int bz = target.z();
for (int x = -brushSize, relx = 0; x <= brushSize && relx < buffer1.getWidth(); x++, relx++) {
int x0 = x + bx;
@ -106,7 +106,7 @@ public class ErodeBrush implements Brush {
for (BlockVector3 pos : finalBuffer) {
BlockState block = pos.getBlock(finalBuffer);
es.setBlock(pos.getX() + bx - brushSize, pos.getY() + by - brushSize, pos.getZ() + bz - brushSize, block);
es.setBlock(pos.x() + bx - brushSize, pos.y() + by - brushSize, pos.z() + bz - brushSize, block);
}
}
@ -139,9 +139,9 @@ public class ErodeBrush implements Brush {
int highest = 1;
for (BlockVector3 offs : FACES_TO_CHECK) {
BaseBlock next = current.getFullBlock(
relx + offs.getBlockX(),
rely + offs.getBlockY(),
relz + offs.getBlockZ()
relx + offs.x(),
rely + offs.y(),
relz + offs.z()
);
if (!next.getBlockType().getMaterial().isMovementBlocker()) {
continue;
@ -190,9 +190,9 @@ public class ErodeBrush implements Brush {
int total = 0;
for (BlockVector3 offs : FACES_TO_CHECK) {
BaseBlock next = current.getFullBlock(
relx + offs.getBlockX(),
rely + offs.getBlockY(),
relz + offs.getBlockZ()
relx + offs.x(),
rely + offs.y(),
relz + offs.z()
);
if (next.getMaterial().isMovementBlocker()) {
continue;

View File

@ -12,9 +12,9 @@ public class FallingSphere implements Brush {
@Override
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws
MaxChangedBlocksException {
int px = position.getBlockX();
int py = position.getBlockY();
int pz = position.getBlockZ();
int px = position.x();
int py = position.y();
int pz = position.z();
int maxY = editSession.getMaxY();
int minY = editSession.getMinY();

View File

@ -14,7 +14,6 @@ import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.Location;
@ -25,7 +24,6 @@ import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockState;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.Iterator;
@ -80,9 +78,9 @@ public class InspectBrush extends BrushTool {
return true;
}
BlockVector3 target = targetVector.toBlockPoint();
final int x = target.getBlockX();
final int y = target.getBlockY();
final int z = target.getBlockZ();
final int x = target.x();
final int y = target.y();
final int z = target.z();
World world = player.getWorld();
RollbackDatabase db = DBHandler.dbHandler().getDatabase(world);
int count = 0;

View File

@ -35,7 +35,7 @@ public record RecurseBrush(boolean dfs) implements Brush {
DFSRecursiveVisitor visitor = new DFSRecursiveVisitor(mask, replace, Integer.MAX_VALUE, Integer.MAX_VALUE) {
@Override
public boolean isVisitable(BlockVector3 from, BlockVector3 to) {
int y = to.getBlockY();
int y = to.y();
return y < maxY && radMask.test(to) && super.isVisitable(from, to);
}
};
@ -45,7 +45,7 @@ public record RecurseBrush(boolean dfs) implements Brush {
RecursiveVisitor visitor = new RecursiveVisitor(mask, replace, radius, editSession.getMinY(), editSession.getMaxY()) {
@Override
public boolean isVisitable(BlockVector3 from, BlockVector3 to) {
int y = to.getBlockY();
int y = to.y();
return y < maxY && super.isVisitable(from, to);
}
};

View File

@ -19,15 +19,15 @@ public record RockBrush(double amplitude, double frequency, Vector3 radius) impl
double seedY = ThreadLocalRandom.current().nextDouble();
double seedZ = ThreadLocalRandom.current().nextDouble();
int px = position.getBlockX();
int py = position.getBlockY();
int pz = position.getBlockZ();
int px = position.x();
int py = position.y();
int pz = position.z();
double distort = this.frequency / size;
double modX = 1D / radius.getX();
double modY = 1D / radius.getY();
double modZ = 1D / radius.getZ();
double modX = 1D / radius.x();
double modY = 1D / radius.y();
double modZ = 1D / radius.z();
int radiusSqr = (int) (size * size);
int sizeInt = (int) size * 2;

View File

@ -67,15 +67,15 @@ public class ScatterBrush implements Brush {
}
BlockVector3 patternSize = pattern.size();
BlockVector3Set placed = BlockVector3Set.getAppropriateVectorSet(patternSize.add(distance, distance, distance));
placed.setOffset(position.getX(), position.getY(), position.getZ());
placed.setOffset(position.x(), position.y(), position.z());
int maxFails = 1000;
for (int i = 0; i < count; i++) {
int index = ThreadLocalRandom.current().nextInt(length);
BlockVector3 pos = visited.get(index);
if (pos != null && canApply(pos)) {
int x = pos.getBlockX();
int y = pos.getBlockY();
int z = pos.getBlockZ();
int x = pos.x();
int y = pos.y();
int z = pos.z();
if (placed.containsRadius(x, y, z, distance)) {
if (maxFails-- <= 0) {
break;

View File

@ -45,9 +45,9 @@ public class ScatterCommand extends ScatterBrush {
position.subtract(radius, radius, radius),
position.add(radius, radius, radius)
);
String replaced = command.replace("{x}", Integer.toString(position.getBlockX()))
.replace("{y}", Integer.toString(position.getBlockY()))
.replace("{z}", Integer.toString(position.getBlockZ()))
String replaced = command.replace("{x}", Integer.toString(position.x()))
.replace("{y}", Integer.toString(position.y()))
.replace("{z}", Integer.toString(position.z()))
.replace("{world}", editSession.getWorld().getName())
.replace("{size}", Integer.toString(radius));

View File

@ -16,9 +16,9 @@ public class ScatterOverlayBrush extends ScatterBrush {
@Override
public void apply(EditSession editSession, LocalBlockVectorSet placed, BlockVector3 pt, Pattern p, double size) throws
MaxChangedBlocksException {
final int x = pt.getBlockX();
final int y = pt.getBlockY();
final int z = pt.getBlockZ();
final int x = pt.x();
final int y = pt.y();
final int z = pt.z();
BlockVector3 dir = getDirection(pt);
if (dir == null) {
getDir:
@ -37,7 +37,7 @@ public class ScatterOverlayBrush extends ScatterBrush {
return;
}
}
editSession.setBlock(x + dir.getBlockX(), y + dir.getBlockY(), z + dir.getBlockZ(), p);
editSession.setBlock(x + dir.x(), y + dir.y(), z + dir.z(), p);
}
}

View File

@ -80,13 +80,13 @@ public class ShatterBrush extends ScatterBrush {
}
for (int i1 = 0; i1 < BreadthFirstSearch.DIAGONAL_DIRECTIONS.length; i1++) {
BlockVector3 direction = BreadthFirstSearch.DIAGONAL_DIRECTIONS[i1];
int x2 = x + direction.getBlockX();
int y2 = y + direction.getBlockY();
int z2 = z + direction.getBlockZ();
int x2 = x + direction.x();
int y2 = y + direction.y();
int z2 = z + direction.z();
// Check boundary
int dx = position.getBlockX() - x2;
int dy = position.getBlockY() - y2;
int dz = position.getBlockZ() - z2;
int dx = position.x() - x2;
int dy = position.y() - y2;
int dz = position.z() - z2;
int dSqr = (dx * dx) + (dy * dy) + (dz * dz);
if (dSqr <= radius2) {
BlockVector3 bv = mutable.setComponents(x2, y2, z2);

View File

@ -130,9 +130,9 @@ public class SplineBrush implements Brush, ResettableTool {
private Vector3 getCentroid(Collection<BlockVector3> points) {
MutableVector3 sum = new MutableVector3();
for (BlockVector3 p : points) {
sum.mutX(sum.getX() + p.getX());
sum.mutY(sum.getY() + p.getY());
sum.mutZ(sum.getZ() + p.getZ());
sum.mutX(sum.x() + p.x());
sum.mutY(sum.y() + p.y());
sum.mutZ(sum.z() + p.z());
}
return sum.multiply(1.0 / points.size());
}

View File

@ -38,16 +38,16 @@ public class SurfaceSpline implements Brush {
int minY = editSession.getMinY();
if (path.isEmpty() || !pos.equals(path.get(path.size() - 1))) {
int max = editSession.getNearestSurfaceTerrainBlock(
pos.getBlockX(),
pos.getBlockZ(),
pos.getBlockY(),
pos.x(),
pos.z(),
pos.y(),
minY,
maxY
);
if (max == -1) {
return;
}
path.add(BlockVector3.at(pos.getBlockX(), max, pos.getBlockZ()));
path.add(BlockVector3.at(pos.x(), max, pos.z()));
if (editSession.getActor() != null) {
editSession.getActor().print(Caption.of("fawe.worldedit.brush.spline.primary.2"));
}
@ -69,9 +69,9 @@ public class SurfaceSpline implements Brush {
LocalBlockVectorSet vset = new LocalBlockVectorSet();
for (double loop = 0; loop <= 1; loop += 1D / splinelength / quality) {
final Vector3 tipv = interpol.getPosition(loop);
final int tipx = MathMan.roundInt(tipv.getX());
final int tipz = (int) tipv.getZ();
int tipy = MathMan.roundInt(tipv.getY());
final int tipx = MathMan.roundInt(tipv.x());
final int tipz = (int) tipv.z();
int tipy = MathMan.roundInt(tipv.y());
tipy = editSession.getNearestSurfaceTerrainBlock(tipx, tipz, tipy, minY, maxY, Integer.MIN_VALUE, Integer.MAX_VALUE);
if (tipy == Integer.MIN_VALUE || tipy == Integer.MAX_VALUE) {
continue;
@ -88,15 +88,15 @@ public class SurfaceSpline implements Brush {
LocalBlockVectorSet newSet = new LocalBlockVectorSet();
final int ceilrad = (int) Math.ceil(radius);
for (BlockVector3 v : vset) {
final int tipx = v.getBlockX();
final int tipz = v.getBlockZ();
final int tipx = v.x();
final int tipz = v.z();
for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
if (MathMan.hypot2(loopx - tipx, 0, loopz - tipz) <= radius2) {
int y = editSession.getNearestSurfaceTerrainBlock(
loopx,
loopz,
v.getBlockY(),
v.y(),
minY,
maxY,
Integer.MIN_VALUE,

View File

@ -83,7 +83,7 @@ public class ClipboardSpline extends Spline {
Region region = clipboard.getRegion();
BlockVector3 origin = clipboard.getOrigin();
// center = region.getCenter().setY(origin.getY() - 1);
center = region.getCenter().withY(origin.getY() - 1).toBlockPoint();
center = region.getCenter().withY(origin.y() - 1).toBlockPoint();
this.centerOffset = center.subtract(center.round());
this.center = center.subtract(centerOffset);
this.transform = transform;
@ -108,15 +108,15 @@ public class ClipboardSpline extends Spline {
clipboardHolder.setTransform(transform);
BlockVector3 functionOffset = target.subtract(clipboard.getOrigin());
final int offX = functionOffset.getBlockX();
final int offY = functionOffset.getBlockY();
final int offZ = functionOffset.getBlockZ();
final int offX = functionOffset.x();
final int offY = functionOffset.y();
final int offZ = functionOffset.z();
Operation operation = clipboardHolder
.createPaste(editSession)
.to(target)
.ignoreAirBlocks(true)
.filter(v -> buffer.add(v.getBlockX() + offX, v.getBlockY() + offY, v.getBlockZ() + offZ))
.filter(v -> buffer.add(v.x() + offX, v.y() + offY, v.z() + offZ))
.build();
Operations.completeLegacy(operation);

View File

@ -121,7 +121,7 @@ public abstract class Spline {
* 2 dimensional "cross" product. cross2D(v1, v2) = |v1|*|v2|*sin(theta) or v1 X v2 taking Y to be 0
*/
private double cross2D(Vector2 v1, Vector2 v2) {
return v1.getX() * v2.getZ() - v2.getX() * v1.getZ();
return v1.x() * v2.z() - v2.x() * v1.z();
}
/**
@ -144,7 +144,7 @@ public abstract class Spline {
// Calculate rotation from spline
Vector3 deriv = interpolation.get1stDerivative(position);
Vector2 deriv2D = Vector2.at(deriv.getX(), deriv.getZ()).normalize();
Vector2 deriv2D = Vector2.at(deriv.x(), deriv.z()).normalize();
double angle = Math.toDegrees(
-Math.atan2(cross2D(direction, deriv2D), direction.dot(deriv2D))
);

View File

@ -79,13 +79,13 @@ public class SweepBrush implements Brush, ResettableTool {
Clipboard clipboard = holder.getClipboard();
BlockVector3 dimensions = clipboard.getDimensions();
double quality = Math.max(dimensions.getBlockX(), dimensions.getBlockZ());
double quality = Math.max(dimensions.x(), dimensions.z());
AffineTransform transform = new AffineTransform();
ClipboardSpline spline = new ClipboardSpline(editSession, holder, interpol, transform, nodes.size());
if (dimensions.getBlockX() > dimensions.getBlockZ()) {
if (dimensions.x() > dimensions.z()) {
spline.setDirection(Vector2.at(0, 1));
}

View File

@ -179,13 +179,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
}
try (PreparedStatement stmt = connection.prepareStatement(stmtStr.formatted(this.prefix))) {
stmt.setInt(1, (int) (minTime / 1000));
stmt.setInt(2, pos1.getBlockX());
stmt.setInt(3, pos2.getBlockX());
stmt.setInt(4, pos1.getBlockZ());
stmt.setInt(5, pos2.getBlockZ());
stmt.setInt(2, pos1.x());
stmt.setInt(3, pos2.x());
stmt.setInt(4, pos1.z());
stmt.setInt(5, pos2.z());
// Keep 128 offset for backwards-compatibility
stmt.setInt(6, pos1.getBlockY() - 128);
stmt.setInt(7, pos2.getBlockY() - 128);
stmt.setInt(6, pos1.y() - 128);
stmt.setInt(7, pos2.y() - 128);
if (uuid != null) {
byte[] uuidBytes = toBytes(uuid);
stmt.setBytes(8, uuidBytes);
@ -210,13 +210,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
.array();
stmt.setBytes(1, uuidBytes);
stmt.setInt(2, (int) (minTime / 1000));
stmt.setInt(3, pos1.getBlockX());
stmt.setInt(4, pos2.getBlockX());
stmt.setInt(5, pos1.getBlockZ());
stmt.setInt(6, pos2.getBlockZ());
stmt.setInt(3, pos1.x());
stmt.setInt(4, pos2.x());
stmt.setInt(5, pos1.z());
stmt.setInt(6, pos2.z());
// Keep 128 offset for backwards-compatibility
stmt.setInt(7, pos1.getBlockY() - 128);
stmt.setInt(8, pos2.getBlockY() - 128);
stmt.setInt(7, pos1.y() - 128);
stmt.setInt(8, pos2.y() - 128);
}
}
return count;
@ -262,13 +262,13 @@ public class RollbackDatabase extends AsyncNotifyQueue {
BlockVector3 pos1 = change.getMinimumPoint();
BlockVector3 pos2 = change.getMaximumPoint();
stmt.setInt(4, pos1.getX());
stmt.setInt(5, pos2.getX());
stmt.setInt(6, pos1.getZ());
stmt.setInt(7, pos2.getZ());
stmt.setInt(4, pos1.x());
stmt.setInt(5, pos2.x());
stmt.setInt(6, pos1.z());
stmt.setInt(7, pos2.z());
// Keep 128 offset for backwards-compatibility
stmt.setInt(8, pos1.getY() - 128);
stmt.setInt(9, pos2.getY() - 128);
stmt.setInt(8, pos1.y() - 128);
stmt.setInt(9, pos2.y() - 128);
stmt.setString(10, change.getCommand());
stmt.setInt(11, change.size());
stmt.executeUpdate();

View File

@ -24,7 +24,7 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block) throws WorldEditException {
return getExtent().setBlock(location.getX() + dx, location.getY() + dy, location.getZ() + dz, block);
return getExtent().setBlock(location.x() + dx, location.y() + dy, location.z() + dz, block);
}
@Override
@ -49,7 +49,7 @@ public class BlockTranslateExtent extends AbstractDelegateExtent {
@Override
public BlockState getBlock(BlockVector3 location) {
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
return getBlock(location.x(), location.y(), location.z());
}
@Override

View File

@ -64,11 +64,11 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
@Override
public final boolean contains(BlockVector3 p) {
return contains(p.getBlockX(), p.getBlockY(), p.getBlockZ());
return contains(p.x(), p.y(), p.z());
}
public final boolean contains(BlockVector2 p) {
return contains(p.getBlockX(), p.getBlockZ());
return contains(p.x(), p.z());
}
@Override
@ -96,7 +96,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
@Override
public BiomeType getBiome(BlockVector3 position) {
return getBiomeType(position.getX(), position.getY(), position.getZ());
return getBiomeType(position.x(), position.y(), position.z());
}
@Override
@ -112,7 +112,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
@Override
public BaseBlock getFullBlock(BlockVector3 position) {
return getFullBlock(position.getX(), position.getY(), position.getZ());
return getFullBlock(position.x(), position.y(), position.z());
}
@Override
@ -128,7 +128,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
@Override
public BlockState getBlock(BlockVector3 position) {
return getBlock(position.getX(), position.getY(), position.getZ());
return getBlock(position.x(), position.y(), position.z());
}
@Override

View File

@ -66,7 +66,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
return setBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
return setBlock(location.x(), location.y(), location.z(), block);
}
@Nullable
@ -111,7 +111,7 @@ public class HistoryExtent extends AbstractDelegateExtent {
public boolean setBiome(BlockVector3 position, BiomeType newBiome) {
BiomeType oldBiome = this.getBiome(position);
if (!oldBiome.getId().equals(newBiome.getId())) {
this.changeSet.addBiomeChange(position.getBlockX(), position.getBlockY(), position.getBlockZ(), oldBiome, newBiome);
this.changeSet.addBiomeChange(position.x(), position.y(), position.z(), oldBiome, newBiome);
return getExtent().setBiome(position, newBiome);
} else {
return false;

View File

@ -373,12 +373,12 @@ public class LimitExtent extends AbstractDelegateExtent {
size = ((Collection<BlockVector3>) positions).size();
} else if (positions instanceof Region) {
BlockVector3 dim = ((Region) positions).getDimensions();
size = dim.getX() * dim.getY() * dim.getZ();
size = dim.x() * dim.y() * dim.z();
} else if (positions instanceof Extent) {
BlockVector3 min = ((Extent) positions).getMinimumPoint();
BlockVector3 max = ((Extent) positions).getMinimumPoint();
BlockVector3 dim = max.subtract(min).add(BlockVector3.ONE);
size = dim.getX() * dim.getY() * dim.getZ();
size = dim.x() * dim.y() * dim.z();
} else {
ExtentFilterBlock block = new ExtentFilterBlock(this);
for (BlockVector3 pos : positions) {

View File

@ -38,9 +38,9 @@ public class PositionTransformExtent extends ResettableExtent {
if (min == null) {
min = pos;
}
mutable.mutX(pos.getX() - min.getX());
mutable.mutY(pos.getY() - min.getY());
mutable.mutZ(pos.getZ() - min.getZ());
mutable.mutX(pos.x() - min.x());
mutable.mutY(pos.y() - min.y());
mutable.mutZ(pos.z() - min.z());
MutableVector3 tmp = new MutableVector3(transform.apply(mutable.toVector3()));
return min.add(tmp.roundHalfUp().toBlockPoint());
}
@ -49,9 +49,9 @@ public class PositionTransformExtent extends ResettableExtent {
if (min == null) {
min = BlockVector3.at(x, y, z);
}
mutable.mutX(x - min.getX());
mutable.mutY(y - min.getY());
mutable.mutZ(z - min.getZ());
mutable.mutX(x - min.x());
mutable.mutY(y - min.y());
mutable.mutZ(z - min.z());
MutableVector3 tmp = new MutableVector3(transform.apply(mutable.toVector3()));
return min.add(tmp.roundHalfUp().toBlockPoint());
}
@ -73,10 +73,10 @@ public class PositionTransformExtent extends ResettableExtent {
@Override
public BiomeType getBiome(BlockVector3 position) {
mutable.mutX(position.getBlockX());
mutable.mutZ(position.getBlockZ());
mutable.mutY(position.getBlockY());
return super.getBiome(getPos(mutable.getX(), mutable.getY(), mutable.getZ()));
mutable.mutX(position.x());
mutable.mutZ(position.z());
mutable.mutY(position.y());
return super.getBiome(getPos(mutable.x(), mutable.y(), mutable.z()));
}
@Override
@ -92,10 +92,10 @@ public class PositionTransformExtent extends ResettableExtent {
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
mutable.mutX(position.getBlockX());
mutable.mutZ(position.getBlockZ());
mutable.mutY(position.getBlockY());
return super.setBiome(getPos(mutable.getX(), mutable.getY(), mutable.getZ()), biome);
mutable.mutX(position.x());
mutable.mutZ(position.z());
mutable.mutY(position.y());
return super.setBiome(getPos(mutable.x(), mutable.y(), mutable.z()), biome);
}
public void setTransform(Transform transform) {

View File

@ -80,12 +80,12 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block)
throws WorldEditException {
return setBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
return setBlock(location.x(), location.y(), location.z(), block);
}
@Override
public BlockState getBlock(BlockVector3 location) {
return getBlock(location.getBlockX(), location.getBlockY(), location.getBlockZ());
return getBlock(location.x(), location.y(), location.z());
}
@Override

View File

@ -41,8 +41,8 @@ public class SourceMaskExtent extends TemporalExtent {
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block) throws WorldEditException {
set(location.getBlockX(), location.getBlockY(), location.getBlockZ(), block);
return mask.test(location) && super.setBlock(location.getX(), location.getY(), location.getZ(), block);
set(location.x(), location.y(), location.z(), block);
return mask.test(location) && super.setBlock(location.x(), location.y(), location.z(), block);
}
@Override

View File

@ -44,7 +44,7 @@ public class TemporalExtent extends PassthroughExtent {
@Override
public BlockState getBlock(BlockVector3 position) {
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
if (position.x() == x && position.y() == y && position.z() == z) {
return block.toImmutableState();
}
return super.getBlock(position);
@ -60,7 +60,7 @@ public class TemporalExtent extends PassthroughExtent {
@Override
public BaseBlock getFullBlock(BlockVector3 position) {
if (position.getX() == x && position.getY() == y && position.getZ() == z) {
if (position.x() == x && position.y() == y && position.z() == z) {
if (block instanceof BaseBlock) {
return (BaseBlock) block;
} else {
@ -72,7 +72,7 @@ public class TemporalExtent extends PassthroughExtent {
@Override
public BiomeType getBiome(BlockVector3 position) {
if (position.getX() == bx && position.getZ() == bz) {
if (position.x() == bx && position.z() == bz) {
return biome;
}
return super.getBiome(position);

View File

@ -55,13 +55,13 @@ public class TransformExtent extends BlockTransformExtent {
if (min == null) {
min = pos;
}
mutable1.mutX(pos.getX() - min.getX());
mutable1.mutY(pos.getY() - min.getY());
mutable1.mutZ(pos.getZ() - min.getZ());
mutable1.mutX(pos.x() - min.x());
mutable1.mutY(pos.y() - min.y());
mutable1.mutZ(pos.z() - min.z());
Vector3 tmp = getTransform().apply(mutable1);
mutable2.mutX(tmp.getX() + min.getX());
mutable2.mutY(tmp.getY() + min.getY());
mutable2.mutZ(tmp.getZ() + min.getZ());
mutable2.mutX(tmp.x() + min.x());
mutable2.mutY(tmp.y() + min.y());
mutable2.mutZ(tmp.z() + min.z());
return mutable2;
}
@ -69,20 +69,20 @@ public class TransformExtent extends BlockTransformExtent {
if (min == null) {
min = BlockVector3.at(x, y, z);
}
mutable1.mutX(x - min.getX());
mutable1.mutY(y - min.getY());
mutable1.mutZ(z - min.getZ());
mutable1.mutX(x - min.x());
mutable1.mutY(y - min.y());
mutable1.mutZ(z - min.z());
Vector3 tmp = getTransform().apply(mutable1);
mutable2.mutX(tmp.getX() + min.getX());
mutable2.mutY(tmp.getY() + min.getY());
mutable2.mutZ(tmp.getZ() + min.getZ());
mutable2.mutX(tmp.x() + min.x());
mutable2.mutY(tmp.y() + min.y());
mutable2.mutZ(tmp.z() + min.z());
return tmp.toBlockPoint();
}
@Override
public BlockState getBlock(int x, int y, int z) {
BlockVector3 p = getPos(x, y, z);
return transform(super.getBlock(p.getX(), p.getY(), p.getZ()));
return transform(super.getBlock(p.x(), p.y(), p.z()));
}
@Override
@ -93,7 +93,7 @@ public class TransformExtent extends BlockTransformExtent {
@Override
public BiomeType getBiomeType(int x, int y, int z) {
BlockVector3 p = getPos(x, y, z);
return super.getBiomeType(p.getX(), y, p.getZ());
return super.getBiomeType(p.x(), y, p.z());
}
@Override
@ -114,7 +114,7 @@ public class TransformExtent extends BlockTransformExtent {
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
BlockVector3 p = getPos(x, y, z);
return super.setBiome(p.getX(), p.getY(), p.getZ(), biome);
return super.setBiome(p.x(), p.y(), p.z(), biome);
}
}

View File

@ -41,7 +41,7 @@ public class CPUOptimizedClipboard extends LinearClipboard {
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
return setBiome(position.x(), position.y(), position.z(), biome);
}
@Override
@ -92,7 +92,7 @@ public class CPUOptimizedClipboard extends LinearClipboard {
@Override
public BiomeType getBiome(BlockVector3 position) {
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
}
public void convertTilesToIndex() {

View File

@ -359,7 +359,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
return setBiome(position.x(), position.y(), position.z(), biome);
}
@Override
@ -417,7 +417,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
@Override
public BiomeType getBiome(BlockVector3 position) {
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
}
public BlockArrayClipboard toClipboard() {
@ -438,9 +438,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
super.setOrigin(origin);
origin = origin.subtract(offset);
try {
byteBuffer.putShort(10, (short) origin.getBlockX());
byteBuffer.putShort(12, (short) origin.getBlockY());
byteBuffer.putShort(14, (short) origin.getBlockZ());
byteBuffer.putShort(10, (short) origin.x());
byteBuffer.putShort(12, (short) origin.y());
byteBuffer.putShort(14, (short) origin.z());
} catch (Throwable e) {
e.printStackTrace();
}
@ -450,9 +450,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
protected void setOffset(BlockVector3 offset) {
super.setOffset(offset);
try {
byteBuffer.putShort(16, (short) offset.getBlockX());
byteBuffer.putShort(18, (short) offset.getBlockY());
byteBuffer.putShort(20, (short) offset.getBlockZ());
byteBuffer.putShort(16, (short) offset.x());
byteBuffer.putShort(18, (short) offset.y());
byteBuffer.putShort(20, (short) offset.z());
} catch (Throwable e) {
e.printStackTrace();
}
@ -588,9 +588,9 @@ public class DiskOptimizedClipboard extends LinearClipboard {
CompoundTag data = entity.getState().getNbtData();
HashMap<String, Tag> value = new HashMap<>(data.getValue());
List<DoubleTag> pos = new ArrayList<>(3);
pos.add(new DoubleTag(entity.getLocation().getX()));
pos.add(new DoubleTag(entity.getLocation().getX()));
pos.add(new DoubleTag(entity.getLocation().getX()));
pos.add(new DoubleTag(entity.getLocation().x()));
pos.add(new DoubleTag(entity.getLocation().x()));
pos.add(new DoubleTag(entity.getLocation().x()));
value.put("Pos", new ListTag(DoubleTag.class, pos));
nbtOS.writeTag(new CompoundTag(value));
}

View File

@ -64,7 +64,7 @@ public class MemoryOptimizedClipboard extends LinearClipboard {
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
return setBiome(position.getX(), position.getY(), position.getZ(), biome);
return setBiome(position.x(), position.y(), position.z(), biome);
}
@Override
@ -115,7 +115,7 @@ public class MemoryOptimizedClipboard extends LinearClipboard {
@Override
public BiomeType getBiome(BlockVector3 position) {
return getBiome(getBiomeIndex(position.getX(), position.getY(), position.getZ()));
return getBiome(getBiomeIndex(position.x(), position.y(), position.z()));
}
private int getOrdinal(int index) {

View File

@ -70,17 +70,17 @@ public abstract class SimpleClipboard implements Clipboard {
@Override
public final int getWidth() {
return size.getBlockX();
return size.x();
}
@Override
public final int getHeight() {
return size.getBlockY();
return size.y();
}
@Override
public final int getLength() {
return size.getBlockZ();
return size.z();
}
@Override

View File

@ -56,7 +56,7 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
@Override
public BiomeType getBiome(BlockVector3 position) {
return getExtent().getBiomeType(position.getX(), position.getY(), position.getZ());
return getExtent().getBiomeType(position.x(), position.y(), position.z());
}
@Override

View File

@ -396,8 +396,8 @@ public class FastSchematicReader extends NBTSchematicReader {
int locY = loc.getBlockY();
int locZ = loc.getBlockZ();
BlockVector3 max = min.add(dimensions).subtract(BlockVector3.ONE);
if (locX < min.getX() || locY < min.getY() || locZ < min.getZ()
|| locX > max.getX() || locY > max.getY() || locZ > max.getZ()) {
if (locX < min.x() || locY < min.y() || locZ < min.z()
|| locX > max.x() || locY > max.y() || locZ > max.z()) {
for (Entity e : clipboard.getEntities()) {
clipboard.removeEntity(e);
}

View File

@ -114,15 +114,15 @@ public class FastSchematicWriter implements ClipboardWriter {
// The Sponge format Offset refers to the 'min' points location in the world. That's our 'Origin'
out.writeNamedTag("Offset", new int[]{
min.getBlockX(),
min.getBlockY(),
min.getBlockZ(),
min.x(),
min.y(),
min.z(),
});
out.writeLazyCompoundTag("Metadata", out1 -> {
out1.writeNamedTag("WEOffsetX", offset.getBlockX());
out1.writeNamedTag("WEOffsetY", offset.getBlockY());
out1.writeNamedTag("WEOffsetZ", offset.getBlockZ());
out1.writeNamedTag("WEOffsetX", offset.x());
out1.writeNamedTag("WEOffsetY", offset.y());
out1.writeNamedTag("WEOffsetZ", offset.z());
out1.writeNamedTag("FAWEVersion", Fawe.instance().getVersion().build);
});
@ -162,9 +162,9 @@ public class FastSchematicWriter implements ClipboardWriter {
// Dum.
values.remove("id");
values.put("Pos", new IntArrayTag(new int[]{
pos.getX(),
pos.getY(),
pos.getZ()
pos.x(),
pos.y(),
pos.z()
}));
numTiles++;
@ -282,10 +282,10 @@ public class FastSchematicWriter implements ClipboardWriter {
int length = clipboard.getRegion().getLength();
MutableBlockVector3 mutable = new MutableBlockVector3();
for (int z = 0, i = 0; z < length; z++) {
int z0 = min.getBlockZ() + z;
int z0 = min.z() + z;
for (int x = 0; x < width; x++, i++) {
int x0 = min.getBlockX() + x;
BiomeType biome = clipboard.getBiome(mutable.setComponents(x0, min.getY(), z0));
int x0 = min.x() + x;
BiomeType biome = clipboard.getBiome(mutable.setComponents(x0, min.y(), z0));
task.applyInt(i, biome.getInternalId());
}
}

View File

@ -213,8 +213,8 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
if (block.getBlockType() != BlockTypes.STRUCTURE_VOID) {
int combined = block.getInternalId();
int index = indexes.get(combined);
List<Integer> pos = Arrays.asList(point.getX() - min.getX(),
point.getY() - min.getY(), point.getZ() - min.getZ()
List<Integer> pos = Arrays.asList(point.x() - min.x(),
point.y() - min.y(), point.z() - min.z()
);
if (!block.hasNbtData()) {
blocks.add(FaweCache.INSTANCE.asMap("state", index, "pos", pos));
@ -231,7 +231,7 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
ArrayList<Map<String, Object>> entities = new ArrayList<>();
for (Entity entity : clipboard.getEntities()) {
Location loc = entity.getLocation();
List<Double> pos = Arrays.asList(loc.getX(), loc.getY(), loc.getZ());
List<Double> pos = Arrays.asList(loc.x(), loc.y(), loc.z());
List<Integer> blockPos = Arrays.asList(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
BaseEntity state = entity.getState();
if (state != null) {

View File

@ -75,9 +75,9 @@ public class PNGWriter implements ClipboardWriter {
MutableBlockVector3 mutableLeft = new MutableBlockVector3(0, 0, 0);
BlockVector3 min = clipboard.getMinimumPoint();
int y0 = min.getBlockY();
int z0 = min.getBlockZ();
int x0 = min.getBlockX();
int y0 = min.y();
int z0 = min.z();
int x0 = min.x();
for (int x = x0; x < x0 + width; x++) {
mutable.mutX(x);
mutableTop.mutX(x);

View File

@ -20,7 +20,7 @@ public class ArrayImageMask implements FilterBlockMask {
@Override
public boolean applyBlock(FilterBlock block) {
int height = image.getRGB(block.getX(), block.getZ()) & 0xFF;
int height = image.getRGB(block.x(), block.z()) & 0xFF;
return height == 255 || height > 0 && !white && random.nextInt(256) <= height;
}

View File

@ -83,18 +83,18 @@ public abstract class AbstractSingleFilterBlock extends FilterBlock {
@Override
public BlockVector3 getMinimumPoint() {
return at(getX(), getY(), getZ());
return at(x(), y(), z());
}
@Override
public BlockVector3 getMaximumPoint() {
return at(getX(), getY(), getZ());
return at(x(), y(), z());
}
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block)
throws WorldEditException {
if (x == this.getX() && y == this.getY() && z == this.getZ()) {
if (x == this.x() && y == this.y() && z == this.z()) {
setFullBlock(block.toBaseBlock());
return true;
}

View File

@ -30,9 +30,9 @@ public class EntityInBlockRemovingProcessor implements IBatchProcessor {
continue;
}
BlockVector3 pos = tag.getEntityPosition().toBlockPoint();
int x = pos.getX() & 15;
int y = pos.getY();
int z = pos.getZ() & 15;
int x = pos.x() & 15;
int y = pos.y();
int z = pos.z() & 15;
if (!set.hasSection(y >> 4)) {
continue;
}

View File

@ -273,9 +273,9 @@ public class NMSRelighter implements Relighter {
int lightLevel = (int) val[1];
this.computeRemoveBlockLight(
node.getX() - 1,
node.getY(),
node.getZ(),
node.x() - 1,
node.y(),
node.z(),
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
@ -283,20 +283,20 @@ public class NMSRelighter implements Relighter {
visited
);
this.computeRemoveBlockLight(
node.getX() + 1,
node.getY(),
node.getZ(),
node.x() + 1,
node.y(),
node.z(),
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
removalVisited,
visited
);
if (node.getY() > minY) {
if (node.y() > minY) {
this.computeRemoveBlockLight(
node.getX(),
node.getY() - 1,
node.getZ(),
node.x(),
node.y() - 1,
node.z(),
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
@ -304,11 +304,11 @@ public class NMSRelighter implements Relighter {
visited
);
}
if (node.getY() < maxY) {
if (node.y() < maxY) {
this.computeRemoveBlockLight(
node.getX(),
node.getY() + 1,
node.getZ(),
node.x(),
node.y() + 1,
node.z(),
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
@ -317,9 +317,9 @@ public class NMSRelighter implements Relighter {
);
}
this.computeRemoveBlockLight(
node.getX(),
node.getY(),
node.getZ() - 1,
node.x(),
node.y(),
node.z() - 1,
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
@ -327,9 +327,9 @@ public class NMSRelighter implements Relighter {
visited
);
this.computeRemoveBlockLight(
node.getX(),
node.getY(),
node.getZ() + 1,
node.x(),
node.y(),
node.z() + 1,
lightLevel,
lightRemovalQueue,
lightPropagationQueue,
@ -340,27 +340,27 @@ public class NMSRelighter implements Relighter {
while (!lightPropagationQueue.isEmpty()) {
MutableBlockVector3 node = lightPropagationQueue.poll();
ChunkHolder<?> iChunk = (ChunkHolder<?>) queue.getOrCreateChunk(node.getX() >> 4, node.getZ() >> 4);
ChunkHolder<?> iChunk = (ChunkHolder<?>) queue.getOrCreateChunk(node.x() >> 4, node.z() >> 4);
if (!iChunk.isInit()) {
iChunk.init(queue, node.getX() >> 4, node.getZ() >> 4);
iChunk.init(queue, node.x() >> 4, node.z() >> 4);
}
int lightLevel = iChunk.getEmittedLight(node.getX() & 15, node.getY(), node.getZ() & 15);
BlockState state = this.queue.getBlock(node.getX(), node.getY(), node.getZ());
int lightLevel = iChunk.getEmittedLight(node.x() & 15, node.y(), node.z() & 15);
BlockState state = this.queue.getBlock(node.x(), node.y(), node.z());
String id = state.getBlockType().getId().toLowerCase(Locale.ROOT);
if (lightLevel <= 1) {
continue;
}
if (id.contains("slab")) {
boolean top = state.getState(slabHalf).equalsIgnoreCase("top");
computeSlab(node.getX(), node.getY(), node.getZ(), lightLevel, lightPropagationQueue, visited, top);
computeSlab(node.x(), node.y(), node.z(), lightLevel, lightPropagationQueue, visited, top);
} else if (id.contains("stair")) {
boolean top = state.getState(stairHalf).equalsIgnoreCase("top");
Direction direction = getStairDir(state);
String shape = getStairShape(state);
computeStair(
node.getX(),
node.getY(),
node.getZ(),
node.x(),
node.y(),
node.z(),
lightLevel,
lightPropagationQueue,
visited,
@ -369,7 +369,7 @@ public class NMSRelighter implements Relighter {
shape
);
} else {
computeNormal(node.getX(), node.getY(), node.getZ(), lightLevel, lightPropagationQueue, visited);
computeNormal(node.x(), node.y(), node.z(), lightLevel, lightPropagationQueue, visited);
}
}
}

View File

@ -30,9 +30,9 @@ public class OffsetTransform extends ResettableExtent {
@Override
public boolean setBiome(BlockVector3 location, BiomeType biome) {
int x = location.getX() + dx;
int y = location.getX() + dy;
int z = location.getX() + dz;
int x = location.x() + dx;
int y = location.x() + dy;
int z = location.x() + dz;
if (!getExtent().contains(x, y, z)) {
return false;
}
@ -53,9 +53,9 @@ public class OffsetTransform extends ResettableExtent {
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block)
throws WorldEditException {
int x = location.getX() + dx;
int y = location.getX() + dy;
int z = location.getX() + dz;
int x = location.x() + dx;
int y = location.x() + dy;
int z = location.x() + dz;
if (!getExtent().contains(x, y, z)) {
return false;
}

View File

@ -34,9 +34,9 @@ public class RandomOffsetTransform extends ResettableExtent {
@Override
public boolean setBiome(BlockVector3 position, BiomeType biome) {
int x = position.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
int y = position.getBlockY() + random.nextInt(1 + (dy << 1)) - dy;
int z = position.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
int x = position.x() + random.nextInt(1 + (dx << 1)) - dx;
int y = position.y() + random.nextInt(1 + (dy << 1)) - dy;
int z = position.z() + random.nextInt(1 + (dz << 1)) - dz;
if (!getExtent().contains(x, y, z)) {
return false;
}
@ -57,9 +57,9 @@ public class RandomOffsetTransform extends ResettableExtent {
@Override
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 pos, T block)
throws WorldEditException {
int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
int y = pos.getBlockY() + random.nextInt(1 + (dy << 1)) - dy;
int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
int x = pos.x() + random.nextInt(1 + (dx << 1)) - dx;
int y = pos.y() + random.nextInt(1 + (dy << 1)) - dy;
int z = pos.z() + random.nextInt(1 + (dz << 1)) - dz;
if (!getExtent().contains(x, y, z)) {
return false;
}

View File

@ -55,9 +55,9 @@ public class ScaleTransform extends ResettableExtent {
if (min == null) {
min = pos;
}
mutable.mutX(min.getX() + (pos.getX() - min.getX()) * dx);
mutable.mutY(min.getY() + (pos.getY() - min.getY()) * dy);
mutable.mutZ(min.getZ() + (pos.getZ() - min.getZ()) * dz);
mutable.mutX(min.x() + (pos.x() - min.x()) * dx);
mutable.mutY(min.y() + (pos.y() - min.y()) * dy);
mutable.mutZ(min.z() + (pos.z() - min.z()) * dz);
return new MutableVector3(mutable);
}
@ -65,9 +65,9 @@ public class ScaleTransform extends ResettableExtent {
if (min == null) {
min = BlockVector3.at(x, y, z);
}
mutable.mutX(min.getX() + (x - min.getX()) * dx);
mutable.mutY(min.getY() + (y - min.getY()) * dy);
mutable.mutZ(min.getZ() + (z - min.getZ()) * dz);
mutable.mutX(min.x() + (x - min.x()) * dx);
mutable.mutY(min.y() + (y - min.y()) * dy);
mutable.mutZ(min.z() + (z - min.z()) * dz);
return new MutableVector3(mutable);
}
@ -77,15 +77,15 @@ public class ScaleTransform extends ResettableExtent {
boolean result = false;
MutableVector3 vector3 = getPos(location);
MutableBlockVector3 pos = new MutableBlockVector3();
double sx = vector3.getX();
double sy = vector3.getY();
double sz = vector3.getZ();
double sx = vector3.x();
double sy = vector3.y();
double sz = vector3.z();
double ex = sx + dx;
double ey = Math.max(minY, Math.min(maxy, sy + dy));
double ez = sz + dz;
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
if (!getExtent().contains(pos)) {
continue;
}
@ -101,15 +101,15 @@ public class ScaleTransform extends ResettableExtent {
boolean result = false;
MutableVector3 vector3 = getPos(position);
MutableBlockVector3 pos = new MutableBlockVector3();
double sx = vector3.getX();
double sy = vector3.getY();
double sz = vector3.getZ();
double sx = vector3.x();
double sy = vector3.y();
double sz = vector3.z();
double ex = sx + dx;
double ey = Math.max(minY, Math.min(maxy, sy + dy));
double ez = sz + dz;
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
if (!getExtent().contains(pos)) {
continue;
}
@ -126,15 +126,15 @@ public class ScaleTransform extends ResettableExtent {
boolean result = false;
MutableVector3 vector3 = getPos(x1, y1, z1);
MutableBlockVector3 pos = new MutableBlockVector3();
double sx = vector3.getX();
double sy = vector3.getY();
double sz = vector3.getZ();
double ex = vector3.getX() + dx;
double sx = vector3.x();
double sy = vector3.y();
double sz = vector3.z();
double ex = vector3.x() + dx;
double ey = Math.min(maxy, sy + dy);
double ez = vector3.getZ() + dz;
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
double ez = vector3.z() + dz;
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
if (!getExtent().contains(pos)) {
continue;
}
@ -150,15 +150,15 @@ public class ScaleTransform extends ResettableExtent {
boolean result = false;
MutableVector3 vector3 = getPos(x1, y1, z1);
MutableBlockVector3 pos = new MutableBlockVector3();
double sx = vector3.getX();
double sy = vector3.getY();
double sz = vector3.getZ();
double sx = vector3.x();
double sy = vector3.y();
double sz = vector3.z();
double ex = sx + dx;
double ey = Math.max(minY, Math.min(maxy, sy + dy));
double ez = sz + dz;
for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
for (pos.mutY(sy); pos.y() < ey; pos.mutY(pos.y() + 1)) {
for (pos.mutZ(sz); pos.z() < ez; pos.mutZ(pos.z() + 1)) {
for (pos.mutX(sx); pos.x() < ex; pos.mutX(pos.x() + 1)) {
if (!getExtent().contains(pos)) {
continue;
}

View File

@ -27,11 +27,11 @@ public abstract class SelectTransform extends ResettableExtent {
public abstract AbstractDelegateExtent getExtent(int x, int z);
public Extent getExtent(BlockVector3 pos) {
return getExtent(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
return getExtent(pos.x(), pos.y(), pos.z());
}
public Extent getExtent(BlockVector2 pos) {
return getExtent(pos.getBlockX(), pos.getBlockZ());
return getExtent(pos.x(), pos.z());
}
@Override

View File

@ -26,8 +26,8 @@ public class SurfaceRegionFunction implements FlatRegionFunction {
@Override
public boolean apply(BlockVector2 position) throws WorldEditException {
int x = position.getBlockX();
int z = position.getBlockZ();
int x = position.x();
int z = position.z();
int layer = extent.getNearestSurfaceTerrainBlock(x, z, lastY, minY, maxY, false);
if (layer != -1) {
lastY = layer;

View File

@ -21,11 +21,11 @@ public class BiomeCopy implements RegionFunction {
@Override
public boolean apply(BlockVector3 position) throws WorldEditException {
int x = position.getBlockX();
int y = position.getBlockY();
int z = position.getBlockZ();
if (x != mutableVector.getBlockX() || z != mutableVector.getBlockZ() || y != mutableVector
.getBlockY()) {
int x = position.x();
int y = position.y();
int z = position.z();
if (x != mutableVector.x() || z != mutableVector.z() || y != mutableVector
.y()) {
mutableVector.setComponents(x, y, z);
return destination.setBiome(mutableVector, source.getBiome(mutableVector));
}

View File

@ -72,8 +72,8 @@ public class CavesGen extends GenBase {
int maxAngle,
double paramDouble4
) throws WorldEditException {
int bx = chunkPos.getBlockX() << 4;
int bz = chunkPos.getBlockZ() << 4;
int bx = chunkPos.x() << 4;
int bz = chunkPos.z() << 4;
double real_x = bx + 7;
double real_z = bz + 7;

View File

@ -26,8 +26,8 @@ public abstract class GenBase {
public void generate(BlockVector2 chunkPos, Extent chunk) throws WorldEditException {
int i = this.checkAreaSize;
int chunkX = chunkPos.getBlockX();
int chunkZ = chunkPos.getBlockZ();
int chunkX = chunkPos.x();
int chunkZ = chunkPos.z();
for (int x = chunkX - i; x <= chunkX + i; x++) {
for (int z = chunkZ - i; z <= chunkZ + i; z++) {
generateChunk(x, z, chunkPos, chunk);

View File

@ -36,7 +36,7 @@ public class SchemGen implements Resource {
int y = extent.getNearestSurfaceTerrainBlock(
x,
z,
mutable.getBlockY(),
mutable.y(),
this.extent.getMinY(),
this.extent.getMaxY(),
Integer.MIN_VALUE,

View File

@ -44,9 +44,9 @@ public class AdjacentAnyMask extends AbstractMask implements ResettableMask {
}
public BlockVector3 direction(BlockVector3 v) {
int x = v.getBlockX();
int y = v.getBlockY();
int z = v.getBlockZ();
int x = v.x();
int y = v.y();
int z = v.z();
if (mask.test(mutable.setComponents(x + 1, y, z))) {
return mutable.setComponents(1, 0, 0);
} else if (mask.test(mutable.setComponents(x - 1, y, z))) {

View File

@ -22,9 +22,9 @@ public class AdjacentMask extends AbstractMask {
@Override
public boolean test(BlockVector3 bv) {
vector.setComponents(bv);
double x = bv.getX();
double y = bv.getY();
double z = bv.getZ();
double x = bv.x();
double y = bv.y();
double z = bv.z();
vector.mutX(x + 1);
int count = 0;
if (mask.test(vector) && ++count == min && max >= 8) {

View File

@ -127,9 +127,9 @@ public class AngleMask extends AbstractExtentMask implements ResettableMask {
}
private boolean adjacentAir(Extent extent, MutableBlockVector3 mutable) {
int x = mutable.getBlockX();
int y = mutable.getBlockY();
int z = mutable.getBlockZ();
int x = mutable.x();
int y = mutable.y();
int z = mutable.z();
if (!mask.test(extent, mutable.setComponents(x + 1, y, z))) {
return true;
}
@ -154,23 +154,23 @@ public class AngleMask extends AbstractExtentMask implements ResettableMask {
if (!mask.test(vector)) {
return false;
}
int y = vector.getBlockY();
int y = vector.y();
if (overlay) {
MutableBlockVector3 mutable = new MutableBlockVector3(vector);
if (y < maxY && !adjacentAir(null, mutable)) {
return false;
}
}
int x = vector.getBlockX();
int z = vector.getBlockZ();
int x = vector.x();
int z = vector.z();
return testSlope(getExtent(), x, y, z);
}
@Override
public boolean test(final Extent extent, final BlockVector3 vector) {
int x = vector.getBlockX();
int y = vector.getBlockY();
int z = vector.getBlockZ();
int x = vector.x();
int y = vector.y();
int z = vector.z();
if ((lastX == (lastX = x) & lastZ == (lastZ = z))) {
int height = getHeight(extent, x, y, z);

View File

@ -60,9 +60,9 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
@Override
public boolean test(BlockVector3 vector) {
int x = vector.getX();
int y = vector.getY();
int z = vector.getZ();
int x = vector.x();
int y = vector.y();
int z = vector.z();
try {
boolean check = cache_checked.add(x, y, z);
if (!check) {
@ -88,9 +88,9 @@ public class CachedMask extends AbstractDelegateMask implements ResettableMask {
if (!hasExtent || !(extent instanceof AbstractExtentMask)) {
return test(vector);
}
int x = vector.getX();
int y = vector.getY();
int z = vector.getZ();
int x = vector.x();
int y = vector.y();
int z = vector.z();
AbstractExtentMask mask = (AbstractExtentMask) getMask();
try {
boolean check = cache_checked.add(x, y, z);

View File

@ -62,17 +62,17 @@ public class ImageBrushMask extends AbstractExtentMask {
@Override
public boolean test(BlockVector3 vector) {
if (solid.test(vector)) {
int dx = vector.getBlockX() - center.getBlockX();
int dy = vector.getBlockY() - center.getBlockY();
int dz = vector.getBlockZ() - center.getBlockZ();
int dx = vector.x() - center.x();
int dy = vector.y() - center.y();
int dz = vector.z() - center.z();
Vector3 pos1 = transform.apply(mutable.setComponents(dx - 0.5, dy - 0.5, dz - 0.5));
int x1 = (int) (pos1.getX() * scale + centerImageX);
int z1 = (int) (pos1.getZ() * scale + centerImageZ);
int x1 = (int) (pos1.x() * scale + centerImageX);
int z1 = (int) (pos1.z() * scale + centerImageZ);
Vector3 pos2 = transform.apply(mutable.setComponents(dx + 0.5, dy + 0.5, dz + 0.5));
int x2 = (int) (pos2.getX() * scale + centerImageX);
int z2 = (int) (pos2.getZ() * scale + centerImageZ);
int x2 = (int) (pos2.x() * scale + centerImageX);
int z2 = (int) (pos2.z() * scale + centerImageZ);
if (x2 < x1) {
int tmp = x1;
x1 = x2;

View File

@ -40,20 +40,20 @@ public class LayerBrushMask extends AbstractExtentMask {
BlockState previous2 = layers[depth - 2];
for (BlockVector3 dir : BreadthFirstSearch.DEFAULT_DIRECTIONS) {
mutable.setComponents(
pos.getBlockX() + dir.getBlockX(),
pos.getBlockY() + dir.getBlockY(),
pos.getBlockZ() + dir.getBlockZ()
pos.x() + dir.x(),
pos.y() + dir.y(),
pos.z() + dir.z()
);
if (visitor.isVisited(mutable) && editSession.getBlock(
mutable.getBlockX(),
mutable.getBlockY(),
mutable.getBlockZ()
mutable.x(),
mutable.y(),
mutable.z()
) == previous) {
mutable.setComponents(pos.getBlockX() + dir.getBlockX() * 2, pos.getBlockY() + dir.getBlockY() * 2,
pos.getBlockZ() + dir.getBlockZ() * 2
mutable.setComponents(pos.x() + dir.x() * 2, pos.y() + dir.y() * 2,
pos.z() + dir.z() * 2
);
if (visitor.isVisited(mutable)
&& editSession.getBlock(mutable.getBlockX(), mutable.getBlockY(), mutable.getBlockZ()) == previous2) {
&& editSession.getBlock(mutable.x(), mutable.y(), mutable.z()) == previous2) {
found = true;
break;
} else {

View File

@ -15,9 +15,9 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
public boolean test(BlockVector3 vector) {
switch (mode) {
case -1:
originX = vector.getBlockX();
originY = vector.getBlockY();
originZ = vector.getBlockZ();
originX = vector.x();
originY = vector.y();
originZ = vector.z();
mode = 0;
return true;
case 0:
@ -25,13 +25,13 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
case 2:
case 4:
int original = mode;
if (originX != vector.getBlockX()) {
if (originX != vector.x()) {
mode &= 1;
}
if (originY != vector.getBlockY()) {
if (originY != vector.y()) {
mode &= 2;
}
if (originZ != vector.getBlockZ()) {
if (originZ != vector.z()) {
mode &= 4;
}
if (Integer.bitCount(mode) >= 3) {
@ -39,13 +39,13 @@ public class PlaneMask extends AbstractMask implements ResettableMask {
return false;
}
default:
if (originX != vector.getBlockX() && (mode & 1) == 0) {
if (originX != vector.x() && (mode & 1) == 0) {
return false;
}
if (originZ != vector.getBlockZ() && (mode & 4) == 0) {
if (originZ != vector.z() && (mode & 4) == 0) {
return false;
}
return originY == vector.getBlockY() || (mode & 2) != 0;
return originY == vector.y() || (mode & 2) != 0;
}
}

View File

@ -30,17 +30,17 @@ public class RadiusMask extends AbstractMask implements ResettableMask {
if (pos == null) {
pos = to.toImmutable();
}
int dx = pos.getBlockX() - to.getBlockX();
int dx = pos.x() - to.x();
int d = dx * dx;
if (d > maxSqr) {
return false;
}
int dz = pos.getBlockZ() - to.getBlockZ();
int dz = pos.z() - to.z();
d += dz * dz;
if (d > maxSqr) {
return false;
}
int dy = pos.getBlockY() - to.getBlockY();
int dy = pos.y() - to.y();
d += dy * dy;
return d >= minSqr && d <= maxSqr;
}

View File

@ -19,7 +19,7 @@ public class SimplexMask extends AbstractMask {
@Override
public boolean test(BlockVector3 vector) {
double value = SimplexNoise.noise(vector.getBlockX() * scale, vector.getBlockY() * scale, vector.getBlockZ() * scale);
double value = SimplexNoise.noise(vector.x() * scale, vector.y() * scale, vector.z() * scale);
return value >= min && value <= max;
}

View File

@ -64,13 +64,13 @@ public class StencilBrushMask extends AbstractExtentMask {
@Override
public boolean test(BlockVector3 vector) {
if (solid.test(vector)) {
int dx = vector.getBlockX() - center.getBlockX();
int dy = vector.getBlockY() - center.getBlockY();
int dz = vector.getBlockZ() - center.getBlockZ();
int dx = vector.x() - center.x();
int dy = vector.y() - center.y();
int dz = vector.z() - center.z();
Vector3 srcPos = transform.apply(mutable.setComponents(dx, dy, dz));
dx = MathMan.roundInt(srcPos.getX());
dz = MathMan.roundInt(srcPos.getZ());
dx = MathMan.roundInt(srcPos.x());
dz = MathMan.roundInt(srcPos.z());
int distance = dx * dx + dz * dz;
if (distance > size2 || Math.abs(dx) > 256 || Math.abs(dz) > 256) {
@ -83,7 +83,7 @@ public class StencilBrushMask extends AbstractExtentMask {
return true;
}
if (val >= 255 || ThreadLocalRandom.current().nextInt(maxY) < val) {
editSession.setBlock(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ(), pattern);
editSession.setBlock(vector.x(), vector.y(), vector.z(), pattern);
}
return true;
}

View File

@ -24,7 +24,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
@Override
public boolean test(BlockVector3 vector) {
if (!vector.getBlock(getExtent()).isAir() && nextToAir(vector)) {
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).getY();
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).y();
return (angle >= (min / 90.0) && angle <= (max / 90.0));
}
return false;
@ -33,7 +33,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
@Override
public boolean test(Extent extent, BlockVector3 vector) {
if (!vector.getBlock(getExtent()).isAir() && nextToAir(vector)) {
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).getY();
double angle = 1 - getAverageAirDirection(vector.toVector3(), size).y();
return (angle >= (min / 90.0) && angle <= (max / 90.0));
}
return false;
@ -44,7 +44,7 @@ public class SurfaceAngleMask extends AbstractExtentMask {
for (int i = -size; i <= size; i++) {
for (int j = -size; j <= size; j++) {
for (int k = -size; k <= size; k++) {
Vector3 block = Vector3.at(currentLocation.getX(), currentLocation.getY(), currentLocation.getZ()).add(
Vector3 block = Vector3.at(currentLocation.x(), currentLocation.y(), currentLocation.z()).add(
0.5,
0.5,
0.5
@ -65,13 +65,13 @@ public class SurfaceAngleMask extends AbstractExtentMask {
double y = 0.0;
double z = 0.0;
for (Vector3 vector3 : airDirections) {
x += vector3.getX();
y += vector3.getY();
z += vector3.getZ();
x += vector3.x();
y += vector3.y();
z += vector3.z();
}
Vector3 averageAirDirection = Vector3.at(x / airDirections.size(), y / airDirections.size(), z / airDirections.size());
return (Double.isNaN(averageAirDirection.getY()) ? Vector3.ZERO : averageAirDirection.normalize());
return (Double.isNaN(averageAirDirection.y()) ? Vector3.ZERO : averageAirDirection.normalize());
}
@Override

View File

@ -14,8 +14,8 @@ public class WallMakeMask implements Mask {
@Override
public boolean test(BlockVector3 position) {
int x = position.getBlockX();
int z = position.getBlockZ();
int x = position.x();
int z = position.z();
return !region.contains(x, z + 1) || !region.contains(x, z - 1) || !region.contains(x + 1, z) || !region.contains(
x - 1,
z

View File

@ -23,9 +23,9 @@ public class WallMask extends AbstractMask {
public boolean test(BlockVector3 bv) {
vector.setComponents(bv);
int count = 0;
double x = vector.getX();
double y = vector.getY();
double z = vector.getZ();
double x = vector.x();
double y = vector.y();
double z = vector.z();
vector.mutX(x + 1);
if (mask.test(vector) && ++count == min && max >= 8) {
vector.mutX(x);

View File

@ -16,9 +16,9 @@ public class XAxisMask extends AbstractMask implements ResettableMask {
@Override
public boolean test(BlockVector3 vector) {
if (layer == -1) {
layer = vector.getBlockX();
layer = vector.x();
}
return vector.getBlockX() == layer;
return vector.x() == layer;
}
@Override

View File

@ -14,9 +14,9 @@ public class YAxisMask extends AbstractMask implements ResettableMask {
@Override
public boolean test(BlockVector3 vector) {
if (layer == -1) {
layer = vector.getBlockY();
layer = vector.y();
}
return vector.getBlockY() == layer;
return vector.y() == layer;
}
@Override

View File

@ -14,9 +14,9 @@ public class ZAxisMask extends AbstractMask implements ResettableMask {
@Override
public boolean test(BlockVector3 vector) {
if (layer == -1) {
layer = vector.getBlockZ();
layer = vector.z();
}
return vector.getBlockZ() == layer;
return vector.z() == layer;
}
@Override

View File

@ -42,9 +42,9 @@ public class AngleColorPattern extends AnglePattern {
public <T extends BlockStateHolder<T>> int getSlope(T block, BlockVector3 vector, Extent extent) {
int slope = super.getSlope(block, vector, extent);
if (slope != -1) {
int x = vector.getBlockX();
int y = vector.getBlockY();
int z = vector.getBlockZ();
int x = vector.x();
int y = vector.y();
int z = vector.z();
int height = extent.getNearestSurfaceTerrainBlock(x, z, y, minY, maxY);
if (height > minY) {
BlockState below = extent.getBlock(x, height - 1, z);

View File

@ -31,9 +31,9 @@ public abstract class AnglePattern extends AbstractPattern {
}
public <T extends BlockStateHolder<T>> int getSlope(T block, BlockVector3 vector, Extent extent) {
int x = vector.getBlockX();
int y = vector.getBlockY();
int z = vector.getBlockZ();
int x = vector.x();
int y = vector.y();
int z = vector.z();
if (!block.getBlockType().getMaterial().isMovementBlocker()) {
return -1;
}

View File

@ -33,7 +33,7 @@ public class BufferedPattern2D extends BufferedPattern {
@Override
public boolean set(BlockVector3 pos) {
return set.add(pos.getBlockX(), 0, pos.getBlockY());
return set.add(pos.x(), 0, pos.y());
}
}

View File

@ -50,7 +50,7 @@ public class ExpressionPattern extends AbstractPattern {
if (expression.getEnvironment() instanceof WorldEditExpressionEnvironment) {
((WorldEditExpressionEnvironment) expression.getEnvironment()).setCurrentBlock(vector.toVector3());
}
double combined = expression.evaluate(vector.getX(), vector.getY(), vector.getZ());
double combined = expression.evaluate(vector.x(), vector.y(), vector.z());
return BlockState.getFromOrdinal((int) combined).toBaseBlock();
} catch (EvaluationException e) {
e.printStackTrace();

View File

@ -37,7 +37,7 @@ public class Linear2DBlockPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 position) {
int index = (position.getBlockX() / this.xScale + position.getBlockZ() / this.zScale) % patternsArray.length;
int index = (position.x() / this.xScale + position.z() / this.zScale) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}
@ -46,8 +46,8 @@ public class Linear2DBlockPattern extends AbstractPattern {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
int index = (floorDiv(get.getBlockX(), this.xScale)
+ floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
int index = (floorDiv(get.x(), this.xScale)
+ floorDiv(get.z(), this.zScale)) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}

View File

@ -40,8 +40,8 @@ public class Linear3DBlockPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 position) {
int index = (position.getBlockX() / this.xScale
+ position.getBlockY() / this.yScale + position.getBlockZ() / this.zScale) % patternsArray.length;
int index = (position.x() / this.xScale
+ position.y() / this.yScale + position.z() / this.zScale) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}
@ -50,8 +50,8 @@ public class Linear3DBlockPattern extends AbstractPattern {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
int index = (floorDiv(get.getBlockX(), this.xScale)
+ floorDiv(get.getBlockY(), this.yScale) + floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
int index = (floorDiv(get.x(), this.xScale)
+ floorDiv(get.y(), this.yScale) + floorDiv(get.z(), this.zScale)) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}

View File

@ -24,15 +24,15 @@ public class NoXPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 pos) {
mutable.mutY(pos.getY());
mutable.mutZ(pos.getZ());
mutable.mutY(pos.y());
mutable.mutZ(pos.z());
return pattern.applyBlock(mutable);
}
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
mutable.mutY(get.getY());
mutable.mutZ(get.getZ());
mutable.mutY(get.y());
mutable.mutZ(get.z());
return pattern.apply(extent, mutable, set);
}

View File

@ -24,15 +24,15 @@ public class NoYPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 pos) {
mutable.mutX(pos.getX());
mutable.mutZ(pos.getZ());
mutable.mutX(pos.x());
mutable.mutZ(pos.z());
return pattern.applyBlock(mutable);
}
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
mutable.mutX(get.getX());
mutable.mutZ(get.getZ());
mutable.mutX(get.x());
mutable.mutZ(get.z());
return pattern.apply(extent, mutable, set);
}

View File

@ -1,7 +1,6 @@
package com.fastasyncworldedit.core.function.pattern;
import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.fastasyncworldedit.core.queue.Filter;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.function.pattern.AbstractPattern;
@ -25,15 +24,15 @@ public class NoZPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 pos) {
mutable.mutX(pos.getX());
mutable.mutY(pos.getY());
mutable.mutX(pos.x());
mutable.mutY(pos.y());
return pattern.applyBlock(mutable);
}
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
mutable.mutX(get.getX());
mutable.mutY(get.getY());
mutable.mutX(get.x());
mutable.mutY(get.y());
return pattern.apply(extent, mutable, set);
}

View File

@ -40,10 +40,10 @@ public class OffsetPattern extends AbstractPattern {
@Override
public BaseBlock applyBlock(BlockVector3 position) {
mutable.mutX(position.getX() + dx);
mutable.mutY(position.getY() + dy);
mutable.mutZ(position.getZ() + dz);
if (mutable.getY() < minY || mutable.getY() > maxY) {
mutable.mutX(position.x() + dx);
mutable.mutY(position.y() + dy);
mutable.mutZ(position.z() + dz);
if (mutable.y() < minY || mutable.y() > maxY) {
return BlockTypes.AIR.getDefaultState().toBaseBlock();
}
return pattern.applyBlock(mutable);
@ -51,10 +51,10 @@ public class OffsetPattern extends AbstractPattern {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
mutable.mutX(get.getX() + dx);
mutable.mutY(get.getY() + dy);
mutable.mutZ(get.getZ() + dz);
if (mutable.getY() < extent.getMinY() || mutable.getY() > extent.getMaxY()) {
mutable.mutX(get.x() + dx);
mutable.mutY(get.y() + dy);
mutable.mutZ(get.z() + dz);
if (mutable.y() < extent.getMinY() || mutable.y() > extent.getMaxY()) {
return false;
}
return pattern.apply(extent, get, mutable);

Some files were not shown because too many files have changed in this diff Show More