VariantRotation enum
Пакет: com.hypixel.hytale.server.core.asset.type.blocktype.config
Файл: com/hypixel/hytale/server/core/asset/type/blocktype/config/VariantRotation.java
implements: NetworkSerializable<com.hypixel.hytale.protocol.VariantRotation>
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
VariantRotation[] |
EMPTY_ARRAY |
Методы (6)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
RotationTuple[] |
getRotationsRotationTuple[] getRotations() |
public |
RotationTuple |
rotateXRotationTuple rotateX(RotationTuple var1, Rotation var2) |
public |
RotationTuple |
rotateZRotationTuple rotateZ(RotationTuple var1, Rotation var2) |
|
return |
switchreturn switch(var0) |
public |
com.hypixel.hytale.protocol.VariantRotation |
toPacketcom.hypixel.hytale.protocol.VariantRotation toPacket() |
public |
RotationTuple |
verifyRotationTuple verify(RotationTuple var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.blocktype.config;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.util.function.BiFunction;
class="kw">import java.util.function.Function;
class="kw">import javax.annotation.Nonnull;
class="kw">public enum VariantRotation class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.VariantRotation> {
None(
com.hypixel.hytale.protocol.VariantRotation.None,
RotationTuple.EMPTY_ARRAY,
var0 -> RotationTuple.NONE,
(var0, var1) -> RotationTuple.NONE,
(var0, var1) -> RotationTuple.NONE
),
Wall(
com.hypixel.hytale.protocol.VariantRotation.Wall,
new RotationTuple[]{RotationTuple.of(Rotation.Ninety, Rotation.None)},
var0 -> var0.yaw() != Rotation.Ninety && var0.yaw() != Rotation.TwoSeventy
? RotationTuple.of(Rotation.None, Rotation.None)
: RotationTuple.of(Rotation.Ninety, Rotation.None),
(var0, var1) -> var0,
(var0, var1) -> var0
),
UpDown(
com.hypixel.hytale.protocol.VariantRotation.UpDown,
new RotationTuple[]{RotationTuple.of(Rotation.None, Rotation.OneEighty)},
var0 -> var0.pitch() == Rotation.OneEighty ? RotationTuple.of(Rotation.None, Rotation.OneEighty) : RotationTuple.of(Rotation.None, Rotation.None),
(var0, var1) -> RotationTuple.of(var0.yaw(), var0.pitch().add(var1)),
(var0, var1) -> var0.pitch().add(var1) == Rotation.OneEighty
? RotationTuple.of(var0.yaw(), Rotation.OneEighty)
: RotationTuple.of(var0.yaw(), Rotation.None)
),
Pipe(
com.hypixel.hytale.protocol.VariantRotation.Pipe,
new RotationTuple[]{RotationTuple.of(Rotation.None, Rotation.Ninety), RotationTuple.of(Rotation.Ninety, Rotation.Ninety)},
var0 -> var0.pitch() != Rotation.Ninety && var0.pitch() != Rotation.TwoSeventy
? RotationTuple.of(Rotation.None, validatePipe(var0.pitch()))
: RotationTuple.of(validatePipe(var0.yaw()), validatePipe(var0.pitch())),
(var0, var1) -> RotationTuple.of(var0.yaw(), var0.pitch().add(var1)),
(var0, var1) -> {
if (var0.yaw() == Rotation.None && var0.pitch() == Rotation.Ninety) {
class="kw">return var0;
}
class="kw">return class="kw">switch (var0.yaw().add(var1)) {
case None, OneEighty -> RotationTuple.of(Rotation.None, Rotation.None);
case Ninety, TwoSeventy -> RotationTuple.of(Rotation.Ninety, Rotation.Ninety);
};
}
),
DoublePipe(
com.hypixel.hytale.protocol.VariantRotation.DoublePipe,
new RotationTuple[]{
RotationTuple.of(Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.OneEighty)
},
var0 -> {
class="kw">return class="kw">switch (var0.pitch()) {
case OneEighty -> RotationTuple.of(Rotation.None, Rotation.OneEighty);
case Ninety -> var0;
case TwoSeventy -> RotationTuple.of(var0.yaw().flip(), Rotation.Ninety);
class="kw">default -> RotationTuple.NONE;
};
},
(var0, var1) -> (var0.yaw() == Rotation.Ninety || var0.yaw() == Rotation.TwoSeventy) && var0.pitch() == Rotation.Ninety
? var0
: RotationTuple.getRotation(
new RotationTuple[]{
RotationTuple.NONE,
RotationTuple.of(Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety)
},
var0,
var1
),
(var0, var1) -> var0.yaw() != Rotation.None || var0.pitch() != Rotation.Ninety && var0.pitch() != Rotation.TwoSeventy
? RotationTuple.getRotation(
new RotationTuple[]{
RotationTuple.NONE,
RotationTuple.of(Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety)
},
var0,
var1
)
: var0
),
NESW(
com.hypixel.hytale.protocol.VariantRotation.NESW,
new RotationTuple[]{
RotationTuple.of(Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None)
},
var0 -> RotationTuple.of(var0.yaw(), Rotation.None),
(var0, var1) -> var0,
(var0, var1) -> var0
),
UpDownNESW(
com.hypixel.hytale.protocol.VariantRotation.UpDownNESW,
new RotationTuple[]{
RotationTuple.of(Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty)
},
var0 -> var0.pitch() == Rotation.OneEighty ? RotationTuple.of(var0.yaw(), Rotation.OneEighty) : RotationTuple.of(var0.yaw(), Rotation.None),
(var0, var1) -> RotationTuple.of(var0.yaw(), var0.pitch().add(var1)),
(var0, var1) -> var0.pitch().add(var1) == Rotation.OneEighty ? RotationTuple.of(var0.yaw(), Rotation.OneEighty) : var0
),
Debug(
com.hypixel.hytale.protocol.VariantRotation.UpDownNESW,
new RotationTuple[]{
RotationTuple.of(Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty),
RotationTuple.of(Rotation.None, Rotation.TwoSeventy),
RotationTuple.of(Rotation.Ninety, Rotation.TwoSeventy),
RotationTuple.of(Rotation.OneEighty, Rotation.TwoSeventy),
RotationTuple.of(Rotation.TwoSeventy, Rotation.TwoSeventy)
},
Function.identity(),
(var0, var1) -> RotationTuple.of(var0.yaw(), var0.pitch().add(var1)),
(var0, var1) -> var0
),
All(
com.hypixel.hytale.protocol.VariantRotation.All,
new RotationTuple[]{
RotationTuple.of(Rotation.None, Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.None, Rotation.None, Rotation.TwoSeventy),
RotationTuple.of(Rotation.None, Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.None, Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.None, Rotation.Ninety, Rotation.TwoSeventy),
RotationTuple.of(Rotation.None, Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.None, Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.None, Rotation.OneEighty, Rotation.TwoSeventy),
RotationTuple.of(Rotation.None, Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.None, Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.None, Rotation.TwoSeventy, Rotation.OneEighty),
RotationTuple.of(Rotation.None, Rotation.TwoSeventy, Rotation.TwoSeventy),
RotationTuple.of(Rotation.Ninety, Rotation.None, Rotation.None),
RotationTuple.of(Rotation.Ninety, Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.None, Rotation.TwoSeventy),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.Ninety, Rotation.TwoSeventy),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.OneEighty, Rotation.TwoSeventy),
RotationTuple.of(Rotation.Ninety, Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.Ninety, Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.Ninety, Rotation.TwoSeventy, Rotation.OneEighty),
RotationTuple.of(Rotation.Ninety, Rotation.TwoSeventy, Rotation.TwoSeventy),
RotationTuple.of(Rotation.OneEighty, Rotation.None, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.None, Rotation.TwoSeventy),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.Ninety, Rotation.TwoSeventy),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.OneEighty, Rotation.TwoSeventy),
RotationTuple.of(Rotation.OneEighty, Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.OneEighty, Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.OneEighty, Rotation.TwoSeventy, Rotation.OneEighty),
RotationTuple.of(Rotation.OneEighty, Rotation.TwoSeventy, Rotation.TwoSeventy),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.None, Rotation.TwoSeventy),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.Ninety, Rotation.TwoSeventy),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.OneEighty, Rotation.TwoSeventy),
RotationTuple.of(Rotation.TwoSeventy, Rotation.TwoSeventy, Rotation.None),
RotationTuple.of(Rotation.TwoSeventy, Rotation.TwoSeventy, Rotation.Ninety),
RotationTuple.of(Rotation.TwoSeventy, Rotation.TwoSeventy, Rotation.OneEighty),
RotationTuple.of(Rotation.TwoSeventy, Rotation.TwoSeventy, Rotation.TwoSeventy)
},
Function.identity(),
(var0, var1) -> RotationTuple.of(var0.yaw(), var0.pitch().add(var1)),
(var0, var1) -> var0
);
class="kw">public class="kw">static class="kw">final VariantRotation[] EMPTY_ARRAY = new VariantRotation[0];
class="kw">private class="kw">final com.hypixel.hytale.protocol.VariantRotation protocolType;
class="kw">private class="kw">final RotationTuple[] rotations;
class="kw">private class="kw">final Function<RotationTuple, RotationTuple> verify;
class="kw">private class="kw">final BiFunction<RotationTuple, Rotation, RotationTuple> rotateX;
class="kw">private class="kw">final BiFunction<RotationTuple, Rotation, RotationTuple> rotateZ;
@Nonnull
class="kw">private class="kw">static Rotation validatePipe(@Nonnull Rotation var0) {
class="kw">return class="kw">switch (var0) {
case None, Ninety -> var0;
case OneEighty -> Rotation.None;
case TwoSeventy -> Rotation.Ninety;
};
}
VariantRotation(
com.hypixel.hytale.protocol.VariantRotation nullxx,
RotationTuple[] nullxxx,
Function<RotationTuple, RotationTuple> nullxxxx,
BiFunction<RotationTuple, Rotation, RotationTuple> nullxxxxx,
BiFunction<RotationTuple, Rotation, RotationTuple> nullxxxxxx
) {
this.protocolType = nullxx;
this.rotations = nullxxx;
this.verify = nullxxxx;
this.rotateX = nullxxxxx;
this.rotateZ = nullxxxxxx;
}
class="kw">public RotationTuple[] getRotations() {
class="kw">return this.rotations;
}
class="kw">public RotationTuple rotateX(RotationTuple var1, Rotation var2) {
class="kw">return this.rotateX.apply(var1, var2);
}
class="kw">public RotationTuple rotateZ(RotationTuple var1, Rotation var2) {
class="kw">return this.rotateZ.apply(var1, var2);
}
class="kw">public RotationTuple verify(RotationTuple var1) {
class="kw">return this.verify.apply(var1);
}
class="kw">public com.hypixel.hytale.protocol.VariantRotation toPacket() {
class="kw">return this.protocolType;
}
}