ReverbEffect.java
package com.hypixel.hytale.protocol;
import com.hypixel.hytale.protocol.io.PacketIO;
import com.hypixel.hytale.protocol.io.ProtocolException;
import com.hypixel.hytale.protocol.io.ValidationResult;
import com.hypixel.hytale.protocol.io.VarInt;
import io.netty.buffer.ByteBuf;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class ReverbEffect {
public static final int NULLABLE_BIT_FIELD_SIZE = 1;
public static final int FIXED_BLOCK_SIZE = 54;
public static final int VARIABLE_FIELD_COUNT = 1;
public static final int VARIABLE_BLOCK_START = 54;
public static final ;
String id;
dryGain;
modalDensity;
diffusion;
gain;
highFrequencyGain;
decayTime;
highFrequencyDecayRatio;
reflectionGain;
reflectionDelay;
lateReverbGain;
lateReverbDelay;
roomRolloffFactor;
airAbsorptionHighFrequencyGain;
limitDecayHighFrequency;
{
}
{
.id = id;
.dryGain = dryGain;
.modalDensity = modalDensity;
.diffusion = diffusion;
.gain = gain;
.highFrequencyGain = highFrequencyGain;
.decayTime = decayTime;
.highFrequencyDecayRatio = highFrequencyDecayRatio;
.reflectionGain = reflectionGain;
.reflectionDelay = reflectionDelay;
.lateReverbGain = lateReverbGain;
.lateReverbDelay = lateReverbDelay;
.roomRolloffFactor = roomRolloffFactor;
.airAbsorptionHighFrequencyGain = airAbsorptionHighFrequencyGain;
.limitDecayHighFrequency = limitDecayHighFrequency;
}
{
.id = other.id;
.dryGain = other.dryGain;
.modalDensity = other.modalDensity;
.diffusion = other.diffusion;
.gain = other.gain;
.highFrequencyGain = other.highFrequencyGain;
.decayTime = other.decayTime;
.highFrequencyDecayRatio = other.highFrequencyDecayRatio;
.reflectionGain = other.reflectionGain;
.reflectionDelay = other.reflectionDelay;
.lateReverbGain = other.lateReverbGain;
.lateReverbDelay = other.lateReverbDelay;
.roomRolloffFactor = other.roomRolloffFactor;
.airAbsorptionHighFrequencyGain = other.airAbsorptionHighFrequencyGain;
.limitDecayHighFrequency = other.limitDecayHighFrequency;
}
ReverbEffect {
();
buf.getByte(offset);
obj.dryGain = buf.getFloatLE(offset + );
obj.modalDensity = buf.getFloatLE(offset + );
obj.diffusion = buf.getFloatLE(offset + );
obj.gain = buf.getFloatLE(offset + );
obj.highFrequencyGain = buf.getFloatLE(offset + );
obj.decayTime = buf.getFloatLE(offset + );
obj.highFrequencyDecayRatio = buf.getFloatLE(offset + );
obj.reflectionGain = buf.getFloatLE(offset + );
obj.reflectionDelay = buf.getFloatLE(offset + );
obj.lateReverbGain = buf.getFloatLE(offset + );
obj.lateReverbDelay = buf.getFloatLE(offset + );
obj.roomRolloffFactor = buf.getFloatLE(offset + );
obj.airAbsorptionHighFrequencyGain = buf.getFloatLE(offset + );
obj.limitDecayHighFrequency = buf.getByte(offset + ) != ;
offset + ;
((nullBits & ) != ) {
VarInt.peek(buf, pos);
(idLen < ) {
ProtocolException.negativeLength(, idLen);
}
(idLen > ) {
ProtocolException.stringTooLong(, idLen, );
}
VarInt.length(buf, pos);
obj.id = PacketIO.readVarString(buf, pos, PacketIO.UTF8);
pos + idVarLen + idLen;
}
obj;
}
{
buf.getByte(offset);
offset + ;
((nullBits & ) != ) {
VarInt.peek(buf, pos);
pos += VarInt.length(buf, pos) + sl;
}
pos - offset;
}
{
;
(.id != ) {
nullBits = ()(nullBits | );
}
buf.writeByte(nullBits);
buf.writeFloatLE(.dryGain);
buf.writeFloatLE(.modalDensity);
buf.writeFloatLE(.diffusion);
buf.writeFloatLE(.gain);
buf.writeFloatLE(.highFrequencyGain);
buf.writeFloatLE(.decayTime);
buf.writeFloatLE(.highFrequencyDecayRatio);
buf.writeFloatLE(.reflectionGain);
buf.writeFloatLE(.reflectionDelay);
buf.writeFloatLE(.lateReverbGain);
buf.writeFloatLE(.lateReverbDelay);
buf.writeFloatLE(.roomRolloffFactor);
buf.writeFloatLE(.airAbsorptionHighFrequencyGain);
buf.writeByte(.limitDecayHighFrequency ? : );
(.id != ) {
PacketIO.writeVarString(buf, .id, );
}
}
{
;
(.id != ) {
size += PacketIO.stringSize(.id);
}
size;
}
ValidationResult {
(buffer.readableBytes() - offset < ) {
ValidationResult.error();
} {
buffer.getByte(offset);
offset + ;
((nullBits & ) != ) {
VarInt.peek(buffer, pos);
(idLen < ) {
ValidationResult.error();
}
(idLen > ) {
ValidationResult.error();
}
pos += VarInt.length(buffer, pos);
pos += idLen;
(pos > buffer.writerIndex()) {
ValidationResult.error();
}
}
ValidationResult.OK;
}
}
ReverbEffect {
();
copy.id = .id;
copy.dryGain = .dryGain;
copy.modalDensity = .modalDensity;
copy.diffusion = .diffusion;
copy.gain = .gain;
copy.highFrequencyGain = .highFrequencyGain;
copy.decayTime = .decayTime;
copy.highFrequencyDecayRatio = .highFrequencyDecayRatio;
copy.reflectionGain = .reflectionGain;
copy.reflectionDelay = .reflectionDelay;
copy.lateReverbGain = .lateReverbGain;
copy.lateReverbDelay = .lateReverbDelay;
copy.roomRolloffFactor = .roomRolloffFactor;
copy.airAbsorptionHighFrequencyGain = .airAbsorptionHighFrequencyGain;
copy.limitDecayHighFrequency = .limitDecayHighFrequency;
copy;
}
{
( == obj) {
;
} (!(obj ReverbEffect)) {
;
} {
(ReverbEffect)obj;
Objects.equals(.id, other.id) && .dryGain == other.dryGain && .modalDensity == other.modalDensity && .diffusion == other.diffusion && .gain == other.gain && .highFrequencyGain == other.highFrequencyGain && .decayTime == other.decayTime && .highFrequencyDecayRatio == other.highFrequencyDecayRatio && .reflectionGain == other.reflectionGain && .reflectionDelay == other.reflectionDelay && .lateReverbGain == other.lateReverbGain && .lateReverbDelay == other.lateReverbDelay && .roomRolloffFactor == other.roomRolloffFactor && .airAbsorptionHighFrequencyGain == other.airAbsorptionHighFrequencyGain && .limitDecayHighFrequency == other.limitDecayHighFrequency;
}
}
{
Objects.hash( []{.id, .dryGain, .modalDensity, .diffusion, .gain, .highFrequencyGain, .decayTime, .highFrequencyDecayRatio, .reflectionGain, .reflectionDelay, .lateReverbGain, .lateReverbDelay, .roomRolloffFactor, .airAbsorptionHighFrequencyGain, .limitDecayHighFrequency});
}
}