*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.Vector;
|
||||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
import com.sk89q.worldedit.function.pattern.AbstractPattern;
|
||||||
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
|
|
||||||
public class OffsetPattern extends AbstractPattern {
|
public class OffsetPattern extends AbstractPattern {
|
||||||
|
|
||||||
private final int dx,dy,dz;
|
private final int dx,dy,dz;
|
||||||
private final Vector mutable = new Vector();
|
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.dx = dx;
|
||||||
this.dy = dy;
|
this.dy = dy;
|
||||||
this.dz = dz;
|
this.dz = dz;
|
||||||
|
this.pattern = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -20,6 +23,6 @@ public class OffsetPattern extends AbstractPattern {
|
|||||||
mutable.x = position.x + dx;
|
mutable.x = position.x + dx;
|
||||||
mutable.y = position.y + dy;
|
mutable.y = position.y + dy;
|
||||||
mutable.z = position.z + dz;
|
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]));
|
int z = Math.abs(Integer.parseInt(split2[3]));
|
||||||
rest = rest.substring(split2[1].length() + split2[2].length() + split2[3].length() + 3);
|
rest = rest.substring(split2[1].length() + split2[2].length() + split2[3].length() + 3);
|
||||||
Pattern pattern = parseFromInput(rest, context);
|
Pattern pattern = parseFromInput(rest, context);
|
||||||
return new OffsetPattern(x, y, z);
|
return new OffsetPattern(pattern, x, y, z);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new InputParseException("The correct format is #offset:<dx>:<dy>:<dz>:<pattern>");
|
throw new InputParseException("The correct format is #offset:<dx>:<dy>:<dz>:<pattern>");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user