Skip to content
Open

2.5.9 #295

Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f083030
Rename variables and methods for clarity
Tiakin Sep 30, 2025
3b512c3
Using movement handlers in ServerVersion enum
Tiakin Sep 30, 2025
590b33c
Update movement handler method names
Tiakin Sep 30, 2025
9c6fd4c
Merge remote-tracking branch 'upstream/master'
Tiakin Oct 10, 2025
04fcddc
Merge remote-tracking branch 'upstream/master'
Tiakin Oct 10, 2025
fde0164
Merge branch 'master' into Refactor
Tiakin Oct 24, 2025
764e5d7
Refac: improved ServerVersion usage on VersionModule
Tiakin Oct 24, 2025
bae165c
Refac: simplify teleportSeat method using reflection for server versi…
Tiakin Oct 24, 2025
56be11d
Fix: update packet handling to re-use movement_1_12_R1 on reload
Tiakin Oct 24, 2025
692e24a
Refactor: packet handling methods into a generic method
Tiakin Oct 25, 2025
841fcb5
Merge branch 'MTVehicles:master' into master
Tiakin Nov 18, 2025
522fe64
feat: update dependencies
Tiakin Dec 17, 2025
840931b
feat: add support for 1.21.11
Tiakin Dec 17, 2025
6f3c0aa
refactor: deleted version check methods
Tiakin Jan 12, 2026
a506392
Bump to 2.5.9 and bump dependencies to latest versions
Tiakin Feb 28, 2026
761008c
feat: add support for 26.1
Tiakin Apr 5, 2026
cfb322c
feat: add support for 1.14.X
Tiakin Apr 15, 2026
4e0c956
feat: add support for 26.1.2
Tiakin Apr 15, 2026
f373068
refactor: update dependencies
Tiakin Apr 15, 2026
0180dce
Merge branch 'master' into master
Tiakin Apr 15, 2026
2577787
Update dependency-reduced-pom.xml
Tiakin Apr 15, 2026
c811f35
fix: prevent entering vehicles in spectator mode
Tiakin Apr 15, 2026
bf33cea
chore: update dependencies
Tiakin Apr 17, 2026
ccfd6e4
refactor: refine supported versions list
Tiakin Apr 17, 2026
81f629d
refactor: use properties for pom.xmll
Tiakin Apr 17, 2026
54db617
fix: change JDK version from temurin to openjdk
Tiakin Apr 17, 2026
850f112
chore: update Skript dependency version to 2.15.2
Tiakin May 3, 2026
0f53fbb
Update compatibility information in README
Tiakin May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.mtvehicles.core</groupId>
<artifactId>MTVehicles</artifactId>
<version>2.5.8</version>
<version>2.5.9</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
Expand Down Expand Up @@ -229,6 +229,18 @@
<version>1.21.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc....................</groupId>
<artifactId>spigot</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc.....................</groupId>
<artifactId>spigot</artifactId>
<version>26.1.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand All @@ -244,13 +256,13 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<version>2.12.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.SkriptLang</groupId>
<artifactId>Skript</artifactId>
<version>2.12.0</version>
<version>2.14.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
20 changes: 16 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.mtvehicles.core</groupId>
<artifactId>MTVehicles</artifactId>
<version>2.5.8</version>
<version>2.5.9</version>

<distributionManagement>
<repository>
Expand Down Expand Up @@ -184,6 +184,18 @@
<version>1.21.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc....................</groupId>
<artifactId>spigot</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc.....................</groupId>
<artifactId>spigot</artifactId>
<version>26.1.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
Expand All @@ -199,7 +211,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.15.3-SNAPSHOT</version>
<version>2.15.6</version>
</dependency>

<dependency>
Expand All @@ -216,13 +228,13 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<version>2.12.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.SkriptLang</groupId>
<artifactId>Skript</artifactId>
<version>2.12.0</version>
<version>2.14.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,193 +1,185 @@
package nl.mtvehicles.core.infrastructure.enums;

import nl.mtvehicles.core.infrastructure.annotations.VersionSpecific;
import nl.mtvehicles.core.movement.PacketHandler;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

/**
* Enum of supported server versions (used for different NMS and Spigot API changes)
* Enum of supported server versions (used for different NMS and Spigot API
* changes)
*/
@VersionSpecific
public enum ServerVersion {
/**
* 1.12-1.12.2
*/
v1_12,
v1_12_R1(PacketHandler::movement_1_12_R1),
/**
* 1.13.1-1.13.2
*/
v1_13,
v1_13_R2(PacketHandler::movement_1_13_R2),
/**
* 1.15-1.15.2
*/
v1_15,
v1_15_R1(PacketHandler::movement_1_15_R1),
/**
* 1.16.4-1.16.5
*/
v1_16,
v1_16_R3(PacketHandler::movement_1_16_R3),
/**
* 1.17-1.17.1
*/
v1_17,
v1_17_R1(PacketHandler::movement_1_17_R1),
/**
* 1.18-1.18.1
*/
v1_18_R1,
v1_18_R1(PacketHandler::movement_1_18_R1),
/**
* 1.18.2
*/
v1_18_R2,
v1_18_R2(PacketHandler::movement_1_18_R2),
/**
* 1.19-1.19.2
*
* @since 2.4.3
*/
v1_19_R1,
v1_19_R1(PacketHandler::movement_1_19_R1),
/**
* 1.19.3
*
* @since 2.5.0
*/
v1_19_R2,
v1_19_R2(PacketHandler::movement_1_19_R2),
/**
* 1.19.4
*
* @since 2.5.0
*/
v1_19_R3,
v1_19_R3(PacketHandler::movement_1_19_R3),
/**
* 1.20 and 1.20.1
*
* @since 2.5.6
*/
v1_20_R1,
v1_20_R1(PacketHandler::movement_1_20_R1),
/**
* 1.20.2
*
* @since 2.5.2
*/
v1_20_R2,
v1_20_R2(PacketHandler::movement_1_20_R2),
/**
* 1.20.3 and 1.20.4
*
* @since 2.5.2
*/
v1_20_R3,
v1_20_R3(PacketHandler::movement_1_20_R3),
/**
* 1.20.5 and 1.20.6
*
* @since 2.5.4
*/
v1_20_R4,
v1_20_R4(PacketHandler::movement_1_20_R4),
/**
* 1.21 and 1.21.1
*
* @since 2.5.4
*/
v1_21_R1,
v1_21_R1(PacketHandler::movement_1_21_R1),
/**
* 1.21.2 and 1.21.3
*
* @since 2.5.5
*/
v1_21_R2,
v1_21_R2(PacketHandler::movement_1_21_R2),
/**
* 1.21.4
*
* @since 2.5.5
*/
v1_21_R3,
v1_21_R3(PacketHandler::movement_1_21_R3),
/**
* 1.21.5
*
* @since 2.5.6
*/
v1_21_R4,
v1_21_R4(PacketHandler::movement_1_21_R4),
/**
* 1.21.6, 1.21.7 and 1.21.8
*
* @since 2.5.6
*/
v1_21_R5,
v1_21_R5(PacketHandler::movement_1_21_R5),
/**
* 1.21.9 and 1.21.10
*
* @since 2.5.8
*/
v1_21_R6;

public boolean is1_12(){
return this.equals(v1_12);
}

public boolean is1_13(){
return this.equals(v1_13);
}

public boolean is1_15(){
return this.equals(v1_15);
}

public boolean is1_16(){
return this.equals(v1_16);
}

public boolean is1_17(){
return this.equals(v1_17);
}
v1_21_R6(PacketHandler::movement_1_21_R6),
/**
* 1.21.11
*
* @since 2.5.9
*/
v1_21_R7(PacketHandler::movement_1_21_R7),

public boolean is1_18_R1(){
return this.equals(v1_18_R1);
}
/**
* 26.1
*
* @since 2.5.9
*/
v26_1(PacketHandler::movement_26_1);

public boolean is1_18_R2(){
return this.equals(v1_18_R2);
/**
* Function interface for packet movement handlers
*/
public interface MovementHandler {
void handle(Player player);
}

public boolean is1_19(){
return this.equals(v1_19_R1);
}
private final MovementHandler movementHandler;

public boolean is1_19_R2(){
return this.equals(v1_19_R2);
ServerVersion(MovementHandler movementHandler) {
this.movementHandler = movementHandler;
}

public boolean is1_19_R3(){return this.equals(v1_19_R3);}

public boolean is1_20_R1() {return this.equals(v1_20_R1);}

public boolean is1_20_R2() {return this.equals(v1_20_R2);}

public boolean is1_20_R3() {
return this.equals(v1_20_R3);
/**
* Get the movement handler for this server version
*
* @return The movement handler for this version
*/
public MovementHandler getMovementHandler() {
return this.movementHandler;
}

public boolean is1_20_R4(){return this.equals(v1_20_R4);}

public boolean is1_21_R1(){return this.equals(v1_21_R1);}

public boolean is1_21_R2(){return this.equals(v1_21_R2);}

public boolean is1_21_R3(){return this.equals(v1_21_R3);}

public boolean is1_21_R4(){return this.equals(v1_21_R4);}

public boolean is1_21_R5(){return this.equals(v1_21_R5);}

public boolean is1_21_R6(){return this.equals(v1_21_R6);}

/**
* Check whether the server version is older than the given one
*/
public boolean isOlderThan(@NotNull ServerVersion version){
public boolean isOlderThan(@NotNull ServerVersion version) {
return this.ordinal() < version.ordinal();
}

/**
* Check whether the server version is older than the given one or whether it is the same
* Check whether the server version is older than the given one or whether it is
* the same
*/
public boolean isOlderOrEqualTo(@NotNull ServerVersion version){
public boolean isOlderOrEqualTo(@NotNull ServerVersion version) {
return this.ordinal() <= version.ordinal();
}

/**
* Check whether the server version is newer than the given one
*/
public boolean isNewerThan(@NotNull ServerVersion version){
public boolean isNewerThan(@NotNull ServerVersion version) {
return this.ordinal() > version.ordinal();
}

/**
* Check whether the server version is newer than the given one or whether it is the same
* Check whether the server version is newer than the given one or whether it is
* the same
*/
public boolean isNewerOrEqualTo(@NotNull ServerVersion version){
public boolean isNewerOrEqualTo(@NotNull ServerVersion version) {
return this.ordinal() >= version.ordinal();
}

Expand Down
Loading