Address reviews

This commit is contained in:
onebeastchris 2024-07-13 20:55:15 +02:00
parent 19c065d248
commit c6301b3b03
4 changed files with 62 additions and 13 deletions

View file

@ -1,8 +1,21 @@
plugins {
id("geyser.publish-conventions")
alias(libs.plugins.blossom) apply true
}
dependencies {
api(libs.base.api)
api(libs.math)
}
version = property("version")!!
sourceSets {
main {
blossom {
javaSources {
property("version", version as String)
}
}
}
}

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.api.util;
// This class is auto-generated.
public class BuildData {
public static final String VERSION = "{{ version }}";
}

View file

@ -172,11 +172,12 @@ public interface GeyserApi extends GeyserApiBase {
}
/**
* Gets the {@link ApiVersion} representing the current Geyser api version
* Returns the {@link ApiVersion} representing the current Geyser api version.
* See the <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">Geyser version outline</a>)
*
* @return the current geyser api version
*/
default ApiVersion geyserApiVersion() {
return new ApiVersion(2, 4, 1);
return new ApiVersion(BuildData.VERSION);
}
}

View file

@ -59,29 +59,35 @@ public interface ExtensionDescription {
String main();
/**
* Gets the extension's human api version
* Represents the human api version that the extension requires.
* See the <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">Geyser version outline</a>)
* for more details on the Geyser API version.
*
* @return the extension's human api version
* @return the extension's requested human api version
*/
int humanApiVersion();
/**
* Gets the extension's major api version
* Represents the major api version that the extension requires.
* See the <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">Geyser version outline</a>)
* for more details on the Geyser API version.
*
* @return the extension's major api version
* @return the extension's requested major api version
*/
int majorApiVersion();
/**
* Gets the extension's minor api version
* Represents the minor api version that the extension requires.
* See the <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">Geyser version outline</a>)
* for more details on the Geyser API version.
*
* @return the extension's minor api version
* @return the extension's requested minor api version
*/
int minorApiVersion();
/**
* No longer in use. Geyser is now using an adaption of the romantic versioning scheme.
* See <a href="https://gist.github.com/Redned235/a24a593026c11308dbcf73ab6e9d07d1">here</a> for details.
* See <a href="https://github.com/geysermc/api/blob/master/geyser-versioning.md">here</a> for details.
*/
@Deprecated(forRemoval = true)
default int patchApiVersion() {
@ -89,9 +95,7 @@ public interface ExtensionDescription {
}
/**
* Gets the extension's api version.
*
* @return the extension's api version
* Returns the extension's requested Geyser Api version.
*/
default String apiVersion() {
return humanApiVersion() + "." + majorApiVersion() + "." + minorApiVersion();