2019-12-01 00:19:03 +00:00
|
|
|
/*
|
2022-01-01 19:03:05 +00:00
|
|
|
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
|
2019-12-01 00:19:03 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* @author GeyserMC
|
|
|
|
* @link https://github.com/GeyserMC/Geyser
|
|
|
|
*/
|
|
|
|
|
2021-11-20 23:29:46 +00:00
|
|
|
package org.geysermc.geyser.entity.type;
|
2019-12-01 00:19:03 +00:00
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute;
|
2021-11-23 15:55:20 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.attribute.AttributeType;
|
2019-12-01 00:19:03 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
2021-06-05 02:26:29 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose;
|
2021-11-18 03:02:38 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata;
|
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata;
|
2021-11-20 19:25:21 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
2022-02-25 03:49:10 +00:00
|
|
|
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
|
|
|
|
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
|
|
|
import com.github.steveice10.opennbt.tag.builtin.StringTag;
|
2019-12-01 00:19:03 +00:00
|
|
|
import com.nukkitx.math.vector.Vector3f;
|
2020-11-10 17:05:16 +00:00
|
|
|
import com.nukkitx.math.vector.Vector3i;
|
2020-06-30 01:33:42 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.data.AttributeData;
|
2020-06-23 00:11:09 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
2020-07-31 02:10:55 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
2020-06-23 00:11:09 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.data.inventory.ContainerId;
|
|
|
|
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
|
2019-12-01 00:19:03 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.packet.MobArmorEquipmentPacket;
|
2020-01-11 19:05:29 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.packet.MobEquipmentPacket;
|
2020-06-30 01:33:42 +00:00
|
|
|
import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket;
|
2021-07-08 02:44:53 +00:00
|
|
|
import lombok.AccessLevel;
|
2019-12-01 00:19:03 +00:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
2021-11-20 23:29:46 +00:00
|
|
|
import org.geysermc.geyser.entity.EntityDefinition;
|
2021-11-20 21:34:30 +00:00
|
|
|
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
2022-02-25 03:49:10 +00:00
|
|
|
import org.geysermc.geyser.inventory.GeyserItemStack;
|
2021-11-20 21:34:30 +00:00
|
|
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
2022-05-25 23:17:49 +00:00
|
|
|
import org.geysermc.geyser.session.GeyserSession;
|
2021-11-20 23:29:46 +00:00
|
|
|
import org.geysermc.geyser.util.AttributeUtils;
|
|
|
|
import org.geysermc.geyser.util.ChunkUtils;
|
2022-02-25 03:49:10 +00:00
|
|
|
import org.geysermc.geyser.util.InteractionResult;
|
2020-06-30 01:33:42 +00:00
|
|
|
|
2022-05-25 23:17:49 +00:00
|
|
|
import java.util.*;
|
2019-12-01 00:19:03 +00:00
|
|
|
|
|
|
|
@Getter
|
|
|
|
@Setter
|
|
|
|
public class LivingEntity extends Entity {
|
|
|
|
|
2020-02-13 22:35:07 +00:00
|
|
|
protected ItemData helmet = ItemData.AIR;
|
|
|
|
protected ItemData chestplate = ItemData.AIR;
|
|
|
|
protected ItemData leggings = ItemData.AIR;
|
|
|
|
protected ItemData boots = ItemData.AIR;
|
|
|
|
protected ItemData hand = ItemData.AIR;
|
2020-02-14 01:47:45 +00:00
|
|
|
protected ItemData offHand = ItemData.AIR;
|
2019-12-01 00:19:03 +00:00
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
@Getter(value = AccessLevel.NONE)
|
|
|
|
protected float health = 1f; // The default value in Java Edition before any entity metadata is sent
|
|
|
|
@Getter(value = AccessLevel.NONE)
|
|
|
|
protected float maxHealth = 20f; // The value Java Edition defaults to if no attribute is given
|
|
|
|
|
2021-06-18 23:09:18 +00:00
|
|
|
/**
|
|
|
|
* A convenience variable for if the entity has reached the maximum frozen ticks and should be shaking
|
|
|
|
*/
|
|
|
|
private boolean isMaxFrozenState = false;
|
|
|
|
|
2021-12-21 00:25:11 +00:00
|
|
|
public LivingEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
2021-11-18 03:02:38 +00:00
|
|
|
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
|
|
|
|
}
|
2021-07-08 02:44:53 +00:00
|
|
|
|
2021-11-18 03:02:38 +00:00
|
|
|
@Override
|
|
|
|
protected void initializeMetadata() {
|
|
|
|
super.initializeMetadata();
|
2021-07-08 02:44:53 +00:00
|
|
|
// Matches Bedrock behavior; is always set to this
|
2021-11-18 03:02:38 +00:00
|
|
|
dirtyMetadata.put(EntityData.HEALTH, 1);
|
2019-12-01 00:19:03 +00:00
|
|
|
}
|
|
|
|
|
2021-11-20 19:25:21 +00:00
|
|
|
public void setLivingEntityFlags(ByteEntityMetadata entityMetadata) {
|
|
|
|
byte xd = entityMetadata.getPrimitiveValue();
|
2021-11-18 03:02:38 +00:00
|
|
|
|
2022-03-15 17:34:56 +00:00
|
|
|
boolean isUsingItem = (xd & 0x01) == 0x01;
|
|
|
|
boolean isUsingOffhand = (xd & 0x02) == 0x02;
|
|
|
|
|
2021-11-18 03:02:38 +00:00
|
|
|
ItemMapping shield = session.getItemMappings().getStoredItems().shield();
|
2022-03-15 17:34:56 +00:00
|
|
|
boolean isUsingShield = hasShield(isUsingOffhand, shield);
|
|
|
|
|
|
|
|
setFlag(EntityFlag.USING_ITEM, isUsingItem && !isUsingShield);
|
|
|
|
// Override the blocking
|
|
|
|
setFlag(EntityFlag.BLOCKING, isUsingItem && isUsingShield);
|
2019-12-01 00:19:03 +00:00
|
|
|
|
2021-11-18 03:02:38 +00:00
|
|
|
// Riptide spin attack
|
|
|
|
setFlag(EntityFlag.DAMAGE_NEARBY_MOBS, (xd & 0x04) == 0x04);
|
|
|
|
}
|
|
|
|
|
2021-11-20 19:25:21 +00:00
|
|
|
public void setHealth(FloatEntityMetadata entityMetadata) {
|
|
|
|
this.health = entityMetadata.getPrimitiveValue();
|
2021-11-18 03:02:38 +00:00
|
|
|
|
|
|
|
AttributeData healthData = createHealthAttribute();
|
|
|
|
UpdateAttributesPacket attributesPacket = new UpdateAttributesPacket();
|
|
|
|
attributesPacket.setRuntimeEntityId(geyserId);
|
|
|
|
attributesPacket.setAttributes(Collections.singletonList(healthData));
|
|
|
|
session.sendUpstreamPacket(attributesPacket);
|
|
|
|
}
|
|
|
|
|
2022-05-25 23:17:49 +00:00
|
|
|
public Vector3i setBedPosition(EntityMetadata<Optional<Vector3i>, ?> entityMetadata) {
|
|
|
|
Optional<Vector3i> optionalPos = entityMetadata.getValue();
|
2021-11-20 19:25:21 +00:00
|
|
|
if (optionalPos.isPresent()) {
|
2022-05-25 23:17:49 +00:00
|
|
|
Vector3i bedPosition = optionalPos.get();
|
|
|
|
dirtyMetadata.put(EntityData.BED_POSITION, bedPosition);
|
2021-11-20 21:34:30 +00:00
|
|
|
int bed = session.getGeyser().getWorldManager().getBlockAt(session, bedPosition);
|
2021-11-18 03:02:38 +00:00
|
|
|
// Bed has to be updated, or else player is floating in the air
|
|
|
|
ChunkUtils.updateBlock(session, bed, bedPosition);
|
|
|
|
// Indicate that the player should enter the sleep cycle
|
|
|
|
// Has to be a byte or it does not work
|
|
|
|
// (Bed position is what actually triggers sleep - "pose" is only optional)
|
|
|
|
dirtyMetadata.put(EntityData.PLAYER_FLAGS, (byte) 2);
|
2022-05-25 23:17:49 +00:00
|
|
|
return bedPosition;
|
2021-11-18 03:02:38 +00:00
|
|
|
} else {
|
|
|
|
// Player is no longer sleeping
|
|
|
|
dirtyMetadata.put(EntityData.PLAYER_FLAGS, (byte) 0);
|
|
|
|
return null;
|
|
|
|
}
|
2019-12-01 00:19:03 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 17:34:56 +00:00
|
|
|
protected boolean hasShield(boolean offhand, ItemMapping shieldMapping) {
|
|
|
|
if (offhand) {
|
|
|
|
return offHand.getId() == shieldMapping.getBedrockId();
|
|
|
|
} else {
|
|
|
|
return hand.getId() == shieldMapping.getBedrockId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-18 23:09:18 +00:00
|
|
|
@Override
|
2021-11-18 03:02:38 +00:00
|
|
|
protected boolean isShaking() {
|
2021-06-18 23:09:18 +00:00
|
|
|
return isMaxFrozenState;
|
|
|
|
}
|
|
|
|
|
2021-06-05 02:26:29 +00:00
|
|
|
@Override
|
|
|
|
protected void setDimensions(Pose pose) {
|
|
|
|
if (pose == Pose.SLEEPING) {
|
2021-11-19 01:44:03 +00:00
|
|
|
setBoundingBoxWidth(0.2f);
|
|
|
|
setBoundingBoxHeight(0.2f);
|
2021-06-05 02:26:29 +00:00
|
|
|
} else {
|
|
|
|
super.setDimensions(pose);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-18 23:09:18 +00:00
|
|
|
@Override
|
2021-11-20 19:25:21 +00:00
|
|
|
public float setFreezing(IntEntityMetadata entityMetadata) {
|
2021-11-18 03:02:38 +00:00
|
|
|
float freezingPercentage = super.setFreezing(entityMetadata);
|
|
|
|
this.isMaxFrozenState = freezingPercentage >= 1.0f;
|
|
|
|
setFlag(EntityFlag.SHAKING, isShaking());
|
|
|
|
return freezingPercentage;
|
2021-06-18 23:09:18 +00:00
|
|
|
}
|
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
/**
|
|
|
|
* @return a Bedrock health attribute constructed from the data sent from the server
|
|
|
|
*/
|
|
|
|
protected AttributeData createHealthAttribute() {
|
|
|
|
// Default health needs to be specified as the max health in order for maximum hearts to show correctly on mounted entities
|
2021-07-09 14:28:03 +00:00
|
|
|
// Round health value up, so that Bedrock doesn't consider the entity to be dead when health is between 0 and 1
|
|
|
|
return new AttributeData(GeyserAttributeType.HEALTH.getBedrockIdentifier(), 0f, this.maxHealth, (float) Math.ceil(this.health), this.maxHealth);
|
2021-04-08 23:52:54 +00:00
|
|
|
}
|
|
|
|
|
2022-02-25 03:49:10 +00:00
|
|
|
@Override
|
|
|
|
public boolean isAlive() {
|
|
|
|
return this.valid && health > 0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public InteractionResult interact(Hand hand) {
|
|
|
|
GeyserItemStack itemStack = session.getPlayerInventory().getItemInHand(hand);
|
|
|
|
if (itemStack.getJavaId() == session.getItemMappings().getStoredItems().nameTag()) {
|
|
|
|
InteractionResult result = checkInteractWithNameTag(itemStack);
|
|
|
|
if (result.consumesAction()) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return super.interact(hand);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks to see if a nametag interaction would go through.
|
|
|
|
*/
|
|
|
|
protected final InteractionResult checkInteractWithNameTag(GeyserItemStack itemStack) {
|
|
|
|
CompoundTag nbt = itemStack.getNbt();
|
|
|
|
if (nbt != null && nbt.get("display") instanceof CompoundTag displayTag && displayTag.get("Name") instanceof StringTag) {
|
|
|
|
// The mob shall be named
|
|
|
|
return InteractionResult.SUCCESS;
|
|
|
|
}
|
|
|
|
return InteractionResult.PASS;
|
|
|
|
}
|
|
|
|
|
2021-11-22 19:52:26 +00:00
|
|
|
public void updateArmor(GeyserSession session) {
|
2021-04-08 23:52:54 +00:00
|
|
|
if (!valid) return;
|
|
|
|
|
|
|
|
ItemData helmet = this.helmet;
|
|
|
|
ItemData chestplate = this.chestplate;
|
|
|
|
// If an entity has a banner on them, it will be in the helmet slot in Java but the chestplate spot in Bedrock
|
|
|
|
// But don't overwrite the chestplate if it isn't empty
|
2021-07-13 01:19:40 +00:00
|
|
|
ItemMapping banner = session.getItemMappings().getStoredItems().banner();
|
|
|
|
if (chestplate.getId() == ItemData.AIR.getId() && helmet.getId() == banner.getBedrockId()) {
|
2021-04-08 23:52:54 +00:00
|
|
|
chestplate = this.helmet;
|
|
|
|
helmet = ItemData.AIR;
|
2021-07-13 01:19:40 +00:00
|
|
|
} else if (chestplate.getId() == banner.getBedrockId()) {
|
2021-04-08 23:52:54 +00:00
|
|
|
// Prevent chestplate banners from showing erroneously
|
|
|
|
chestplate = ItemData.AIR;
|
|
|
|
}
|
2019-12-01 00:19:03 +00:00
|
|
|
|
|
|
|
MobArmorEquipmentPacket armorEquipmentPacket = new MobArmorEquipmentPacket();
|
|
|
|
armorEquipmentPacket.setRuntimeEntityId(geyserId);
|
|
|
|
armorEquipmentPacket.setHelmet(helmet);
|
|
|
|
armorEquipmentPacket.setChestplate(chestplate);
|
|
|
|
armorEquipmentPacket.setLeggings(leggings);
|
|
|
|
armorEquipmentPacket.setBoots(boots);
|
|
|
|
|
2021-04-08 23:52:54 +00:00
|
|
|
session.sendUpstreamPacket(armorEquipmentPacket);
|
|
|
|
}
|
|
|
|
|
2021-11-22 19:52:26 +00:00
|
|
|
public void updateMainHand(GeyserSession session) {
|
2021-04-08 23:52:54 +00:00
|
|
|
if (!valid) return;
|
|
|
|
|
2020-02-14 01:47:45 +00:00
|
|
|
MobEquipmentPacket handPacket = new MobEquipmentPacket();
|
|
|
|
handPacket.setRuntimeEntityId(geyserId);
|
|
|
|
handPacket.setItem(hand);
|
|
|
|
handPacket.setHotbarSlot(-1);
|
|
|
|
handPacket.setInventorySlot(0);
|
|
|
|
handPacket.setContainerId(ContainerId.INVENTORY);
|
|
|
|
|
2021-04-08 23:52:54 +00:00
|
|
|
session.sendUpstreamPacket(handPacket);
|
|
|
|
}
|
|
|
|
|
2021-11-22 19:52:26 +00:00
|
|
|
public void updateOffHand(GeyserSession session) {
|
2021-04-08 23:52:54 +00:00
|
|
|
if (!valid) return;
|
|
|
|
|
2020-02-14 01:47:45 +00:00
|
|
|
MobEquipmentPacket offHandPacket = new MobEquipmentPacket();
|
|
|
|
offHandPacket.setRuntimeEntityId(geyserId);
|
|
|
|
offHandPacket.setItem(offHand);
|
|
|
|
offHandPacket.setHotbarSlot(-1);
|
|
|
|
offHandPacket.setInventorySlot(0);
|
|
|
|
offHandPacket.setContainerId(ContainerId.OFFHAND);
|
2020-01-11 19:05:29 +00:00
|
|
|
|
2020-05-05 15:51:43 +00:00
|
|
|
session.sendUpstreamPacket(offHandPacket);
|
2019-12-01 00:19:03 +00:00
|
|
|
}
|
2020-06-30 01:33:42 +00:00
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
/**
|
|
|
|
* Attributes are properties of an entity that are generally more runtime-based instead of permanent properties.
|
|
|
|
* Movement speed, current attack damage with a weapon, current knockback resistance.
|
|
|
|
*
|
|
|
|
* @param attributes the Java list of attributes sent from the server
|
|
|
|
*/
|
2021-11-22 19:52:26 +00:00
|
|
|
public void updateBedrockAttributes(GeyserSession session, List<Attribute> attributes) {
|
2020-06-30 01:33:42 +00:00
|
|
|
if (!valid) return;
|
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
List<AttributeData> newAttributes = new ArrayList<>();
|
2020-06-30 01:33:42 +00:00
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
for (Attribute attribute : attributes) {
|
|
|
|
// Convert the attribute to a Bedrock version, if relevant
|
|
|
|
updateAttribute(attribute, newAttributes);
|
|
|
|
}
|
2020-06-30 01:33:42 +00:00
|
|
|
|
2021-07-08 02:44:53 +00:00
|
|
|
if (newAttributes.isEmpty()) {
|
|
|
|
// If there are Java-only attributes or only attributes that are not translated by us
|
|
|
|
return;
|
2020-06-30 01:33:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UpdateAttributesPacket updateAttributesPacket = new UpdateAttributesPacket();
|
|
|
|
updateAttributesPacket.setRuntimeEntityId(geyserId);
|
2021-07-08 02:44:53 +00:00
|
|
|
updateAttributesPacket.setAttributes(newAttributes);
|
2020-06-30 01:33:42 +00:00
|
|
|
session.sendUpstreamPacket(updateAttributesPacket);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-07-08 02:44:53 +00:00
|
|
|
* Takes the Java attribute and adds it to newAttributes as a Bedrock-formatted attribute
|
|
|
|
*/
|
|
|
|
protected void updateAttribute(Attribute javaAttribute, List<AttributeData> newAttributes) {
|
2021-11-23 15:55:20 +00:00
|
|
|
if (javaAttribute.getType() instanceof AttributeType.Builtin type) {
|
|
|
|
switch (type) {
|
|
|
|
case GENERIC_MAX_HEALTH -> {
|
2022-05-21 15:54:32 +00:00
|
|
|
// Since 1.18.0, setting the max health to 0 or below causes the entity to die on Bedrock but not on Java
|
|
|
|
// See https://github.com/GeyserMC/Geyser/issues/2971
|
|
|
|
this.maxHealth = Math.max((float) AttributeUtils.calculateValue(javaAttribute), 1f);
|
2021-12-06 00:07:51 +00:00
|
|
|
newAttributes.add(createHealthAttribute());
|
2021-11-23 15:55:20 +00:00
|
|
|
}
|
|
|
|
case GENERIC_ATTACK_DAMAGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.ATTACK_DAMAGE));
|
|
|
|
case GENERIC_FLYING_SPEED -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FLYING_SPEED));
|
|
|
|
case GENERIC_MOVEMENT_SPEED -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.MOVEMENT_SPEED));
|
|
|
|
case GENERIC_FOLLOW_RANGE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.FOLLOW_RANGE));
|
|
|
|
case GENERIC_KNOCKBACK_RESISTANCE -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.KNOCKBACK_RESISTANCE));
|
|
|
|
case HORSE_JUMP_STRENGTH -> newAttributes.add(calculateAttribute(javaAttribute, GeyserAttributeType.HORSE_JUMP_STRENGTH));
|
2021-09-10 18:10:56 +00:00
|
|
|
}
|
2021-07-08 02:44:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculates the complete attribute value to send to Bedrock. Will be overriden if attributes need to be cached.
|
2020-06-30 01:33:42 +00:00
|
|
|
*/
|
2021-07-08 02:44:53 +00:00
|
|
|
protected AttributeData calculateAttribute(Attribute javaAttribute, GeyserAttributeType type) {
|
|
|
|
return type.getAttribute((float) AttributeUtils.calculateValue(javaAttribute));
|
2020-06-30 01:33:42 +00:00
|
|
|
}
|
2019-12-01 00:19:03 +00:00
|
|
|
}
|