SelectedHitEntity.java
package com.hypixel.hytale.protocol;
import com.hypixel.hytale.protocol.io.ValidationResult;
import io.netty.buffer.ByteBuf;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class SelectedHitEntity {
public static final int NULLABLE_BIT_FIELD_SIZE = 1;
public static final int FIXED_BLOCK_SIZE = 53;
public static final int VARIABLE_FIELD_COUNT = 0;
public static final int VARIABLE_BLOCK_START = 53;
public static final int MAX_SIZE = 53;
public networkId;
Vector3f hitLocation;
Position position;
Direction bodyRotation;
{
}
{
.networkId = networkId;
.hitLocation = hitLocation;
.position = position;
.bodyRotation = bodyRotation;
}
{
.networkId = other.networkId;
.hitLocation = other.hitLocation;
.position = other.position;
.bodyRotation = other.bodyRotation;
}
SelectedHitEntity {
();
buf.getByte(offset);
obj.networkId = buf.getIntLE(offset + );
((nullBits & ) != ) {
obj.hitLocation = Vector3f.deserialize(buf, offset + );
}
((nullBits & ) != ) {
obj.position = Position.deserialize(buf, offset + );
}
((nullBits & ) != ) {
obj.bodyRotation = Direction.deserialize(buf, offset + );
}
obj;
}
{
;
}
{
;
(.hitLocation != ) {
nullBits = ()(nullBits | );
}
(.position != ) {
nullBits = ()(nullBits | );
}
(.bodyRotation != ) {
nullBits = ()(nullBits | );
}
buf.writeByte(nullBits);
buf.writeIntLE(.networkId);
(.hitLocation != ) {
.hitLocation.serialize(buf);
} {
buf.writeZero();
}
(.position != ) {
.position.serialize(buf);
} {
buf.writeZero();
}
(.bodyRotation != ) {
.bodyRotation.serialize(buf);
} {
buf.writeZero();
}
}
{
;
}
ValidationResult {
buffer.readableBytes() - offset < ? ValidationResult.error() : ValidationResult.OK;
}
SelectedHitEntity {
();
copy.networkId = .networkId;
copy.hitLocation = .hitLocation != ? .hitLocation.clone() : ;
copy.position = .position != ? .position.clone() : ;
copy.bodyRotation = .bodyRotation != ? .bodyRotation.clone() : ;
copy;
}
{
( == obj) {
;
} (!(obj SelectedHitEntity)) {
;
} {
(SelectedHitEntity)obj;
.networkId == other.networkId && Objects.equals(.hitLocation, other.hitLocation) && Objects.equals(.position, other.position) && Objects.equals(.bodyRotation, other.bodyRotation);
}
}
{
Objects.hash( []{.networkId, .hitLocation, .position, .bodyRotation});
}
}