forked from GeyserMC/Geyser
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/upstream/master'
# Conflicts: # bootstrap/mod/fabric/build.gradle.kts
- Loading branch information
Showing
110 changed files
with
2,840 additions
and
1,926 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
plugins { | ||
// Allow blossom to mark sources root of templates | ||
idea | ||
id("geyser.publish-conventions") | ||
alias(libs.plugins.blossom) | ||
} | ||
|
||
dependencies { | ||
api(libs.base.api) | ||
api(libs.math) | ||
} | ||
} | ||
|
||
version = property("version")!! | ||
val apiVersion = (version as String).removeSuffix("-SNAPSHOT") | ||
|
||
sourceSets { | ||
main { | ||
blossom { | ||
javaSources { | ||
property("version", apiVersion) | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
api/src/main/java-templates/org/geysermc/geyser/api/BuildData.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,53 @@ | ||
/* | ||
* 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.geyser.api; | ||
|
||
import org.geysermc.api.util.ApiVersion; | ||
|
||
/** | ||
* Not a public API. For internal use only. May change without notice. | ||
* This class is processed before compilation to insert build properties. | ||
*/ | ||
class BuildData { | ||
static final String VERSION = "{{ version }}"; | ||
static final ApiVersion API_VERSION; | ||
|
||
static { | ||
String[] parts = VERSION.split("\\."); | ||
if (parts.length != 3) { | ||
throw new RuntimeException("Invalid api version: " + VERSION); | ||
} | ||
|
||
try { | ||
int human = Integer.parseInt(parts[0]); | ||
int major = Integer.parseInt(parts[1]); | ||
int minor = Integer.parseInt(parts[2]); | ||
API_VERSION = new ApiVersion(human, major, minor); | ||
} catch (Exception e) { | ||
throw new RuntimeException("Invalid api version: " + VERSION, e); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.