Skip to content

Commit 70c01f5

Browse files
committed
Merge branch 'api-17' into api-18
2 parents f8a0d1e + ad186e9 commit 70c01f5

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/main/java/org/spongepowered/api/effect/VanishState.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import org.spongepowered.api.Sponge;
2828
import org.spongepowered.api.entity.Entity;
29+
import org.spongepowered.api.entity.living.player.tab.TabListEntry;
2930

3031
/**
3132
* Represents the state of an {@link Entity}'s vanish state.
@@ -216,6 +217,26 @@ static VanishState unvanished() {
216217
*/
217218
VanishState triggerVibrations(boolean triggerVibrations);
218219

220+
/***
221+
* Gets if the {@link Entity}'s associated {@link TabListEntry}
222+
* should be hidden while invisible.
223+
*
224+
* @return Whatever the associated {@link TabListEntry}
225+
* should be hidden while invisible
226+
*/
227+
boolean hidesTabListEntry();
228+
229+
/**
230+
* If {@link #invisible()} returns true, this will return the
231+
* {@link VanishState} with the desired flag replacing
232+
* {@link #hidesTabListEntry()}.
233+
*
234+
* @param hideTabListEntry Whatever the associated {@link TabListEntry}
235+
* is hidden while invisible
236+
* @return The new VanishState
237+
*/
238+
VanishState hideTabListEntry(boolean hideTabListEntry);
239+
219240
interface Factory {
220241

221242
/**
@@ -228,6 +249,7 @@ interface Factory {
228249
* <li>{@link VanishState#createsSounds()} = {@code false}</li>
229250
* <li>{@link VanishState#createsParticles()} = {@code false}</li>
230251
* <li>{@link VanishState#triggerVibrations()} = {@code false}</li>
252+
* <li>{@link VanishState#hidesTabListEntry()} = {@code true}</li>
231253
* </ul>
232254
*
233255
* @return A newly created invisible {@link VanishState}
@@ -243,6 +265,7 @@ interface Factory {
243265
* <li>{@link VanishState#createsSounds()} = {@code true}</li>
244266
* <li>{@link VanishState#createsParticles()} = {@code true}</li>
245267
* <li>{@link VanishState#triggerVibrations()} = {@code false}</li>
268+
* <li>{@link VanishState#hidesTabListEntry()} = {@code false}</li>
246269
* </ul>
247270
*
248271
* @return A newly created visible {@link VanishState}

0 commit comments

Comments
 (0)