This commit is contained in:
zimzaza4
2024-05-01 22:43:01 +08:00
parent 18b4008c9c
commit a9ed339af9
6 changed files with 179 additions and 60 deletions

View File

@@ -1,13 +1,16 @@
package re.imc.geysermodelengine.model;
import com.google.common.collect.Sets;
import com.ticxo.modelengine.api.ModelEngineAPI;
import com.ticxo.modelengine.api.entity.BukkitEntity;
import com.ticxo.modelengine.api.model.ActiveModel;
import com.ticxo.modelengine.api.model.ModeledEntity;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import re.imc.geysermodelengine.GeyserModelEngine;
import java.util.HashMap;
@@ -49,9 +52,9 @@ public class ModelEntity {
for (Player viewer : viewers) {
viewer.sendActionBar("X:" + modeledEntity.getXHeadRot() + ", Y:" + modeledEntity.getYHeadRot());
}
*/
entity.teleportAsync(location);
*/
ModelEngineAPI.getEntityHandler().setPosition(entity, location.getX(), location.getY(), location.getZ());
if (modeledEntity.getBase() instanceof BukkitEntity bukkitEntity && bukkitEntity.getOriginal() instanceof LivingEntity livingEntity) {
controllerEntity.getLookController().setHeadYaw(livingEntity.getEyeLocation().getYaw());
controllerEntity.getLookController().setPitch(livingEntity.getEyeLocation().getPitch());
@@ -89,7 +92,7 @@ public class ModelEntity {
display.setGravity(false);
display.setMaxHealth(2048);
display.setHealth(2048);
display.setMetadata("model_entity", new FixedMetadataValue(GeyserModelEngine.getInstance(), true));
//display.setInvulnerable(true);