mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Fixed nautilus dash progress bar.
This commit is contained in:
@@ -1234,7 +1234,7 @@ public final class EntityDefinitions {
|
||||
{
|
||||
EntityDefinition<AbstractNautilusEntity> abstractNautilusBase = EntityDefinition.<AbstractNautilusEntity>inherited(null, tameableEntityBase) // No factory, is abstract
|
||||
.width(0.95f).height(0.875f)
|
||||
.addTranslator(MetadataTypes.BOOLEAN, AbstractNautilusEntity::setBoost)
|
||||
.addTranslator(MetadataTypes.BOOLEAN, AbstractNautilusEntity::setDashing)
|
||||
.build();
|
||||
|
||||
NAUTILUS = EntityDefinition.inherited(NautilusEntity::new, abstractNautilusBase)
|
||||
|
||||
@@ -42,7 +42,6 @@ import org.geysermc.geyser.inventory.GeyserItemStack;
|
||||
import org.geysermc.geyser.item.Items;
|
||||
import org.geysermc.geyser.item.enchantment.EnchantmentComponent;
|
||||
import org.geysermc.geyser.item.type.Item;
|
||||
import org.geysermc.geyser.level.block.Fluid;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.tags.ItemTag;
|
||||
import org.geysermc.geyser.session.cache.tags.Tag;
|
||||
@@ -50,7 +49,6 @@ import org.geysermc.geyser.util.InteractiveTag;
|
||||
import org.geysermc.geyser.util.ItemUtils;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.EquipmentSlot;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.entity.player.Hand;
|
||||
import org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentTypes;
|
||||
@@ -68,6 +66,7 @@ public abstract class AbstractNautilusEntity extends TameableEntity implements C
|
||||
this.vehicleComponent = new NautilusVehicleComponent(this, 0.0f, defSpeed);
|
||||
|
||||
dirtyMetadata.put(EntityDataTypes.CONTAINER_SIZE, 2);
|
||||
setFlag(EntityFlag.WASD_CONTROLLED, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,7 +131,7 @@ public abstract class AbstractNautilusEntity extends TameableEntity implements C
|
||||
return !this.getFlag(EntityFlag.SADDLED);
|
||||
}
|
||||
|
||||
public void setBoost(BooleanEntityMetadata entityMetadata) {
|
||||
public void setDashing(BooleanEntityMetadata entityMetadata) {
|
||||
if (entityMetadata.getPrimitiveValue()) {
|
||||
vehicleComponent.setDashCooldown(40);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ public class NautilusVehicleComponent extends VehicleComponent<AbstractNautilusE
|
||||
|
||||
@Override
|
||||
public void tickVehicle() {
|
||||
vehicle.setFlag(EntityFlag.CAN_DASH, vehicle.getFlag(EntityFlag.SADDLED));
|
||||
vehicle.setFlag(EntityFlag.HAS_DASH_COOLDOWN, this.dashCooldown > 0);
|
||||
vehicle.updateBedrockMetadata();
|
||||
|
||||
@@ -78,6 +77,13 @@ public class NautilusVehicleComponent extends VehicleComponent<AbstractNautilusE
|
||||
return inputVelocity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismount() {
|
||||
vehicle.setFlag(EntityFlag.HAS_DASH_COOLDOWN, false);
|
||||
vehicle.updateBedrockMetadata();
|
||||
super.onDismount();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateRotation() {
|
||||
float yaw = vehicle.getYaw() + MathUtils.wrapDegrees(getRiddenRotation().getX() - vehicle.getYaw()) * 0.5F;
|
||||
|
||||
Reference in New Issue
Block a user