mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Minor cleanup
This commit is contained in:
@@ -33,7 +33,6 @@ import org.cloudburstmc.math.vector.Vector3f;
|
|||||||
import org.cloudburstmc.protocol.bedrock.data.AttributeData;
|
import org.cloudburstmc.protocol.bedrock.data.AttributeData;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
|
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.entity.EntityDefinition;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
|
||||||
import org.geysermc.geyser.entity.type.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.entity.type.player.SessionPlayerEntity;
|
import org.geysermc.geyser.entity.type.player.SessionPlayerEntity;
|
||||||
import org.geysermc.geyser.entity.vehicle.ClientVehicle;
|
import org.geysermc.geyser.entity.vehicle.ClientVehicle;
|
||||||
@@ -201,14 +200,8 @@ public class HappyGhastEntity extends AnimalEntity implements ClientVehicle {
|
|||||||
protected void updateAttribute(Attribute javaAttribute, List<AttributeData> newAttributes) {
|
protected void updateAttribute(Attribute javaAttribute, List<AttributeData> newAttributes) {
|
||||||
super.updateAttribute(javaAttribute, newAttributes);
|
super.updateAttribute(javaAttribute, newAttributes);
|
||||||
if (javaAttribute.getType() instanceof AttributeType.Builtin type) {
|
if (javaAttribute.getType() instanceof AttributeType.Builtin type) {
|
||||||
switch (type) {
|
if (type == AttributeType.Builtin.CAMERA_DISTANCE) {
|
||||||
case FLYING_SPEED -> {
|
vehicleComponent.setCameraDistance((float) AttributeUtils.calculateValue(javaAttribute));
|
||||||
AttributeData attributeData = calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED);
|
|
||||||
vehicleComponent.setFlyingSpeed(attributeData.getValue());
|
|
||||||
}
|
|
||||||
case CAMERA_DISTANCE -> {
|
|
||||||
vehicleComponent.setCameraDistance((float) AttributeUtils.calculateValue(javaAttribute));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,9 +213,6 @@ public class MapHasher<Type> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HashCode build() {
|
public HashCode build() {
|
||||||
if (unhashed != null) {
|
|
||||||
System.out.println(unhashed);
|
|
||||||
}
|
|
||||||
return encoder.map(map);
|
return encoder.map(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,10 +149,6 @@ public class JavaRegistries {
|
|||||||
private record HardcodedLookup<T>(List<T> registry, RegistryNetworkMapper<T> networkMapper, RegistryIdentifierMapper<T> identifierMapper,
|
private record HardcodedLookup<T>(List<T> registry, RegistryNetworkMapper<T> networkMapper, RegistryIdentifierMapper<T> identifierMapper,
|
||||||
RegistryIdMapper idMapper) implements JavaRegistryKey.RegistryLookup<T> {
|
RegistryIdMapper idMapper) implements JavaRegistryKey.RegistryLookup<T> {
|
||||||
|
|
||||||
public HardcodedLookup {
|
|
||||||
System.out.println(registry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<RegistryEntryData<T>> entry(GeyserSession session, JavaRegistryKey<T> registryKey, int networkId) {
|
public Optional<RegistryEntryData<T>> entry(GeyserSession session, JavaRegistryKey<T> registryKey, int networkId) {
|
||||||
return Optional.ofNullable(registry.get(networkId))
|
return Optional.ofNullable(registry.get(networkId))
|
||||||
|
|||||||
Reference in New Issue
Block a user