Skip to content

Commit 1a8417b

Browse files
authored
[ci skip] Add Javadocs for PotionEffect withX methods (#13723)
1 parent 6546122 commit 1a8417b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

paper-api/src/main/java/org/bukkit/potion/PotionEffect.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,74 @@ public PotionEffect(@NotNull Map<String, Object> map) {
133133
}
134134

135135
// Paper start
136+
/**
137+
* Returns a new potion effect with the provided type and this effect's
138+
* duration, amplifier, ambient, particles, and icon.
139+
*
140+
* @param type effect type
141+
* @return a new potion effect with the provided type
142+
*/
136143
@NotNull
137144
public PotionEffect withType(@NotNull PotionEffectType type) {
138145
return new PotionEffect(type, duration, amplifier, ambient, particles, icon);
139146
}
147+
148+
/**
149+
* Returns a new potion effect with the provided duration and this effect's
150+
* type, amplifier, ambient, particles, and icon.
151+
*
152+
* @param duration measured in ticks, see {@link
153+
* PotionEffect#getDuration()}
154+
* @return a new potion effect with the provided duration
155+
*/
140156
@NotNull
141157
public PotionEffect withDuration(int duration) {
142158
return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
143159
}
160+
161+
/**
162+
* Returns a new potion effect with the provided amplifier and this effect's
163+
* type, duration, ambient, particles, and icon.
164+
*
165+
* @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
166+
* @return a new potion effect with the provided amplifier
167+
*/
144168
@NotNull
145169
public PotionEffect withAmplifier(int amplifier) {
146170
return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
147171
}
172+
173+
/**
174+
* Returns a new potion effect with the provided ambient and this effect's
175+
* type, duration, amplifier, particles, and icon.
176+
*
177+
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
178+
* @return a new potion effect with the provided ambient
179+
*/
148180
@NotNull
149181
public PotionEffect withAmbient(boolean ambient) {
150182
return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
151183
}
184+
185+
/**
186+
* Returns a new potion effect with the provided particles and this effect's
187+
* type, duration, amplifier, ambient, and icon.
188+
*
189+
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
190+
* @return a new potion effect with the provided particles
191+
*/
152192
@NotNull
153193
public PotionEffect withParticles(boolean particles) {
154194
return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
155195
}
196+
197+
/**
198+
* Returns a new potion effect with the provided icon and this effect's
199+
* type, duration, amplifier, ambient, and particles.
200+
*
201+
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
202+
* @return a new potion effect with the provided icon
203+
*/
156204
@NotNull
157205
public PotionEffect withIcon(boolean icon) {
158206
return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);

0 commit comments

Comments
 (0)