Merge remote-tracking branch 'GeyserExtensionists/main' into dev

This commit is contained in:
otDan
2024-09-03 01:00:55 +02:00
2 changed files with 14 additions and 6 deletions

View File

@@ -2,12 +2,14 @@ package re.imc.geysermodelengine.model;
import com.comphenix.protocol.wrappers.Pair;
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.bone.type.Mount;
import com.ticxo.modelengine.api.mount.controller.MountController;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.geysermc.floodgate.api.FloodgateApi;
import re.imc.geysermodelengine.GeyserModelEngine;
public class BedrockMountControl {
@@ -17,7 +19,11 @@ public class BedrockMountControl {
@Override
public void run() {
for (Player player : Bukkit.getOnlinePlayers()) {
float pitch = player.getPitch();
if (!FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId())) {
continue;
}
float pitch = player.getLocation().getPitch();
Pair<ActiveModel, Mount> seat = GeyserModelEngine.getInstance().getDrivers().get(player);
if (seat != null) {
if (pitch < -30) {
@@ -31,9 +37,15 @@ public class BedrockMountControl {
}
}
}
if (pitch > 50) {
if (pitch > 80) {
if (seat.getFirst().getModeledEntity().getBase() instanceof BukkitEntity bukkitEntity) {
if (bukkitEntity.getOriginal().isOnGround()) {
return;
}
}
MountController controller = ModelEngineAPI.getMountPairManager()
.getController(player.getUniqueId());
if (controller != null) {
MountController.MountInput input = controller.getInput();
if (input != null) {

View File

@@ -357,10 +357,6 @@ public class EntityTask {
setAnimationProperty(1);
return 0;
}
if (animationProperty.getName().equalsIgnoreCase("spawn")) {
setAnimationProperty(0);
return 0;
}
boolean play = false;
if (currentAnimationPriority.get() < p) {