Skip to content

Commit 914d346

Browse files
author
david
committed
Refactor SplinePattern class to remove Lombok usage.
Replaced Lombok annotations with explicit getters, setters, and constructors for better clarity and control. This change enhances maintainability and avoids potential limitations of Lombok in the project.
1 parent 765bb55 commit 914d346

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

src/main/java/net/thenextlvl/gopaint/brush/pattern/SplinePattern.java

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,13 @@
77
import com.sk89q.worldedit.extent.Extent;
88
import com.sk89q.worldedit.math.BlockVector3;
99
import com.sk89q.worldedit.world.block.BlockState;
10-
import lombok.Getter;
11-
import lombok.RequiredArgsConstructor;
12-
import lombok.Setter;
13-
import lombok.experimental.Accessors;
1410
import net.thenextlvl.gopaint.api.brush.pattern.BuildPattern;
1511
import net.thenextlvl.gopaint.api.brush.setting.BrushSettings;
1612
import org.jspecify.annotations.NullMarked;
1713

1814
import java.util.Objects;
1915

20-
@Getter
21-
@Setter
2216
@NullMarked
23-
@RequiredArgsConstructor
24-
@Accessors(fluent = true, chain = false)
2517
public class SplinePattern implements BuildPattern {
2618
private final EditSession session;
2719
private final BlockVector3 position;
@@ -30,6 +22,13 @@ public class SplinePattern implements BuildPattern {
3022

3123
private int random;
3224

25+
public SplinePattern(EditSession session, BlockVector3 position, Player player, BrushSettings settings) {
26+
this.session = session;
27+
this.position = position;
28+
this.player = player;
29+
this.settings = settings;
30+
}
31+
3332
@Override
3433
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
3534
return set.setBlock(extent, getRandomBlockState());
@@ -41,4 +40,28 @@ public BlockState getRandomBlockState() {
4140
var block = BukkitAdapter.asBlockType(settings().getBlocks().get(index));
4241
return Objects.requireNonNull(block).getDefaultState();
4342
}
43+
44+
public EditSession session() {
45+
return this.session;
46+
}
47+
48+
public BlockVector3 position() {
49+
return this.position;
50+
}
51+
52+
public Player player() {
53+
return this.player;
54+
}
55+
56+
public BrushSettings settings() {
57+
return this.settings;
58+
}
59+
60+
public int random() {
61+
return this.random;
62+
}
63+
64+
public void random(int random) {
65+
this.random = random;
66+
}
4467
}

0 commit comments

Comments
 (0)