Show iron golem attack animation

TODO: Do the same for the hoglin and zoglin - this requires more work with the hitbox.
This commit is contained in:
Camotoy 2021-06-29 22:36:30 -04:00
parent afc1f48d5e
commit b757032457
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -26,16 +26,12 @@
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.SoundEvent;
import com.nukkitx.protocol.bedrock.data.LevelEventType;
import com.nukkitx.protocol.bedrock.data.SoundEvent;
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityEventType;
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
import com.nukkitx.protocol.bedrock.packet.LevelEventPacket;
import com.nukkitx.protocol.bedrock.packet.LevelSoundEvent2Packet;
import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
import com.nukkitx.protocol.bedrock.packet.*;
import org.geysermc.connector.entity.Entity;
import org.geysermc.connector.entity.LivingEntity;
import org.geysermc.connector.entity.type.EntityType;
@ -177,6 +173,11 @@ public class JavaEntityStatusTranslator extends PacketTranslator<ServerEntitySta
case IRON_GOLEM_EMPTY_HAND:
entityEventPacket.setType(EntityEventType.GOLEM_FLOWER_WITHDRAW);
break;
case IRON_GOLEM_ATTACK:
if (entity.getEntityType() == EntityType.IRON_GOLEM) {
entityEventPacket.setType(EntityEventType.ATTACK_START);
}
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