Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Add rabbit jumping animation (#1027)
* Add rabbit jumping animation This isn't perfect as Bedrock uses a duration and Java just sends the jumping animation. There may be something else missing from the puzzle piece. * Remove debug line
Dieser Commit ist enthalten in:
Ursprung
784cb73301
Commit
9097f8547b
@ -25,7 +25,6 @@
|
||||
|
||||
package org.geysermc.connector.entity.living;
|
||||
|
||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||
import com.nukkitx.math.vector.Vector3f;
|
||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||
import org.geysermc.connector.entity.type.EntityType;
|
||||
@ -37,11 +36,6 @@ public class MagmaCubeEntity extends SlimeEntity {
|
||||
super(entityId, geyserId, entityType, position, motion, rotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||
super.updateBedrockMetadata(entityMetadata, session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveRelative(GeyserSession session, double relX, double relY, double relZ, Vector3f rotation, boolean isOnGround) {
|
||||
updateJump(session, isOnGround);
|
||||
|
@ -26,8 +26,10 @@
|
||||
package org.geysermc.connector.network.translators.java.entity;
|
||||
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.ServerEntityStatusPacket;
|
||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||
import com.nukkitx.protocol.bedrock.data.entity.EntityEventType;
|
||||
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
|
||||
import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
|
||||
import org.geysermc.connector.entity.Entity;
|
||||
import org.geysermc.connector.entity.type.EntityType;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
@ -102,6 +104,17 @@ public class JavaEntityStatusTranslator extends PacketTranslator<ServerEntitySta
|
||||
case IRON_GOLEM_EMPTY_HAND:
|
||||
entityEventPacket.setType(EntityEventType.GOLEM_FLOWER_WITHDRAW);
|
||||
break;
|
||||
case RABBIT_JUMP_OR_MINECART_SPAWNER_DELAY_RESET:
|
||||
if (entity.getEntityType() == EntityType.RABBIT) {
|
||||
// This doesn't match vanilla Bedrock behavior but I'm unsure how to make it better
|
||||
// I assume part of the problem is that Bedrock uses a duration and Java just says the rabbit is jumping
|
||||
SetEntityDataPacket dataPacket = new SetEntityDataPacket();
|
||||
dataPacket.getMetadata().put(EntityData.JUMP_DURATION, (byte) 3);
|
||||
dataPacket.setRuntimeEntityId(entity.getGeyserId());
|
||||
session.sendUpstreamPacket(dataPacket);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
session.sendUpstreamPacket(entityEventPacket);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren