FaceTagConnectedBlockRule class
Пакет: com.hypixel.hytale.protocol
Файл: com/hypixel/hytale/protocol/FaceTagConnectedBlockRule.java
extends: ConnectedBlockRule
Поля (15)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
NULLABLE_BIT_FIELD_SIZE |
|
int |
var1 |
|
FaceTagConnectedBlockRule |
var1 |
|
long |
var2 |
|
byte |
var2 |
|
int |
var3 |
|
byte |
var3 |
|
|
var3 |
|
int |
var4 |
|
|
var4 |
|
int |
var4 |
|
ReadCursor |
var5 |
|
ConnectedBlockFaceTags |
var6 |
|
|
var6 |
|
FaceTagConnectedBlockRule |
var7 |
Методы (22)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
FaceTagConnectedBlockRule |
cloneFaceTagConnectedBlockRule clone() |
abstract |
return |
getFaceTagsreturn getFaceTags(var0, 0) |
static |
ConnectedBlockMatchType |
getMatchTypeConnectedBlockMatchType getMatchType(MemorySegment var0) |
static |
ConnectedBlockMatchType |
getMatchTypeConnectedBlockMatchType getMatchType(MemorySegment var0, int var1) |
abstract |
return |
getMatchTypereturn getMatchType(var0, 0) |
static |
Vector3i |
getPositionOffsetVector3i getPositionOffset(MemorySegment var0) |
static |
Vector3i |
getPositionOffsetVector3i getPositionOffset(MemorySegment var0, int var1) |
abstract |
return |
getPositionOffsetreturn getPositionOffset(var0, 0) |
static |
boolean |
hasFaceTagsboolean hasFaceTags(MemorySegment var0, int var1) |
|
|
if if(var1 < 0) |
|
|
if if(var2 != null) |
|
|
if if(this.faceTags != null) |
|
|
if if(this.faceTags != null) |
|
|
if if(this.faceTags != null) |
|
|
if if(this == var1) |
static |
void |
requireBoundsvoid requireBounds(MemorySegment var0, int var1) |
abstract |
|
requireBounds requireBounds(var0, var1) |
static |
FaceTagConnectedBlockRule |
toObjectFaceTagConnectedBlockRule toObject(MemorySegment var0) |
static |
FaceTagConnectedBlockRule |
toObjectFaceTagConnectedBlockRule toObject(MemorySegment var0, int var1) |
static |
FaceTagConnectedBlockRule |
toObjectFaceTagConnectedBlockRule toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) |
abstract |
return |
toObjectreturn toObject(var0, 0, null) |
abstract |
return |
toObjectreturn toObject(var0, var1, null) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.protocol;
class="kw">import com.hypixel.hytale.protocol.io.PacketIO;
class="kw">import com.hypixel.hytale.protocol.io.ProtocolException;
class="kw">import com.hypixel.hytale.protocol.io.ReadCursor;
class="kw">import java.lang.foreign.MemorySegment;
class="kw">import java.util.Objects;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class FaceTagConnectedBlockRule class="kw">extends ConnectedBlockRule {
class="kw">public class="kw">static class="kw">final int NULLABLE_BIT_FIELD_SIZE = 1;
class="kw">public class="kw">static class="kw">final int FIXED_BLOCK_SIZE = 14;
class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 1;
class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 14;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
@Nonnull
class="kw">public Vector3i positionOffset = new Vector3i();
@Nullable
class="kw">public ConnectedBlockFaceTags faceTags;
@Nonnull
class="kw">public ConnectedBlockMatchType matchType = ConnectedBlockMatchType.Any;
class="kw">public FaceTagConnectedBlockRule() {
}
class="kw">public FaceTagConnectedBlockRule(@Nonnull Vector3i var1, @Nullable ConnectedBlockFaceTags var2, @Nonnull ConnectedBlockMatchType var3) {
this.positionOffset = var1;
this.faceTags = var2;
this.matchType = var3;
}
class="kw">public FaceTagConnectedBlockRule(@Nonnull FaceTagConnectedBlockRule var1) {
this.positionOffset = var1.positionOffset;
this.faceTags = var1.faceTags;
this.matchType = var1.matchType;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("FaceTagConnectedBlockRule", var1, (int)var0.byteSize());
}
long var2 = var1 + 14L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("FaceTagConnectedBlockRule", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static Vector3i getPositionOffset(MemorySegment var0) {
class="kw">return getPositionOffset(var0, 0);
}
class="kw">public class="kw">static Vector3i getPositionOffset(MemorySegment var0, int var1) {
class="kw">return Vector3i.toObject(var0, var1 + 1);
}
@Nullable
class="kw">public class="kw">static ConnectedBlockFaceTags getFaceTags(MemorySegment var0) {
class="kw">return getFaceTags(var0, 0);
}
@Nullable
class="kw">public class="kw">static ConnectedBlockFaceTags getFaceTags(MemorySegment var0, int var1) {
class="kw">return hasFaceTags(var0, var1) ? ConnectedBlockFaceTags.toObject(var0, var1 + 14) : null;
}
class="kw">public class="kw">static ConnectedBlockMatchType getMatchType(MemorySegment var0) {
class="kw">return getMatchType(var0, 0);
}
class="kw">public class="kw">static ConnectedBlockMatchType getMatchType(MemorySegment var0, int var1) {
class="kw">return ConnectedBlockMatchType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 13));
}
class="kw">public class="kw">static boolean hasFaceTags(MemorySegment var0, int var1) {
byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
class="kw">return (var2 & 1) != 0;
}
class="kw">public class="kw">static FaceTagConnectedBlockRule toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static FaceTagConnectedBlockRule toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static FaceTagConnectedBlockRule toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 14;
int var4 = 0;
ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
ConnectedBlockFaceTags var6 = null;
if (hasFaceTags(var0, var1)) {
var6 = ConnectedBlockFaceTags.toObject(var0, var3 + var4, var5);
var4 = var5.position - var3;
}
FaceTagConnectedBlockRule var7 = new FaceTagConnectedBlockRule(
Vector3i.toObject(var0, var1 + 1), var6, ConnectedBlockMatchType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 13))
);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var7;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
byte var3 = 0;
if (this.faceTags != null) {
var3 = (byte)(var3 | 1);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
this.positionOffset.serialize(var1, var2 + 1);
var1.set(PacketIO.PROTO_BYTE, var2 + 13, (byte)this.matchType.getValue());
int var4 = var2 + 14;
if (this.faceTags != null) {
var4 += this.faceTags.serialize(var1, var4);
}
class="kw">return var4 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 14;
if (this.faceTags != null) {
var1 += this.faceTags.computeSize();
}
class="kw">return var1;
}
class="kw">public FaceTagConnectedBlockRule clone() {
FaceTagConnectedBlockRule var1 = new FaceTagConnectedBlockRule();
var1.positionOffset = this.positionOffset.clone();
var1.faceTags = this.faceTags != null ? this.faceTags.clone() : null;
var1.matchType = this.matchType;
class="kw">return var1;
}
@Override
class="kw">public boolean equals(Object var1) {
if (this == var1) {
class="kw">return true;
} else {
class="kw">return !(var1 class="kw">instanceof FaceTagConnectedBlockRule var2)
? false
: Objects.equals(this.positionOffset, var2.positionOffset)
&& Objects.equals(this.faceTags, var2.faceTags)
&& Objects.equals(this.matchType, var2.matchType);
}
}
@Override
class="kw">public int hashCode() {
class="kw">return Objects.hash(this.positionOffset, this.faceTags, this.matchType);
}
}