Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Merge latest master
Dieser Commit ist enthalten in:
Ursprung
392d2ca6f7
Commit
fd5333b77b
@ -2,6 +2,8 @@ package org.geysermc.connector.entity;
|
|||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
|
import com.nukkitx.protocol.bedrock.data.EntityData;
|
||||||
|
import com.nukkitx.protocol.bedrock.packet.AddEntityPacket;
|
||||||
import org.geysermc.connector.entity.type.EntityType;
|
import org.geysermc.connector.entity.type.EntityType;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
|
|
||||||
@ -14,6 +16,26 @@ public class EnderCrystalEntity extends Entity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||||
|
System.out.println("ID: " + entityMetadata.getId() + ", " + entityMetadata.getValue());
|
||||||
super.updateBedrockMetadata(entityMetadata, session);
|
super.updateBedrockMetadata(entityMetadata, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnEntity(GeyserSession session) {
|
||||||
|
AddEntityPacket addEntityPacket = new AddEntityPacket();
|
||||||
|
// Not end crystal but ender crystal
|
||||||
|
addEntityPacket.setIdentifier("minecraft:ender_crystal");
|
||||||
|
addEntityPacket.setRuntimeEntityId(geyserId);
|
||||||
|
addEntityPacket.setUniqueEntityId(geyserId);
|
||||||
|
addEntityPacket.setPosition(position);
|
||||||
|
addEntityPacket.setMotion(motion);
|
||||||
|
addEntityPacket.setRotation(getBedrockRotation());
|
||||||
|
addEntityPacket.setEntityType(entityType.getType());
|
||||||
|
addEntityPacket.getMetadata().putAll(metadata);
|
||||||
|
|
||||||
|
valid = true;
|
||||||
|
session.getUpstream().sendPacket(addEntityPacket);
|
||||||
|
|
||||||
|
session.getConnector().getLogger().debug("Spawned entity " + entityType + " at location " + position + " with id " + geyserId + " (java id " + entityId + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package org.geysermc.connector.entity.living.monster;
|
||||||
|
|
||||||
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
|
import org.geysermc.connector.entity.living.InsentientEntity;
|
||||||
|
import org.geysermc.connector.entity.type.EntityType;
|
||||||
|
|
||||||
|
public class EnderDragonEntity extends InsentientEntity {
|
||||||
|
|
||||||
|
public EnderDragonEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation) {
|
||||||
|
super(entityId, geyserId, entityType, position, motion, rotation);
|
||||||
|
}
|
||||||
|
}
|
@ -85,7 +85,7 @@ public enum EntityType {
|
|||||||
ELDER_GUARDIAN(GuardianEntity.class, 50, 1.9975f),
|
ELDER_GUARDIAN(GuardianEntity.class, 50, 1.9975f),
|
||||||
NPC(PlayerEntity.class, 51, 1.8f, 0.6f, 0.6f, 1.62f),
|
NPC(PlayerEntity.class, 51, 1.8f, 0.6f, 0.6f, 1.62f),
|
||||||
WITHER(MonsterEntity.class, 52, 3.5f, 0.9f),
|
WITHER(MonsterEntity.class, 52, 3.5f, 0.9f),
|
||||||
ENDER_DRAGON(InsentientEntity.class, 53, 4f, 13f),
|
ENDER_DRAGON(EnderDragonEntity.class, 53, 4f, 13f),
|
||||||
SHULKER(GolemEntity.class, 54, 1f, 1f),
|
SHULKER(GolemEntity.class, 54, 1f, 1f),
|
||||||
ENDERMITE(MonsterEntity.class, 55, 0.3f, 0.4f),
|
ENDERMITE(MonsterEntity.class, 55, 0.3f, 0.4f),
|
||||||
AGENT(Entity.class, 56, 0f),
|
AGENT(Entity.class, 56, 0f),
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren