ObjectiveLocationMarker class
Пакет: com.hypixel.hytale.builtin.adventure.objectives.markers.objectivelocation
Файл: com/hypixel/hytale/builtin/adventure/objectives/markers/objectivelocation/ObjectiveLocationMarker.java
implements: Component<EntityStore>
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
|
ObjectiveLocationMarker |
var1 |
Методы (9)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
ObjectiveLocationMarkerArea |
getAreaObjectiveLocationMarkerArea getArea() |
static |
ComponentType<EntityStore, ObjectiveLocationMarker> |
getComponentTypeComponentType<EntityStore, ObjectiveLocationMarker> getComponentType() |
public |
String |
getObjectiveLocationMarkerIdString getObjectiveLocationMarkerId() |
public |
UntrackObjective |
getUntrackPacketUntrackObjective getUntrackPacket() |
public |
void |
setActiveObjectivevoid setActiveObjective(@Nonnull Objective var1) |
public |
void |
setActiveObjectiveUUIDvoid setActiveObjectiveUUID(UUID var1) |
public |
void |
setObjectiveLocationMarkerIdvoid setObjectiveLocationMarkerId(String var1) |
public |
void |
setUntrackPacketvoid setUntrackPacket(@Nonnull UntrackObjective var1) |
public |
void |
updateLocationMarkerValuesvoid updateLocationMarkerValues(@Nonnull ObjectiveLocationMarkerAsset var1, float var2, @Nonnull Store<EntityStore> var3) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.objectives.markers.objectivelocation;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.Objective;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.config.ObjectiveLocationMarkerAsset;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.config.markerarea.ObjectiveLocationMarkerArea;
class="kw">import com.hypixel.hytale.builtin.adventure.objectives.config.triggercondition.ObjectiveLocationTriggerCondition;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.protocol.packets.assets.UntrackObjective;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.UUID;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ObjectiveLocationMarker class="kw">implements Component<EntityStore> {
@Nonnull
class="kw">public class="kw">static class="kw">final BuilderCodec<ObjectiveLocationMarker> CODEC = BuilderCodec.builder(ObjectiveLocationMarker.class, ObjectiveLocationMarker::new)
.append(
new KeyedCodec<>("ObjectiveLocationMarkerId", Codec.STRING),
(var0, var1) -> var0.objectiveLocationMarkerId = var1,
var0 -> var0.objectiveLocationMarkerId
)
.addValidator(Validators.nonNull())
.addValidator(ObjectiveLocationMarkerAsset.VALIDATOR_CACHE.getValidator())
.add()
.append(new KeyedCodec<>("ActiveObjectiveUUID", Codec.UUID_BINARY), (var0, var1) -> var0.activeObjectiveUUID = var1, var0 -> var0.activeObjectiveUUID)
.add()
.build();
class="kw">protected String objectiveLocationMarkerId;
class="kw">protected UUID activeObjectiveUUID;
class="kw">protected ObjectiveLocationMarkerArea area;
class="kw">protected int[] environmentIndexes;
class="kw">protected ObjectiveLocationTriggerCondition[] triggerConditions;
@Nullable
class="kw">private Objective activeObjective;
class="kw">private UntrackObjective untrackPacket;
class="kw">public class="kw">static ComponentType<EntityStore, ObjectiveLocationMarker> getComponentType() {
class="kw">return ObjectivePlugin.get().getObjectiveLocationMarkerComponentType();
}
class="kw">public ObjectiveLocationMarker() {
}
class="kw">public ObjectiveLocationMarker(String var1) {
this.objectiveLocationMarkerId = var1;
}
class="kw">public void setObjectiveLocationMarkerId(String var1) {
this.objectiveLocationMarkerId = var1;
}
class="kw">public void setActiveObjectiveUUID(UUID var1) {
this.activeObjectiveUUID = var1;
}
@Nullable
class="kw">public Objective getActiveObjective() {
class="kw">return this.activeObjective;
}
class="kw">public void setActiveObjective(@Nonnull Objective var1) {
this.activeObjective = var1;
}
class="kw">public String getObjectiveLocationMarkerId() {
class="kw">return this.objectiveLocationMarkerId;
}
class="kw">public UntrackObjective getUntrackPacket() {
class="kw">return this.untrackPacket;
}
class="kw">public void setUntrackPacket(@Nonnull UntrackObjective var1) {
this.untrackPacket = var1;
}
class="kw">public ObjectiveLocationMarkerArea getArea() {
class="kw">return this.area;
}
class="kw">public void updateLocationMarkerValues(@Nonnull ObjectiveLocationMarkerAsset var1, float var2, @Nonnull Store<EntityStore> var3) {
if (this.activeObjective != null && !this.activeObjective.getObjectiveId().equals(var1.getObjectiveTypeSetup().getObjectiveIdToStart())) {
ObjectivePlugin.get().cancelObjective(this.activeObjectiveUUID, var3);
this.activeObjective = null;
}
this.environmentIndexes = var1.getEnvironmentIndexes();
this.area = var1.getArea().getRotatedArea(var2, 0.0F);
this.triggerConditions = var1.getTriggerConditions();
}
@Nonnull
@Override
class="kw">public Component<EntityStore> clone() {
ObjectiveLocationMarker var1 = new ObjectiveLocationMarker(this.objectiveLocationMarkerId);
var1.activeObjectiveUUID = this.activeObjectiveUUID;
var1.area = this.area;
var1.environmentIndexes = this.environmentIndexes;
var1.triggerConditions = this.triggerConditions;
var1.activeObjective = this.activeObjective;
var1.untrackPacket = this.untrackPacket;
class="kw">return var1;
}
}