3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Address deprecations in vector classes

Dieser Commit ist enthalten in:
dordsor21 2024-05-31 18:21:21 +01:00
Ursprung f3039a9071
Commit f1575b0130
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 @Override
public BlockState getBlock(final BlockVector3 position) { public BlockState getBlock(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4); checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getBlock(position); return super.getBlock(position);
} }
@ -123,7 +123,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override @Override
public BaseBlock getFullBlock(final BlockVector3 position) { public BaseBlock getFullBlock(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4); checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getFullBlock(position); return super.getFullBlock(position);
} }
@ -141,7 +141,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override @Override
public BiomeType getBiome(final BlockVector3 position) { public BiomeType getBiome(final BlockVector3 position) {
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4); checkAndRun(position.x() >> 4, position.z() >> 4);
return super.getBiome(position); return super.getBiome(position);
} }
@ -171,7 +171,7 @@ public class OncePerChunkExtent extends AbstractDelegateExtent implements IBatch
@Override @Override
public boolean setBiome(final BlockVector3 position, final BiomeType biome) { 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); return super.setBiome(position, biome);
} }

Datei anzeigen

@ -125,17 +125,17 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
final BlockVector3 origin = this.getOrigin(); 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) // 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 relx = to.x() - origin.x();
final int rely = to.getBlockY() - origin.getBlockY(); final int rely = to.y() - origin.y();
final int relz = to.getBlockZ() - origin.getBlockZ(); final int relz = to.z() - origin.z();
pasteBiomes &= this.hasBiomes(); pasteBiomes &= this.hasBiomes();
for (BlockVector3 pos : this) { for (BlockVector3 pos : this) {
BaseBlock block = pos.getFullBlock(this); BaseBlock block = pos.getFullBlock(this);
int xx = pos.getX() + relx; int xx = pos.x() + relx;
int yy = pos.getY() + rely; int yy = pos.y() + rely;
int zz = pos.getZ() + relz; int zz = pos.z() + relz;
if (pasteBiomes) { if (pasteBiomes) {
toExtent.setBiome(xx, yy, zz, pos.getBiome(this)); toExtent.setBiome(xx, yy, zz, pos.getBiome(this));
} }
@ -145,9 +145,9 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
toExtent.setBlock(xx, yy, zz, block); 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) // 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 entityOffsetX = to.x() - origin.x();
final int entityOffsetY = to.getBlockY() - origin.getBlockY(); final int entityOffsetY = to.y() - origin.y();
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ(); final int entityOffsetZ = to.z() - origin.z();
// entities // entities
for (Entity entity : entities) { for (Entity entity : entities) {
// skip players on pasting schematic // skip players on pasting schematic
@ -156,8 +156,8 @@ public class WorldCopyClipboard extends ReadOnlyClipboard {
continue; continue;
} }
Location pos = entity.getLocation(); Location pos = entity.getLocation();
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, Location newPos = new Location(pos.getExtent(), pos.x() + entityOffsetX,
pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.y() + entityOffsetY, pos.z() + entityOffsetZ, pos.getYaw(),
pos.getPitch() pos.getPitch()
); );
toExtent.createEntity(newPos, entity.getState()); toExtent.createEntity(newPos, entity.getState());

Datei anzeigen

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

Datei anzeigen

@ -761,7 +761,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
int tz = bz + 15; int tz = bz + 15;
BlockVector3 min = getMinimumPoint(); BlockVector3 min = getMinimumPoint();
BlockVector3 max = getMaximumPoint(); 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 @Override