Add targetoffset scroll action

This commit is contained in:
Jesse Boyd 2018-05-23 16:17:37 +10:00
parent c6605ce587
commit ca1a62ac79
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 21 additions and 0 deletions

View File

@ -64,6 +64,8 @@ public abstract class ScrollAction implements ScrollTool {
patterns[i - 1] = WorldEdit.getInstance().getPatternFactory().parseFromInput(arg, parserContext); patterns[i - 1] = WorldEdit.getInstance().getPatternFactory().parseFromInput(arg, parserContext);
} }
return (new ScrollPattern(tool, patterns)); return (new ScrollPattern(tool, patterns));
case "targetoffset":
return (new ScrollTargetOffset(tool));
case "range": case "range":
return (new ScrollRange(tool)); return (new ScrollRange(tool));
case "size": case "size":

View File

@ -0,0 +1,19 @@
package com.boydti.fawe.object.brush.scroll;
import com.boydti.fawe.util.MathMan;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.entity.Player;
public class ScrollTargetOffset extends ScrollAction {
public ScrollTargetOffset(BrushTool tool) {
super(tool);
}
@Override
public boolean increment(Player player, int amount) {
BrushTool tool = getTool();
tool.setTargetOffset(tool.getTargetOffset() + amount);
return true;
}
}