Skip to content

Commit

Permalink
Fixed teleport
Browse files Browse the repository at this point in the history
Closes #297
  • Loading branch information
Lorenzo0111 committed Jun 19, 2024
1 parent b088515 commit 879b6bf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "me.zombie_striker"
version = "2.3.9-SNAPSHOT"
version = "2.3.9"
description = "QualityArmoryVehicles"

java.sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -35,12 +35,12 @@ dependencies {
implementation("com.github.cryptomorin:XSeries:11.0.0")
implementation("net.jodah:expiringmap:0.5.11")
implementation("org.codemc.worldguardwrapper:worldguardwrapper:1.2.0-SNAPSHOT")
implementation("dev.triumphteam:triumph-gui:3.1.7")
implementation("dev.triumphteam:triumph-gui:3.1.10")
compileOnly("org.jetbrains:annotations:24.1.0")

// API
compileOnly("net.kyori:adventure-api:4.17.0")
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT")

// Compatibilities
compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0")
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/me/zombie_striker/qav/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import me.zombie_striker.qav.vehicles.AbstractVehicle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down Expand Up @@ -288,11 +289,13 @@ public void run() {
PlayerExitQAVehicleEvent event = new PlayerExitQAVehicleEvent(ve,player);
Bukkit.getPluginManager().callEvent(event);

if (removeVehicleOnDismount && QualityArmoryVehicles.isVehicle(player.getVehicle())) {
VehicleEntity vehicle = QualityArmoryVehicles.getVehicleEntityByEntity(player.getVehicle());
if (vehicle != null && vehicle.getDriverSeat().equals(player.getVehicle())) {
VehicleUtils.callback(vehicle,player, "Dismount");
}
if (antiCheatHook) {
Location location = player.getVehicle().getLocation();
player.teleport(location);
}

if (removeVehicleOnDismount) {
VehicleUtils.callback(ve, player, "Dismount");
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2.3.9
Changelog:
- 1.21 support
- Added anticheat workaround

2.3.8
Changelog:
- 1.20.6 support
- Updated NMS system

2.3.7
Changelog:
- 1.20.2 support
Expand Down

0 comments on commit 879b6bf

Please sign in to comment.