UpdateWeather class
Пакет: com.hypixel.hytale.protocol.packets.world
Файл: com/hypixel/hytale/protocol/packets/world/UpdateWeather.java
implements: Packet, ToClientPacket
Поля (4)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
PACKET_ID |
|
UpdateWeather |
var1 |
|
long |
var2 |
|
UpdateWeather |
var3 |
Методы (17)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
UpdateWeather |
cloneUpdateWeather clone() |
static |
float |
getTransitionSecondsfloat getTransitionSeconds(MemorySegment var0) |
static |
float |
getTransitionSecondsfloat getTransitionSeconds(MemorySegment var0, int var1) |
abstract |
return |
getTransitionSecondsreturn getTransitionSeconds(var0, 0) |
static |
int |
getWeatherIndexint getWeatherIndex(MemorySegment var0) |
static |
int |
getWeatherIndexint getWeatherIndex(MemorySegment var0, int var1) |
abstract |
return |
getWeatherIndexreturn getWeatherIndex(var0, 0) |
|
|
if if(var1 < 0) |
|
|
if if(var2 != null) |
|
|
if if(this == var1) |
static |
void |
requireBoundsvoid requireBounds(MemorySegment var0, int var1) |
abstract |
|
requireBounds requireBounds(var0, var1) |
static |
UpdateWeather |
toObjectUpdateWeather toObject(MemorySegment var0) |
static |
UpdateWeather |
toObjectUpdateWeather toObject(MemorySegment var0, int var1) |
static |
UpdateWeather |
toObjectUpdateWeather 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.packets.world;
class="kw">import com.hypixel.hytale.protocol.NetworkChannel;
class="kw">import com.hypixel.hytale.protocol.Packet;
class="kw">import com.hypixel.hytale.protocol.ToClientPacket;
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 UpdateWeather class="kw">implements Packet, ToClientPacket {
class="kw">public class="kw">static class="kw">final int PACKET_ID = 149;
class="kw">public class="kw">static class="kw">final boolean IS_COMPRESSED = false;
class="kw">public class="kw">static class="kw">final int NULLABLE_BIT_FIELD_SIZE = 0;
class="kw">public class="kw">static class="kw">final int FIXED_BLOCK_SIZE = 8;
class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 0;
class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 8;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 8;
class="kw">public int weatherIndex;
class="kw">public float transitionSeconds;
@Override
class="kw">public int getId() {
class="kw">return 149;
}
@Override
class="kw">public NetworkChannel getChannel() {
class="kw">return NetworkChannel.Default;
}
class="kw">public UpdateWeather() {
}
class="kw">public UpdateWeather(int var1, float var2) {
this.weatherIndex = var1;
this.transitionSeconds = var2;
}
class="kw">public UpdateWeather(@Nonnull UpdateWeather var1) {
this.weatherIndex = var1.weatherIndex;
this.transitionSeconds = var1.transitionSeconds;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("UpdateWeather", var1, (int)var0.byteSize());
}
long var2 = var1 + 8L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("UpdateWeather", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static int getWeatherIndex(MemorySegment var0) {
class="kw">return getWeatherIndex(var0, 0);
}
class="kw">public class="kw">static int getWeatherIndex(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_INT, var1 + 0);
}
class="kw">public class="kw">static float getTransitionSeconds(MemorySegment var0) {
class="kw">return getTransitionSeconds(var0, 0);
}
class="kw">public class="kw">static float getTransitionSeconds(MemorySegment var0, int var1) {
class="kw">return PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 4), "TransitionSeconds");
}
class="kw">public class="kw">static UpdateWeather toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static UpdateWeather toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static UpdateWeather toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
UpdateWeather var3 = new UpdateWeather(
var0.get(PacketIO.PROTO_INT, var1 + 0), PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 4), "TransitionSeconds")
);
if (var2 != null) {
var2.position = var1 + 8;
}
class="kw">return var3;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
var1.set(PacketIO.PROTO_INT, var2 + 0, this.weatherIndex);
PacketIO.requireFinite(this.transitionSeconds, "TransitionSeconds");
var1.set(PacketIO.PROTO_FLOAT, var2 + 4, this.transitionSeconds);
class="kw">return 8;
}
@Override
class="kw">public int computeSize() {
class="kw">return 8;
}
class="kw">public UpdateWeather clone() {
UpdateWeather var1 = new UpdateWeather();
var1.weatherIndex = this.weatherIndex;
var1.transitionSeconds = this.transitionSeconds;
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 UpdateWeather var2) ? false : this.weatherIndex == var2.weatherIndex && this.transitionSeconds == var2.transitionSeconds;
}
}
@Override
class="kw">public int hashCode() {
class="kw">return Objects.hash(this.weatherIndex, this.transitionSeconds);
}
}