From cb4821078e720cbbafa919ba21ff038eb588e994 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 28 Sep 2016 23:34:48 +1000 Subject: [PATCH] *Whoops --- .../java/com/boydti/fawe/object/pattern/OffsetPattern.java | 7 +++++-- .../worldedit/extension/factory/HashTagPatternParser.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/object/pattern/OffsetPattern.java b/core/src/main/java/com/boydti/fawe/object/pattern/OffsetPattern.java index e3881132..e401095e 100644 --- a/core/src/main/java/com/boydti/fawe/object/pattern/OffsetPattern.java +++ b/core/src/main/java/com/boydti/fawe/object/pattern/OffsetPattern.java @@ -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); } } diff --git a/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java b/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java index d794cfbe..488a82e0 100644 --- a/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java +++ b/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java @@ -131,7 +131,7 @@ public class HashTagPatternParser extends InputParser { 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::::"); }