mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-07-05 16:40:04 +00:00
- so certain people can look at the diff and complain about my sloppy code :( Signed-off-by: Jesse Boyd <jessepaleg@gmail.com>
21 lines
652 B
Java
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;
|
|
}
|
|
}
|