Plex-FAWE/worldedit-core/src/main/java/com/boydti/fawe/object/brush/scroll/ScrollRange.java
Jesse Boyd a629d15c74
Copy paste/merge FAWE classes to this WorldEdit fork
- so certain people can look at the diff and complain about my sloppy code :(

Signed-off-by: Jesse Boyd <jessepaleg@gmail.com>
2018-08-13 00:03:07 +10:00

21 lines
652 B
Java

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 ScrollRange extends ScrollAction {
public ScrollRange(BrushTool tool) {
super(tool);
}
@Override
public boolean increment(Player player, int amount) {
int max = WorldEdit.getInstance().getConfiguration().maxBrushRadius;
int newSize = MathMan.wrap(getTool().getRange() + amount, (int) (getTool().getSize() + 1), max);
getTool().setRange(newSize);
return true;
}
}