-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
643df35
commit 8f930f9
Showing
5 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/fr/cocoraid/prodigycape/utils/ProtocolVersionOffset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package fr.cocoraid.prodigycape.utils; | ||
|
||
public enum ProtocolVersionOffset { | ||
|
||
V1_21(767, -0.4F), | ||
V1_20_5_to_6(766, -0.4F), | ||
V1_20_3_to_4(765, -0.4F), | ||
V1_20_2(764, -0.4F), | ||
V1_20_1(763, 0F), | ||
V1_19_4(762, 0F); | ||
|
||
private final int version; | ||
private final float offset; | ||
|
||
ProtocolVersionOffset(int version, float offset) { | ||
this.version = version; | ||
this.offset = offset; | ||
} | ||
|
||
public float getOffset() { | ||
return offset; | ||
} | ||
|
||
public int getVersion() { | ||
return version; | ||
} | ||
|
||
public static float getOffsetByVersion(int version) { | ||
for (ProtocolVersionOffset offset : values()) { | ||
if (offset.getVersion() == version) { | ||
return offset.getOffset(); | ||
} | ||
} | ||
return 0F; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters