Update upstream (for 1.19.3 support) #4

Zusammengeführt
Lixfel hat 74 Commits von upstream nach main 2023-02-02 11:32:53 +01:00 zusammengeführt
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen
Nur Änderungen aus Commit 158e51191f werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -7,6 +7,8 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BaseBlock;
import static java.lang.Math.floorDiv;
public class Linear2DBlockPattern extends AbstractPattern {
private final Pattern[] patternsArray;
@ -37,7 +39,8 @@ public class Linear2DBlockPattern extends AbstractPattern {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
int index = (get.getBlockX() / this.xScale + get.getBlockZ() / this.zScale) % patternsArray.length;
int index = (floorDiv(get.getBlockX(), this.xScale)
+ floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}

Datei anzeigen

@ -7,6 +7,8 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BaseBlock;
import static java.lang.Math.floorDiv;
public class Linear3DBlockPattern extends AbstractPattern {
private final Pattern[] patternsArray;
@ -41,8 +43,8 @@ public class Linear3DBlockPattern extends AbstractPattern {
@Override
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
int index = (get.getBlockX() / this.xScale
+ get.getBlockY() / this.yScale + get.getBlockZ() / this.zScale) % patternsArray.length;
int index = (floorDiv(get.getBlockX(), this.xScale)
+ floorDiv(get.getBlockY(), this.yScale) + floorDiv(get.getBlockZ(), this.zScale)) % patternsArray.length;
if (index < 0) {
index += patternsArray.length;
}