mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-04 07:28:17 +01:00
*Whoops
This commit is contained in:
parent
b414229c91
commit
cb4821078e
@ -3,16 +3,19 @@ package com.boydti.fawe.object.pattern;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
|
||||
public class OffsetPattern extends AbstractPattern {
|
||||
|
||||
private final int dx,dy,dz;
|
||||
private final Vector mutable = new Vector();
|
||||
private final Pattern pattern;
|
||||
|
||||
public OffsetPattern(int dx, int dy, int dz) {
|
||||
public OffsetPattern(Pattern pattern, int dx, int dy, int dz) {
|
||||
this.dx = dx;
|
||||
this.dy = dy;
|
||||
this.dz = dz;
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -20,6 +23,6 @@ public class OffsetPattern extends AbstractPattern {
|
||||
mutable.x = position.x + dx;
|
||||
mutable.y = position.y + dy;
|
||||
mutable.z = position.z + dz;
|
||||
return null;
|
||||
return pattern.apply(mutable);
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class HashTagPatternParser extends InputParser<Pattern> {
|
||||
int z = Math.abs(Integer.parseInt(split2[3]));
|
||||
rest = rest.substring(split2[1].length() + split2[2].length() + split2[3].length() + 3);
|
||||
Pattern pattern = parseFromInput(rest, context);
|
||||
return new OffsetPattern(x, y, z);
|
||||
return new OffsetPattern(pattern, x, y, z);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new InputParseException("The correct format is #offset:<dx>:<dy>:<dz>:<pattern>");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user