3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-19 09:20:08 +01:00

Address deprecations in vector classes

Dieser Commit ist enthalten in:
dordsor21 2024-05-31 18:21:21 +01:00
Ursprung f004edda82
Commit 0a5f765823
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
4 geänderte Dateien mit 20 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -111,7 +111,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override
public BlockState getBlock(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getBlock(position);
}
@ -123,7 +123,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override
public BaseBlock getFullBlock(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getFullBlock(position);
}
@ -141,7 +141,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override
public BiomeType getBiome(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getBiome(position);
}
@ -171,7 +171,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override
public boolean setBiome(final BlockVector3 position, final BiomeType biome) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
checkAndRun(position.x() >> 4, position.z() >> 4);
return super.setBiome(position, biome);
}

Datei anzeigen

@ -125,17 +125,17 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
final BlockVector3 origin = this.getOrigin();
// To must be relative to the clipboard origin ( player location - clipboard origin ) (as the locations supplied are relative to the world origin)
final int relx = to.getBlockX() - origin.getBlockX();
final int rely = to.getBlockY() - origin.getBlockY();
final int relz = to.getBlockZ() - origin.getBlockZ();
final int relx = to.x() - origin.x();
final int rely = to.y() - origin.y();
final int relz = to.z() - origin.z();
pasteBiomes &= this.hasBiomes();
for (BlockVector3 pos : this) {
BaseBlock block = pos.getFullBlock(this);
int xx = pos.getX() + relx;
int yy = pos.getY() + rely;
int zz = pos.getZ() + relz;
int xx = pos.x() + relx;
int yy = pos.y() + rely;
int zz = pos.z() + relz;
if (pasteBiomes) {
toExtent.setBiome(xx, yy, zz, pos.getBiome(this));
}
@ -145,9 +145,9 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
toExtent.setBlock(xx, yy, zz, block);
}
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
final int entityOffsetX = to.getBlockX() - origin.getBlockX();
final int entityOffsetY = to.getBlockY() - origin.getBlockY();
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ();
final int entityOffsetX = to.x() - origin.x();
final int entityOffsetY = to.y() - origin.y();
final int entityOffsetZ = to.z() - origin.z();
// entities
for (Entity entity : entities) {
// skip players on pasting schematic
@ -156,8 +156,8 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
continue;
}
Location pos = entity.getLocation();
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX,
pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(),
Location newPos = new Location(pos.getExtent(), pos.x() + entityOffsetX,
pos.y() + entityOffsetY, pos.z() + entityOffsetZ, pos.getYaw(),
pos.getPitch()
);
toExtent.createEntity(newPos, entity.getState());

Datei anzeigen

@ -88,7 +88,7 @@ public class LocalBlockVector2Set implements Set<BlockVector2> {
@Override
public boolean contains(Object o) {
if (o instanceof BlockVector2 v) {
return contains(v.getBlockX(), v.getBlockZ());
return contains(v.x(), v.z());
}
return false;
}
@ -271,11 +271,11 @@ public class LocalBlockVector2Set implements Set<BlockVector2> {
*/
@Override
public boolean add(BlockVector2 vector) {
return add(vector.getBlockX(), vector.getBlockZ());
return add(vector.x(), vector.z());
}
private int getIndex(BlockVector2 vector) {
return getIndex(vector.getX(), vector.getZ());
return getIndex(vector.x(), vector.z());
}
private int getIndex(int x, int z) {
@ -304,7 +304,7 @@ public class LocalBlockVector2Set implements Set<BlockVector2> {
@Override
public boolean remove(Object o) {
if (o instanceof BlockVector2 v) {
return remove(v.getBlockX(), v.getBlockZ());
return remove(v.x(), v.z());
}
return false;
}

Datei anzeigen

@ -761,7 +761,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
int tz = bz + 15;
BlockVector3 min = getMinimumPoint();
BlockVector3 max = getMaximumPoint();
return min.getY() <= chunkMinY && max.getY() >= chunkMaxY && min.getX() <= bx && max.getX() >= tx && min.getZ() <= bz && max.getZ() >= tz;
return min.y() <= chunkMinY && max.y() >= chunkMaxY && min.x() <= bx && max.x() >= tx && min.z() <= bz && max.z() >= tz;
}
@Override