Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 8686590

Browse files
committed
refactor: update enum values for ClientIntent, PunishmentType, TeleportCause, and TeleportFlag for consistency
1 parent d35eae2 commit 8686590

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/player/punishment/type/PunishmentType.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ enum class PunishmentType(
1010
val punishDisplay: Component,
1111
val unpunishDisplay: Component = punishDisplay
1212
) : IdRepresentable {
13-
WARN(1, buildText { error("Verwarnung") }),
14-
KICK(2, buildText { error("Kick") }),
15-
MUTE(3, buildText { error("Mute") }, buildText { success("Unmute") }),
16-
BAN(4, buildText { error("Bann") }, buildText { success("Entbannung") });
13+
WARN(0, buildText { error("Verwarnung") }),
14+
KICK(1, buildText { error("Kick") }),
15+
MUTE(2, buildText { error("Mute") }, buildText { success("Unmute") }),
16+
BAN(3, buildText { error("Bann") }, buildText { success("Entbannung") });
1717

1818
companion object {
1919
val BY_ID = IdRepresentable.enumIdMap<PunishmentType>(OutOfBoundsStrategy.DECODE_ERROR)

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/player/teleport/TeleportCause.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,60 @@ enum class TeleportCause(override val id: Int) : IdRepresentable {
88
* Indicates the teleporation was caused by a player throwing an Ender
99
* Pearl
1010
*/
11-
ENDER_PEARL(1),
11+
ENDER_PEARL(0),
1212

1313
/**
1414
* Indicates the teleportation was caused by a player executing a
1515
* command
1616
*/
17-
COMMAND(2),
17+
COMMAND(1),
1818

1919
/**
2020
* Indicates the teleportation was caused by a plugin
2121
*/
22-
PLUGIN(3),
22+
PLUGIN(2),
2323

2424
/**
2525
* Indicates the teleportation was caused by a player entering a
2626
* Nether portal
2727
*/
28-
NETHER_PORTAL(4),
28+
NETHER_PORTAL(3),
2929

3030
/**
3131
* Indicates the teleportation was caused by a player entering an End
3232
* portal
3333
*/
34-
END_PORTAL(5),
34+
END_PORTAL(4),
3535

3636
/**
3737
* Indicates the teleportation was caused by a player teleporting to a
3838
* Entity/Player via the spectator menu
3939
*/
40-
SPECTATE(6),
40+
SPECTATE(5),
4141

4242
/**
4343
* Indicates the teleportation was caused by a player entering an End
4444
* gateway
4545
*/
46-
END_GATEWAY(7),
46+
END_GATEWAY(6),
4747

4848
/**
4949
* Indicates the teleportation was caused by a player exiting a vehicle
5050
*/
51-
DISMOUNT(8),
51+
DISMOUNT(7),
5252

5353
/**
5454
* Indicates the teleportation was caused by a player exiting a bed
5555
*/
56-
EXIT_BED(9),
56+
EXIT_BED(8),
5757

58-
CONSUMABLE_EFFECT(10),
58+
CONSUMABLE_EFFECT(9),
5959

6060
/**
6161
* Indicates the teleportation was caused by an event not covered by
6262
* this enum
6363
*/
64-
UNKNOWN(11);
64+
UNKNOWN(10);
6565

6666
companion object {
6767
val BY_ID = IdRepresentable.enumIdMap<TeleportCause>(ByIdMap.OutOfBoundsStrategy.LAST)

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/player/teleport/TeleportFlag.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,39 @@ enum class TeleportFlag(override val id: Int) : IdRepresentable {
99
* Indicates that a player should not have their current open inventory closed when teleporting.
1010
*/
1111
@Deprecated("Deprecated in Paper 1.21.10", level = DeprecationLevel.ERROR)
12-
RETAIN_OPEN_INVENTORY(1),
12+
RETAIN_OPEN_INVENTORY(0),
1313

1414
/**
1515
* If all passengers should not be required to be removed prior to teleportation.
1616
*/
1717
@Deprecated("Deprecated in Paper 1.21.10", level = DeprecationLevel.ERROR)
18-
RETAIN_PASSENGERS(2),
18+
RETAIN_PASSENGERS(1),
1919

2020
/**
2121
* If the entity should not be dismounted if they are riding another entity.
2222
*/
2323
@Deprecated("Deprecated in Paper 1.21.10", level = DeprecationLevel.ERROR)
24-
RETAIN_VEHICLE(3),
24+
RETAIN_VEHICLE(2),
2525

2626
/**
2727
* Configures the player to not lose velocity in their current rotation during the teleport.
2828
*/
29-
VELOCITY_ROTATION(4),
29+
VELOCITY_ROTATION(3),
3030

3131
/**
3232
* Configures the player to not lose velocity in their x-axis during the teleport.
3333
*/
34-
VELOCITY_X(5),
34+
VELOCITY_X(4),
3535

3636
/**
3737
* Configures the player to not lose velocity in their y-axis during the teleport.
3838
*/
39-
VELOCITY_Y(6),
39+
VELOCITY_Y(5),
4040

4141
/**
4242
* Configures the player to not lose velocity in their z-axis during the teleport.
4343
*/
44-
VELOCITY_Z(7);
44+
VELOCITY_Z(6);
4545

4646
companion object {
4747
val BY_ID = IdRepresentable.enumIdMap<TeleportFlag>(OutOfBoundsStrategy.DECODE_ERROR)

surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/protocol/handshake/ClientIntent.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import dev.slne.surf.cloud.api.common.netty.network.codec.ByteBufCodecs
44
import dev.slne.surf.cloud.api.common.util.ByIdMap
55

66
enum class ClientIntent(val id: Int) {
7-
STATUS(1), // Currently not in use
8-
INITIALIZE(2),
9-
LOGIN(3);
7+
STATUS(0), // Currently not in use
8+
INITIALIZE(1),
9+
LOGIN(2);
1010

1111
companion object {
1212
val BY_ID = ByIdMap.continuous(

0 commit comments

Comments
 (0)