File tree Expand file tree Collapse file tree 2 files changed +1
-29
lines changed
src/main/java/net/raphimc/vialoader/util Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -31,21 +31,4 @@ public static List<ProtocolVersion> getProtocolsNewToOld() {
3131 return Collections .unmodifiableList (protocolVersions );
3232 }
3333
34- /**
35- * Returns true if first is closer to version than second
36- *
37- * @param version The version to compare to
38- * @param first The first version
39- * @param second The second version
40- * @return true if first is closer to version than second
41- */
42- public static boolean isCloserTo (final ProtocolVersion version , final ProtocolVersion first , final ProtocolVersion second ) {
43- if (version .getVersionType () == first .getVersionType () || version .getVersionType () == second .getVersionType ()) {
44- return Math .abs (version .getVersion () - first .getVersion ()) < Math .abs (version .getVersion () - second .getVersion ());
45- } else {
46- final int ordinal = version .getVersionType ().ordinal ();
47- return Math .abs (ordinal - first .getVersionType ().ordinal ()) < Math .abs (ordinal - second .getVersionType ().ordinal ());
48- }
49- }
50-
5134}
Original file line number Diff line number Diff line change 1919
2020import com .viaversion .viaversion .api .platform .PlatformTask ;
2121import com .viaversion .viaversion .api .scheduler .Task ;
22- import com .viaversion .viaversion .api .scheduler .TaskStatus ;
2322
24- public class VLTask implements PlatformTask <Task > {
25-
26- private final Task task ;
27-
28- public VLTask (final Task task ) {
29- this .task = task ;
30- }
23+ public record VLTask (Task task ) implements PlatformTask <Task > {
3124
3225 @ Override
3326 public void cancel () {
3427 this .task .cancel ();
3528 }
3629
37- public TaskStatus getStatus () {
38- return this .task .status ();
39- }
40-
4130}
You can’t perform that action at this time.
0 commit comments