Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 00:50:13 +01:00
Add CREATE_FOG BossFlag
Dieser Commit ist enthalten in:
Ursprung
257eea5b04
Commit
533572e8cd
@ -73,6 +73,7 @@ public interface EntityTracker {
|
||||
*
|
||||
* @param id entity id
|
||||
* @return stored entity data if an entity with the id is tracked, else null
|
||||
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
|
||||
*/
|
||||
@Nullable StoredEntityData entityData(int id);
|
||||
|
||||
@ -81,6 +82,7 @@ public interface EntityTracker {
|
||||
*
|
||||
* @param id entity id
|
||||
* @return stored entity data if it has previously been initialized by {@link #entityData(int)}
|
||||
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
|
||||
*/
|
||||
@Nullable StoredEntityData entityDataIfPresent(int id);
|
||||
|
||||
|
@ -25,7 +25,8 @@ package com.viaversion.viaversion.api.legacy.bossbar;
|
||||
public enum BossFlag {
|
||||
|
||||
DARKEN_SKY(1),
|
||||
PLAY_BOSS_MUSIC(2);
|
||||
PLAY_BOSS_MUSIC(2),
|
||||
CREATE_FOG(4);
|
||||
|
||||
private final int id;
|
||||
|
||||
|
@ -70,12 +70,14 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis
|
||||
|
||||
@Override
|
||||
public @Nullable StoredEntityData entityData(int id) {
|
||||
Preconditions.checkArgument(entityData != null, "Entity data storage has to be explicitly enabled via the constructor");
|
||||
EntityType type = entityType(id);
|
||||
return type != null ? entityData.computeIfAbsent(id, s -> new StoredEntityImpl(type)) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable StoredEntityData entityDataIfPresent(int id) {
|
||||
Preconditions.checkArgument(entityData != null, "Entity data storage has to be explicitly enabled via the constructor");
|
||||
return entityData.get(id);
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren