Skip to content

Commit 691fc96

Browse files
committed
Address deprecations in vector classes
1 parent d6179cf commit 691fc96

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/OncePerChunkExtent.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public ProcessorScope getScope() {
111111

112112
@Override
113113
public BlockState getBlock(final BlockVector3 position) {
114-
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
114+
checkAndRun(position.x() >> 4, position.z() >> 4);
115115
return super.getBlock(position);
116116
}
117117

@@ -123,7 +123,7 @@ public BlockState getBlock(final int x, final int y, final int z) {
123123

124124
@Override
125125
public BaseBlock getFullBlock(final BlockVector3 position) {
126-
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
126+
checkAndRun(position.x() >> 4, position.z() >> 4);
127127
return super.getFullBlock(position);
128128
}
129129

@@ -141,7 +141,7 @@ public BiomeType getBiomeType(final int x, final int y, final int z) {
141141

142142
@Override
143143
public BiomeType getBiome(final BlockVector3 position) {
144-
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
144+
checkAndRun(position.x() >> 4, position.z() >> 4);
145145
return super.getBiome(position);
146146
}
147147

@@ -171,7 +171,7 @@ public boolean setBiome(final int x, final int y, final int z, final BiomeType b
171171

172172
@Override
173173
public boolean setBiome(final BlockVector3 position, final BiomeType biome) {
174-
checkAndRun(position.getBlockX() >> 4, position.getBlockZ() >> 4);
174+
checkAndRun(position.x() >> 4, position.z() >> 4);
175175
return super.setBiome(position, biome);
176176
}
177177

worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/WorldCopyClipboard.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ public void paste(Extent toExtent, BlockVector3 to, boolean pasteAir, boolean pa
125125
final BlockVector3 origin = this.getOrigin();
126126

127127
// To must be relative to the clipboard origin ( player location - clipboard origin ) (as the locations supplied are relative to the world origin)
128-
final int relx = to.getBlockX() - origin.getBlockX();
129-
final int rely = to.getBlockY() - origin.getBlockY();
130-
final int relz = to.getBlockZ() - origin.getBlockZ();
128+
final int relx = to.x() - origin.x();
129+
final int rely = to.y() - origin.y();
130+
final int relz = to.z() - origin.z();
131131

132132
pasteBiomes &= this.hasBiomes();
133133

134134
for (BlockVector3 pos : this) {
135135
BaseBlock block = pos.getFullBlock(this);
136-
int xx = pos.getX() + relx;
137-
int yy = pos.getY() + rely;
138-
int zz = pos.getZ() + relz;
136+
int xx = pos.x() + relx;
137+
int yy = pos.y() + rely;
138+
int zz = pos.z() + relz;
139139
if (pasteBiomes) {
140140
toExtent.setBiome(xx, yy, zz, pos.getBiome(this));
141141
}
@@ -145,9 +145,9 @@ public void paste(Extent toExtent, BlockVector3 to, boolean pasteAir, boolean pa
145145
toExtent.setBlock(xx, yy, zz, block);
146146
}
147147
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
148-
final int entityOffsetX = to.getBlockX() - origin.getBlockX();
149-
final int entityOffsetY = to.getBlockY() - origin.getBlockY();
150-
final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ();
148+
final int entityOffsetX = to.x() - origin.x();
149+
final int entityOffsetY = to.y() - origin.y();
150+
final int entityOffsetZ = to.z() - origin.z();
151151
// entities
152152
for (Entity entity : entities) {
153153
// skip players on pasting schematic
@@ -156,8 +156,8 @@ public void paste(Extent toExtent, BlockVector3 to, boolean pasteAir, boolean pa
156156
continue;
157157
}
158158
Location pos = entity.getLocation();
159-
Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX,
160-
pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(),
159+
Location newPos = new Location(pos.getExtent(), pos.x() + entityOffsetX,
160+
pos.y() + entityOffsetY, pos.z() + entityOffsetZ, pos.getYaw(),
161161
pos.getPitch()
162162
);
163163
toExtent.createEntity(newPos, entity.getState());

worldedit-core/src/main/java/com/fastasyncworldedit/core/math/LocalBlockVector2Set.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public boolean contains(int x, int z) {
8888
@Override
8989
public boolean contains(Object o) {
9090
if (o instanceof BlockVector2 v) {
91-
return contains(v.getBlockX(), v.getBlockZ());
91+
return contains(v.x(), v.z());
9292
}
9393
return false;
9494
}
@@ -271,11 +271,11 @@ public boolean add(int x, int z) {
271271
*/
272272
@Override
273273
public boolean add(BlockVector2 vector) {
274-
return add(vector.getBlockX(), vector.getBlockZ());
274+
return add(vector.x(), vector.z());
275275
}
276276

277277
private int getIndex(BlockVector2 vector) {
278-
return getIndex(vector.getX(), vector.getZ());
278+
return getIndex(vector.x(), vector.z());
279279
}
280280

281281
private int getIndex(int x, int z) {
@@ -304,7 +304,7 @@ public boolean remove(int x, int z) {
304304
@Override
305305
public boolean remove(Object o) {
306306
if (o instanceof BlockVector2 v) {
307-
return remove(v.getBlockX(), v.getBlockZ());
307+
return remove(v.x(), v.z());
308308
}
309309
return false;
310310
}

worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ public boolean chunkContainedBy(int chunkX, int chunkZ, int chunkMinY, int chunk
761761
int tz = bz + 15;
762762
BlockVector3 min = getMinimumPoint();
763763
BlockVector3 max = getMaximumPoint();
764-
return min.getY() <= chunkMinY && max.getY() >= chunkMaxY && min.getX() <= bx && max.getX() >= tx && min.getZ() <= bz && max.getZ() >= tz;
764+
return min.y() <= chunkMinY && max.y() >= chunkMaxY && min.x() <= bx && max.x() >= tx && min.z() <= bz && max.z() >= tz;
765765
}
766766

767767
@Override

0 commit comments

Comments
 (0)