TriggerVolumeInspectorDrafts class
Пакет: com.hypixel.hytale.builtin.triggervolumes.ui
Файл: com/hypixel/hytale/builtin/triggervolumes/ui/TriggerVolumeInspectorDrafts.java
Поля (50)
| Модификаторы | Тип | Имя |
|---|---|---|
|
float |
activationDelay |
|
Vector3d |
anchorOffset |
|
Vector3d |
boxRotation |
|
boolean |
cancelDelayedOnExit |
|
int |
color |
|
Vector3f |
color |
|
ConditionTiming |
conditionTiming |
|
ConditionTiming |
conditionTiming |
|
List<TriggerCondition> |
conditions |
|
List<TriggerCondition> |
conditions |
|
float |
cooldown |
|
CooldownMode |
cooldownMode |
|
Vector3d |
dimensions |
|
boolean |
dirty |
|
boolean |
dirty |
|
String |
effectAssetRef |
|
List<TriggerEffect> |
effects |
|
List<TriggerEffect> |
effects |
|
boolean |
enabled |
|
boolean |
enabled |
|
String |
groupId |
|
String |
id |
|
String |
id |
|
boolean |
keepLoaded |
|
Set<String> |
memberVolumeIds |
|
Vector3d |
origin |
|
String |
originalId |
|
String |
originalId |
|
Vector3d |
position |
|
ProjectileSource |
projectileSource |
|
RejectionDelayMode |
rejectionDelayMode |
|
RejectionDelayMode |
rejectionDelayMode |
|
List<TriggerEffect> |
rejectionEffects |
|
List<TriggerEffect> |
rejectionEffects |
|
boolean |
rotateEffectsOnPaste |
|
boolean |
rotateEffectsOnPaste |
|
List<TriggerRule> |
rules |
|
List<TriggerRule> |
rules |
|
boolean |
rulesActive |
|
TriggerVolumeShapeType |
shapeType |
|
Map<String, String> |
tags |
|
Map<String, String> |
tags |
|
Set<EntityTargetType> |
targetTypes |
|
Set<EntityTargetType> |
targetTypes |
|
LinkedHashMap |
var1 |
|
TriggerVolumeInspectorDrafts.GroupDraft |
var1 |
|
TriggerVolumeInspectorDrafts.VolumeDraft |
var1 |
|
Vector3d |
var1 |
|
String |
worldName |
|
String |
worldName |
Методы (15)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
GroupDraft GroupDraft() |
|
|
VolumeDraft VolumeDraft() |
|
private static Vector3d |
anchorOffsetOfprivate static Vector3d anchorOffsetOf(@Nonnull VolumeEntry var0) |
|
void |
applyTovoid applyTo(@Nonnull GroupEntry var1) |
|
void |
applyTovoid applyTo(@Nonnull VolumeEntry var1) |
|
private TriggerVolumeShape |
buildShapeprivate TriggerVolumeShape buildShape() |
|
private static Vector3d |
dimensionsOfprivate static Vector3d dimensionsOf(@Nonnull VolumeEntry var0) |
|
static TriggerVolumeInspectorDrafts.GroupDraft |
fromstatic TriggerVolumeInspectorDrafts.GroupDraft from(@Nonnull GroupEntry var0) |
|
static TriggerVolumeInspectorDrafts.VolumeDraft |
fromstatic TriggerVolumeInspectorDrafts.VolumeDraft from(@Nonnull VolumeEntry var0) |
|
void |
markDirtyvoid markDirty() |
|
void |
markDirtyvoid markDirty() |
|
private static double |
rescaleAnchorComponentprivate static double rescaleAnchorComponent(double var0, double var2, double var4) |
|
void |
rescaleAnchorOffsetvoid rescaleAnchorOffset(@Nonnull Vector3d var1) |
|
private static TriggerVolumeShapeType |
shapeTypeOfprivate static TriggerVolumeShapeType shapeTypeOf(@Nonnull VolumeEntry var0) |
|
return |
switchreturn switch(this.shapeType) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.triggervolumes.ui;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.EntityTargetType;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.effect.TriggerCondition;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.effect.TriggerEffect;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.effect.TriggerRule;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.ConditionTiming;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.CooldownMode;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.GroupEntry;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.ProjectileSource;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.RejectionDelayMode;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.manager.VolumeEntry;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.shape.BoxShape;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.shape.CylinderShape;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.shape.SphereShape;
class="kw">import com.hypixel.hytale.builtin.triggervolumes.shape.TriggerVolumeShape;
class="kw">import com.hypixel.hytale.protocol.packets.player.TriggerVolumeShapeType;
class="kw">import java.util.EnumSet;
class="kw">import java.util.LinkedHashMap;
class="kw">import java.util.LinkedHashSet;
class="kw">import java.util.List;
class="kw">import java.util.Map;
class="kw">import java.util.Set;
class="kw">import java.util.Map.Entry;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3d;
class="kw">import org.joml.Vector3f;
class="kw">final class TriggerVolumeInspectorDrafts {
class="kw">private TriggerVolumeInspectorDrafts() {
}
@Nonnull
class="kw">static Map<String, String> copyTags(@Nonnull Map<String, String> var0) {
LinkedHashMap var1 = new LinkedHashMap<>();
for (Entry var3 : var0.entrySet()) {
var1.put(var3.getKey(), var3.getValue());
}
class="kw">return var1;
}
class="kw">static class="kw">final class GroupDraft {
@Nonnull
String id;
@Nonnull
String originalId;
@Nonnull
String worldName;
@Nonnull
Vector3d origin;
int color;
@Nonnull
Set<EntityTargetType> targetTypes;
boolean enabled;
boolean rotateEffectsOnPaste;
@Nonnull
ConditionTiming conditionTiming;
@Nonnull
RejectionDelayMode rejectionDelayMode;
@Nonnull
List<TriggerCondition> conditions;
@Nonnull
List<TriggerEffect> effects;
@Nonnull
List<TriggerEffect> rejectionEffects;
@Nonnull
List<TriggerRule> rules;
@Nonnull
Map<String, String> tags;
@Nonnull
Set<String> memberVolumeIds;
boolean dirty;
GroupDraft() {
}
@Nonnull
class="kw">static TriggerVolumeInspectorDrafts.GroupDraft from(@Nonnull GroupEntry var0) {
TriggerVolumeInspectorDrafts.GroupDraft var1 = new TriggerVolumeInspectorDrafts.GroupDraft();
var1.id = var0.getName() != null ? var0.getName() : "";
var1.originalId = var0.getId();
var1.worldName = var0.getWorldName();
var1.origin = new Vector3d(var0.getOrigin());
var1.color = var0.getColor();
var1.targetTypes = var0.getTargetTypes().isEmpty() ? EnumSet.noneOf(EntityTargetType.class) : EnumSet.copyOf(var0.getTargetTypes());
var1.enabled = var0.isEnabled();
var1.rotateEffectsOnPaste = var0.isRotateEffectsOnPaste();
var1.conditionTiming = var0.getConditionTiming();
var1.rejectionDelayMode = var0.getRejectionDelayMode();
var1.conditions = TriggerCondition.deepCopyList(var0.getConditions());
var1.effects = TriggerEffect.deepCopyList(var0.getEffects());
var1.rejectionEffects = TriggerEffect.deepCopyList(var0.getRejectionEffects());
var1.rules = TriggerRule.deepCopyList(var0.getRules());
var1.tags = TriggerVolumeInspectorDrafts.copyTags(var0.getRawTags());
var1.memberVolumeIds = new LinkedHashSet<>(var0.getMemberVolumeIds());
class="kw">return var1;
}
void markDirty() {
this.dirty = true;
}
void applyTo(@Nonnull GroupEntry var1) {
var1.setName(this.id.isBlank() ? null : this.id);
var1.setWorldName(this.worldName);
var1.setOrigin(new Vector3d(this.origin));
var1.setColor(this.color);
var1.getTargetTypes().clear();
var1.getTargetTypes().addAll(this.targetTypes);
var1.setEnabled(this.enabled);
var1.setRotateEffectsOnPaste(this.rotateEffectsOnPaste);
var1.setConditionTiming(this.conditionTiming);
var1.setRejectionDelayMode(this.rejectionDelayMode);
var1.getConditions().clear();
var1.getConditions().addAll(TriggerCondition.deepCopyList(this.conditions));
var1.getEffects().clear();
var1.getEffects().addAll(TriggerEffect.deepCopyList(this.effects));
var1.getRejectionEffects().clear();
var1.getRejectionEffects().addAll(TriggerEffect.deepCopyList(this.rejectionEffects));
var1.getRules().clear();
var1.getRules().addAll(TriggerRule.deepCopyList(this.rules));
var1.setTags(TriggerVolumeInspectorDrafts.copyTags(this.tags));
var1.getMemberVolumeIds().clear();
var1.getMemberVolumeIds().addAll(this.memberVolumeIds);
}
}
class="kw">static class="kw">final class VolumeDraft {
@Nonnull
String id;
@Nonnull
String originalId;
@Nonnull
String worldName;
@Nonnull
Vector3d position;
@Nonnull
TriggerVolumeShapeType shapeType;
@Nonnull
Vector3d dimensions;
@Nonnull
Vector3d anchorOffset;
@Nullable
Vector3d boxRotation;
@Nullable
Vector3f color;
@Nonnull
Set<EntityTargetType> targetTypes;
@Nonnull
ProjectileSource projectileSource;
boolean dirty;
boolean enabled;
boolean keepLoaded;
boolean rotateEffectsOnPaste;
boolean cancelDelayedOnExit;
float activationDelay;
float cooldown;
@Nonnull
CooldownMode cooldownMode;
@Nonnull
ConditionTiming conditionTiming;
@Nonnull
RejectionDelayMode rejectionDelayMode;
@Nullable
String groupId;
@Nullable
String effectAssetRef;
@Nonnull
List<TriggerCondition> conditions;
@Nonnull
List<TriggerEffect> effects;
@Nonnull
List<TriggerEffect> rejectionEffects;
@Nonnull
List<TriggerRule> rules;
boolean rulesActive;
@Nonnull
Map<String, String> tags;
VolumeDraft() {
}
@Nonnull
class="kw">static TriggerVolumeInspectorDrafts.VolumeDraft from(@Nonnull VolumeEntry var0) {
TriggerVolumeInspectorDrafts.VolumeDraft var1 = new TriggerVolumeInspectorDrafts.VolumeDraft();
var1.id = var0.getName() != null ? var0.getName() : "";
var1.originalId = var0.getId();
var1.worldName = var0.getWorldName();
var1.position = new Vector3d(var0.getPosition());
var1.shapeType = shapeTypeOf(var0);
var1.dimensions = dimensionsOf(var0);
var1.anchorOffset = anchorOffsetOf(var0);
var1.boxRotation = var0.getShape() class="kw">instanceof BoxShape var2 && var2.getRotation() != null ? new Vector3d(var2.getRotation()) : null;
var1.color = var0.getColor() != null ? new Vector3f(var0.getColor()) : null;
var1.targetTypes = var0.getTargetTypes().isEmpty() ? EnumSet.noneOf(EntityTargetType.class) : EnumSet.copyOf(var0.getTargetTypes());
var1.projectileSource = var0.getProjectileSource();
var1.enabled = var0.isEnabled();
var1.keepLoaded = var0.isKeepLoaded();
var1.rotateEffectsOnPaste = var0.isRotateEffectsOnPaste();
var1.cancelDelayedOnExit = var0.isCancelDelayedEffectsOnExit();
var1.activationDelay = var0.getActivationDelay();
var1.cooldown = var0.getCooldown();
var1.cooldownMode = var0.getCooldownMode();
var1.conditionTiming = var0.getConditionTiming();
var1.rejectionDelayMode = var0.getRejectionDelayMode();
var1.groupId = var0.getGroupId();
var1.effectAssetRef = var0.getEffectAssetRef();
var1.conditions = TriggerCondition.deepCopyList(var0.getConditions());
var1.effects = TriggerEffect.deepCopyList(var0.getEffects());
var1.rejectionEffects = TriggerEffect.deepCopyList(var0.getRejectionEffects());
var1.rules = TriggerRule.deepCopyList(var0.getRules());
var1.rulesActive = var0.isRulesActive();
var1.tags = TriggerVolumeInspectorDrafts.copyTags(var0.getRawTags());
class="kw">return var1;
}
void markDirty() {
this.dirty = true;
}
void rescaleAnchorOffset(@Nonnull Vector3d var1) {
this.anchorOffset
.set(
rescaleAnchorComponent(this.anchorOffset.x(), var1.x(), this.dimensions.x()),
rescaleAnchorComponent(this.anchorOffset.y(), var1.y(), this.dimensions.y()),
rescaleAnchorComponent(this.anchorOffset.z(), var1.z(), this.dimensions.z())
);
}
void applyTo(@Nonnull VolumeEntry var1) {
var1.setName(this.id.isBlank() ? null : this.id);
var1.setWorldName(this.worldName);
var1.setPosition(new Vector3d(this.position));
var1.setShape(this.buildShape());
var1.setColor(this.color != null ? new Vector3f(this.color) : null);
var1.getTargetTypes().clear();
var1.getTargetTypes().addAll(this.targetTypes);
var1.setProjectileSource(this.projectileSource);
var1.setEnabled(this.enabled);
var1.setKeepLoaded(this.keepLoaded);
var1.setRotateEffectsOnPaste(this.rotateEffectsOnPaste);
var1.setCancelDelayedEffectsOnExit(this.cancelDelayedOnExit);
var1.setActivationDelay(this.activationDelay);
var1.setCooldown(this.cooldown);
var1.setCooldownMode(this.cooldownMode);
var1.setConditionTiming(this.conditionTiming);
var1.setRejectionDelayMode(this.rejectionDelayMode);
var1.setGroupId(this.groupId);
var1.setEffectAssetRef(this.effectAssetRef);
var1.getConditions().clear();
var1.getConditions().addAll(TriggerCondition.deepCopyList(this.conditions));
var1.getEffects().clear();
var1.getEffects().addAll(TriggerEffect.deepCopyList(this.effects));
var1.getRejectionEffects().clear();
var1.getRejectionEffects().addAll(TriggerEffect.deepCopyList(this.rejectionEffects));
var1.getRules().clear();
var1.getRules().addAll(TriggerRule.deepCopyList(this.rules));
var1.setRulesActive(this.rulesActive);
var1.setTags(TriggerVolumeInspectorDrafts.copyTags(this.tags));
}
@Nonnull
class="kw">private TriggerVolumeShape buildShape() {
Vector3d var1 = new Vector3d(Math.max(0.0, this.dimensions.x()), Math.max(0.0, this.dimensions.y()), Math.max(0.0, this.dimensions.z()));
class="kw">return class="kw">switch (this.shapeType) {
case Sphere -> new SphereShape(new Vector3d(this.anchorOffset), var1.x());
case Cylinder -> new CylinderShape(new Vector3d(this.anchorOffset).sub(0.0, var1.y() * 0.5, 0.0), var1.x(), var1.y());
case Box -> new BoxShape(
new Vector3d(this.anchorOffset).sub(var1),
new Vector3d(this.anchorOffset).add(var1),
this.boxRotation != null ? new Vector3d(this.boxRotation) : null
);
};
}
@Nonnull
class="kw">private class="kw">static TriggerVolumeShapeType shapeTypeOf(@Nonnull VolumeEntry var0) {
if (var0.getShape() class="kw">instanceof SphereShape) {
class="kw">return TriggerVolumeShapeType.Sphere;
} else {
class="kw">return var0.getShape() class="kw">instanceof CylinderShape ? TriggerVolumeShapeType.Cylinder : TriggerVolumeShapeType.Box;
}
}
@Nonnull
class="kw">private class="kw">static Vector3d dimensionsOf(@Nonnull VolumeEntry var0) {
if (var0.getShape() class="kw">instanceof BoxShape var4) {
class="kw">return new Vector3d(var4.getMax()).sub(var4.getMin()).mul(0.5).absolute();
} else if (var0.getShape() class="kw">instanceof SphereShape var3) {
class="kw">return new Vector3d(var3.getRadius(), 0.0, 0.0);
} else {
class="kw">return var0.getShape() class="kw">instanceof CylinderShape var1 ? new Vector3d(var1.getRadius(), var1.getHeight(), 0.0) : new Vector3d(1.0, 1.0, 1.0);
}
}
@Nonnull
class="kw">private class="kw">static Vector3d anchorOffsetOf(@Nonnull VolumeEntry var0) {
if (var0.getShape() class="kw">instanceof BoxShape var4) {
class="kw">return new Vector3d(var4.getMin()).add(var4.getMax()).mul(0.5);
} else if (var0.getShape() class="kw">instanceof SphereShape var3) {
class="kw">return new Vector3d(var3.getCenter());
} else {
class="kw">return var0.getShape() class="kw">instanceof CylinderShape var1 ? new Vector3d(var1.getCenter()).add(0.0, var1.getHeight() * 0.5, 0.0) : new Vector3d();
}
}
class="kw">private class="kw">static double rescaleAnchorComponent(double var0, double var2, double var4) {
class="kw">return Math.abs(var2) > 1.0E-9 ? var0 * var4 / var2 : var0;
}
}
}