fix NoSuchMethodError

This commit is contained in:
zimzaza4
2024-08-13 14:52:42 +08:00
parent 4b7cb88eef
commit e42b6b213e

View File

@@ -2,6 +2,7 @@ package re.imc.geysermodelengine.model;
import com.comphenix.protocol.wrappers.Pair; import com.comphenix.protocol.wrappers.Pair;
import com.ticxo.modelengine.api.ModelEngineAPI; 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.ActiveModel;
import com.ticxo.modelengine.api.model.bone.type.Mount; import com.ticxo.modelengine.api.model.bone.type.Mount;
import com.ticxo.modelengine.api.mount.controller.MountController; import com.ticxo.modelengine.api.mount.controller.MountController;
@@ -21,7 +22,8 @@ public class BedrockMountControl {
if (!FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId())) { if (!FloodgateApi.getInstance().isFloodgatePlayer(player.getUniqueId())) {
continue; continue;
} }
float pitch = player.getPitch();
float pitch = player.getLocation().getPitch();
Pair<ActiveModel, Mount> seat = GeyserModelEngine.getInstance().getDrivers().get(player); Pair<ActiveModel, Mount> seat = GeyserModelEngine.getInstance().getDrivers().get(player);
if (seat != null) { if (seat != null) {
if (pitch < -30) { if (pitch < -30) {
@@ -36,8 +38,14 @@ public class BedrockMountControl {
} }
} }
if (pitch > 80) { if (pitch > 80) {
if (seat.getFirst().getModeledEntity().getBase() instanceof BukkitEntity bukkitEntity) {
if (bukkitEntity.getOriginal().isOnGround()) {
return;
}
}
MountController controller = ModelEngineAPI.getMountPairManager() MountController controller = ModelEngineAPI.getMountPairManager()
.getController(player.getUniqueId()); .getController(player.getUniqueId());
if (controller != null) { if (controller != null) {
MountController.MountInput input = controller.getInput(); MountController.MountInput input = controller.getInput();
if (input != null) { if (input != null) {