Skip to content

Commit ed30072

Browse files
committed
JavaDocs for Bukkit Module
1 parent 92b21b1 commit ed30072

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+758
-990
lines changed

TODO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
High Priority Tasks:
2-
- Rewrite all JavaDocs (mcav-common, mcav-bukkit)
3-
- Clean Up Codebase / Optimize
2+
- Rewrite all JavaDocs (mcav-common)
43
- Write Documentation for Plugin
4+
- Clean Up Codebase / Optimize
55

66
Medium Priority Tasks:
77
- Create Showcase Video

mcav-bukkit/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
dependencies {
77

88
// project dependencies
9-
paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
9+
paperweight.paperDevBundle("1.21.6-R0.1-SNAPSHOT")
1010
api("team.unnamed:creative-api:1.7.3")
1111
api("team.unnamed:creative-serializer-minecraft:1.7.3")
1212
api("net.bytebuddy:byte-buddy:1.17.5")

mcav-bukkit/src/main/java/me/brandonli/mcav/bukkit/MCAVBukkit.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
import org.bukkit.plugin.Plugin;
2323

2424
/**
25-
* The {@code MCAVBukkit} class is a utility class designed to manage
26-
* and provide access to a shared {@link Plugin} instance within a Minecraft Bukkit
27-
* environment. It cannot be instantiated and provides static methods for
28-
* manipulation and retrieval of a single plugin instance.
25+
* The main entry point for Bukkit integration. Requires injection of a plugin instance to load
26+
* listeners and schedulers.
2927
*/
3028
public final class MCAVBukkit {
3129

@@ -36,9 +34,9 @@ private MCAVBukkit() {
3634
}
3735

3836
/**
39-
* Injects a Plugin instance into the class for future use.
37+
* Injects a Plugin instance. Also initializes palettes and packet listeners.
4038
*
41-
* @param plugin the Plugin instance to be injected
39+
* @param plugin the Plugin instance
4240
*/
4341
public static void inject(final Plugin plugin) {
4442
PLUGIN = plugin;
@@ -47,9 +45,9 @@ public static void inject(final Plugin plugin) {
4745
}
4846

4947
/**
50-
* Retrieves the plugin instance associated with the application.
48+
* Retrieves the plugin instance.
5149
*
52-
* @return the current Plugin instance registered with the application.
50+
* @return the current Plugin instance
5351
*/
5452
public static Plugin getPlugin() {
5553
return PLUGIN;

mcav-bukkit/src/main/java/me/brandonli/mcav/bukkit/media/config/BlockConfiguration.java

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
package me.brandonli.mcav.bukkit.media.config;
1919

2020
import com.google.common.base.Preconditions;
21+
import org.bukkit.Location;
22+
2123
import java.util.Collection;
2224
import java.util.UUID;
23-
import org.bukkit.Location;
2425

26+
/**
27+
* Represents a configuration for block related prototypes.
28+
*/
2529
public class BlockConfiguration {
2630

2731
private final Collection<UUID> viewers;
@@ -36,63 +40,133 @@ private BlockConfiguration(final BlockConfiguration.Builder<?> builder) {
3640
this.position = builder.position;
3741
}
3842

43+
/**
44+
* Gets the viewers of this block configuration.
45+
*
46+
* @return the viewers
47+
*/
3948
public Collection<UUID> getViewers() {
4049
return this.viewers;
4150
}
4251

52+
/**
53+
* Gets the width of the block in blocks.
54+
*
55+
* @return the block width
56+
*/
4357
public int getBlockWidth() {
4458
return this.blockWidth;
4559
}
4660

61+
/**
62+
* Gets the height of the block in blocks.
63+
*
64+
* @return the block height
65+
*/
4766
public int getBlockHeight() {
4867
return this.blockHeight;
4968
}
5069

70+
/**
71+
* Gets the position of the block.
72+
*
73+
* @return the position
74+
*/
5175
public Location getPosition() {
5276
return this.position;
5377
}
5478

79+
/**
80+
* Block configuration builder abstraction.
81+
*/
5582
public static final class BlockResultBuilder extends BlockConfiguration.Builder<BlockConfiguration.BlockResultBuilder> {
5683

84+
BlockResultBuilder() {
85+
// no-op
86+
}
87+
5788
@Override
5889
protected BlockConfiguration.BlockResultBuilder self() {
5990
return this;
6091
}
6192
}
6293

94+
/**
95+
* Creates a new block configuration builder.
96+
*
97+
* @return a new block configuration builder
98+
*/
6399
public static BlockConfiguration.Builder<?> builder() {
64100
return new BlockConfiguration.BlockResultBuilder();
65101
}
66102

103+
/**
104+
* Abstract builder for block configurations.
105+
*
106+
* @param <T> the type of the builder
107+
*/
67108
public abstract static class Builder<T extends BlockConfiguration.Builder<T>> {
68109

69110
private Collection<UUID> viewers;
70111
private int blockWidth;
71112
private int blockHeight;
72113
private Location position;
73114

74-
protected abstract T self();
115+
Builder() {
116+
// no-op
117+
}
118+
119+
abstract T self();
75120

121+
/**
122+
* Sets the viewers of this block configuration.
123+
*
124+
* @param viewers the viewers to set
125+
* @return the builder instance for chaining
126+
*/
76127
public T viewers(final Collection<UUID> viewers) {
77128
this.viewers = viewers;
78129
return this.self();
79130
}
80131

132+
/**
133+
* Sets the position of this block configuration.
134+
*
135+
* @param position the position to set
136+
* @return the builder instance for chaining
137+
*/
81138
public T position(final Location position) {
82139
this.position = position;
83140
return this.self();
84141
}
85142

143+
/**
144+
* Sets the width of the configuration in blocks.
145+
*
146+
* @param blockWidth the block width to set
147+
* @return the builder instance for chaining
148+
*/
86149
public T blockWidth(final int blockWidth) {
87150
this.blockWidth = blockWidth;
88151
return this.self();
89152
}
90153

154+
/**
155+
* Sets the height of the configuration in blocks.
156+
*
157+
* @param blockHeight the block height to set
158+
* @return the builder instance for chaining
159+
*/
91160
public T blockHeight(final int blockHeight) {
92161
this.blockHeight = blockHeight;
93162
return this.self();
94163
}
95164

165+
/**
166+
* Builds the block configuration.
167+
*
168+
* @return a new instance of BlockConfiguration
169+
*/
96170
public BlockConfiguration build() {
97171
Preconditions.checkArgument(this.blockWidth > 0, "Map block width must be positive");
98172
Preconditions.checkArgument(this.blockHeight > 0, "Map block height must be positive");

mcav-bukkit/src/main/java/me/brandonli/mcav/bukkit/media/config/ChatConfiguration.java

Lines changed: 34 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,12 @@
1818
package me.brandonli.mcav.bukkit.media.config;
1919

2020
import com.google.common.base.Preconditions;
21+
2122
import java.util.Collection;
2223
import java.util.UUID;
23-
import me.brandonli.mcav.bukkit.media.result.ChatResult;
24-
import me.brandonli.mcav.media.player.pipeline.filter.video.VideoFilter;
2524

2625
/**
27-
* The {@code ChatConfiguration} class represents a configuration for a chat interface.
28-
* It holds the parameters required to customize the chat, including the audience,
29-
* dimensions, and character used for representation.
30-
* <p>
31-
* This class is designed to be immutable, and instances are created using
32-
* its nested {@link Builder} class or its specialized {@link ChatResultBuilder}.
33-
* <p>
34-
* Responsibilities:
35-
* - Defines the configuration properties for chat setup.
36-
* - Provides accessor methods to retrieve configuration data such as viewers,
37-
* character, width, and height.
38-
* <p>
39-
* The builder pattern ensures that all required properties are properly set
40-
* before an instance of {@code ChatConfiguration} is created, while also
41-
* allowing for a fluent interface.
26+
* Represents a configuration for chat related prototypes.
4227
*/
4328
public class ChatConfiguration {
4429

@@ -55,72 +40,69 @@ private ChatConfiguration(final Builder<?> builder) {
5540
}
5641

5742
/**
58-
* Retrieves the collection of viewers associated with this configuration.
59-
* Each viewer is represented by a unique UUID.
43+
* Gets the viewers of this chat configuration.
6044
*
61-
* @return a collection of UUIDs representing the viewers
45+
* @return the collection of UUIDs representing the viewers
6246
*/
6347
public Collection<UUID> getViewers() {
6448
return this.viewers;
6549
}
6650

6751
/**
68-
* Retrieves the character associated with the chat configuration.
52+
* Gets the character string associated with this chat configuration.
6953
*
70-
* @return the character as a string representation
54+
* @return the character string, which may represent a specific
7155
*/
7256
public String getCharacter() {
7357
return this.character;
7458
}
7559

7660
/**
77-
* Retrieves the width of the chat configuration.
61+
* Gets the width of the chat
7862
*
79-
* @return the width of the chat as an integer
63+
* @return the chat width
8064
*/
8165
public int getChatWdith() {
8266
return this.chatWdith;
8367
}
8468

8569
/**
86-
* Retrieves the height of the chat, which represents the configured vertical size
87-
* available for chat display in terms of units or pixels.
70+
* Gets the height of the chat
8871
*
89-
* @return the current chat height as an integer
72+
* @return the chat height as an integer
9073
*/
9174
public int getChatHeight() {
9275
return this.chatHeight;
9376
}
9477

9578
/**
96-
* Builder class for constructing instances of {@link ChatResult}. This class
97-
* extends the abstract Builder class and provides concrete implementations
98-
* for the required parameters.
79+
* Chat configuration builder abstraction.
9980
*/
10081
public static final class ChatResultBuilder extends Builder<ChatResultBuilder> {
10182

83+
ChatResultBuilder() {
84+
// no-op
85+
}
86+
10287
@Override
10388
protected ChatResultBuilder self() {
10489
return this;
10590
}
10691
}
10792

10893
/**
109-
* Creates a new builder instance for constructing a {@link ChatResult} object.
94+
* Creates a new chat configuration builder.
11095
*
111-
* @return a new instance of {@link ChatResultBuilder} for building
96+
* @return a new chat configuration builder
11297
*/
11398
public static Builder<?> builder() {
11499
return new ChatResultBuilder();
115100
}
116101

117102
/**
118-
* Abstract base class for building instances of {@link ChatResult}. This class
119-
* provides methods to set the required parameters for constructing a ChatResult
120-
* instance. The builder pattern allows for a fluent interface and ensures that
121-
* all necessary fields are set before building the final object.
103+
* Abstract builder for chat configurations.
122104
*
123-
* @param <T> the type of the builder extending this abstract class
105+
* @param <T> the type of the builder
124106
*/
125107
public abstract static class Builder<T extends Builder<T>> {
126108

@@ -129,21 +111,25 @@ public abstract static class Builder<T extends Builder<T>> {
129111
private int chatWidth;
130112
private int chatHeight;
131113

132-
protected abstract T self();
114+
Builder() {
115+
// no-op
116+
}
117+
118+
abstract T self();
133119

134120
/**
135-
* Sets the collection of UUIDs representing the viewers for this builder.
121+
* Sets the viewers of this chat configuration.
136122
*
137-
* @param viewers the collection of UUID objects that represent the viewers
138-
* @return the builder instance for method chaining
123+
* @param viewers the viewers to set
124+
* @return the builder instance for chaining
139125
*/
140126
public T viewers(final Collection<UUID> viewers) {
141127
this.viewers = viewers;
142128
return this.self();
143129
}
144130

145131
/**
146-
* Sets the character string for the builder.
132+
* Sets the character string of this chat configuration.
147133
*
148134
* @param character the character value to be set
149135
* @return the instance of the builder for method chaining
@@ -154,9 +140,9 @@ public T character(final String character) {
154140
}
155141

156142
/**
157-
* Sets the chat width and returns the builder instance for method chaining.
143+
* Sets the chat width of this chat configuration.
158144
*
159-
* @param chatWidth the width of the chat, must be a positive integer
145+
* @param chatWidth the width of the chat
160146
* @return the builder instance for method chaining
161147
*/
162148
public T chatWidth(final int chatWidth) {
@@ -165,9 +151,9 @@ public T chatWidth(final int chatWidth) {
165151
}
166152

167153
/**
168-
* Sets the height of the chat interface.
154+
* Sets the chat height of this chat configuration.
169155
*
170-
* @param chatHeight the height of the chat in pixels; must be a positive integer
156+
* @param chatHeight the height of the chat
171157
* @return the builder instance for method chaining
172158
*/
173159
public T chatHeight(final int chatHeight) {
@@ -176,14 +162,9 @@ public T chatHeight(final int chatHeight) {
176162
}
177163

178164
/**
179-
* Builds and returns a new instance of {@link VideoFilter} with the configured
180-
* parameters. This method validates the provided parameters to ensure the
181-
* required fields are set and checks the correctness of the input values.
165+
* Builds the chat configuration.
182166
*
183-
* @return a newly constructed {@link VideoFilter} instance.
184-
* @throws NullPointerException if required parameters such as viewers or character
185-
* are null.
186-
* @throws IllegalArgumentException if chat width or height are non
167+
* @return a new instance of ChatConfiguration
187168
*/
188169
public ChatConfiguration build() {
189170
Preconditions.checkNotNull(this.viewers);

0 commit comments

Comments
 (0)