Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions build-logic/src/main/kotlin/buildlogic.platform.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ val platform = extensions.create<buildlogic.PlatformExtension>("platform")
platform.includeClasspath.convention(false)
platform.extraAttributes.convention(mapOf())

shadow {
addShadowVariantIntoJavaComponent = false
}

tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("dist")
relocate("com.sk89q.jchronic", "com.sk89q.worldedit.jchronic")
Expand All @@ -32,11 +36,6 @@ tasks.named<ShadowJar>("shadowJar") {
exclude(dependency(stringyLibs.getLibrary("lz4Java").get()))
}
}
val javaComponent = components["java"] as AdhocComponentWithVariants
// I don't think we want this published (it's the shadow jar)
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {
skip()
}

tasks.named<Jar>("jar") {
val kind = platform.kind.get()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
id("xyz.jpenilla.run-paper") version "3.0.2"
}

var rootVersion by extra("2.14.1")
var rootVersion by extra("2.14.2")
var snapshot by extra("SNAPSHOT")
var revision: String by extra("")
var buildNumber by extra("")
Expand Down
45 changes: 20 additions & 25 deletions worldedit-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import buildlogic.getLibrary
import buildlogic.sourceSets
import buildlogic.stringyLibs
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.Companion.shadowJar
import io.papermc.paperweight.userdev.attribute.Obfuscation
import me.modmuss50.mpp.ReleaseType
import kotlin.getOrElse

plugins {
`java-library`
Expand Down Expand Up @@ -170,14 +166,14 @@ tasks.register<ShadowJar>("reobfShadowJar") {

// as is done by shadow for the default shadowJar
from(sourceSets.main.map { it.output })
manifest.inheritFrom(tasks.jar.get().manifest)
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")

manifest {
attributes(
"FAWE-Plugin-Jar-Type" to "spigot"
)
manifest.from(tasks.jar.get().manifest) {
eachEntry {
if (key == "FAWE-Plugin-Jar-Type") {
value = "spigot"
}
}
}
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")
}

tasks.named<ShadowJar>("shadowJar") {
Expand Down Expand Up @@ -256,39 +252,38 @@ publishMods {
"FastAsyncWorldEdit/releases/tag/${project.version}")

val common = modrinthOptions {
accessToken.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("z4HZZnLr")
projectDescription.set(providers.fileContents { layout.projectDirectory.file("README.md") as File }.asText)
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
projectId = "z4HZZnLr"
projectDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText
}

// We publish the reobfJar twice to ensure that the modrinth download menu picks the right jar for the platform regardless
// of minecraft version.

val mojmapPaperVersions = listOf("1.20.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10")
val mojmapPaperVersions = listOf("1.20.6", "1.21.1", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10")
val spigotMappedPaperVersions = listOf("1.20.2", "1.20.4")

// Mark reobfJar as spigot only for 1.20.5+
modrinth("spigot") {
from(common)
file.set(tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile })
minecraftVersions.set(mojmapPaperVersions)
modLoaders.set(listOf("spigot"))
file = tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile }
minecraftVersions = mojmapPaperVersions
modLoaders = listOf("spigot")
}

// Mark reobfJar as spigot & paper for <1.20.5
modrinth("spigotAndOldPaper") {
from(common)
file.set(tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile })
minecraftVersions.set(spigotMappedPaperVersions)
modLoaders.set(listOf("paper", "spigot"))
file = tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile }
minecraftVersions = spigotMappedPaperVersions
modLoaders = listOf("paper", "spigot")
}

// Mark mojang mapped jar as paper 1.20.5+ only
modrinth {
from(common)
file.set(tasks.named<ShadowJar>("shadowJar").flatMap { it.archiveFile })
minecraftVersions.set(mojmapPaperVersions)
modLoaders.set(listOf("paper"))
file = tasks.named<ShadowJar>("shadowJar").flatMap { it.archiveFile }
minecraftVersions = mojmapPaperVersions
modLoaders = listOf("paper")
}

// dryRun.set(true) // For testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ default List<org.bukkit.entity.Entity> getEntities(org.bukkit.World world) {
/**
* Import Minecraft internal features into FAWE. Should be executed after worlds loading (in order to capture datapacks)
*
* @since TODO
* @since 2.14.1
*/
default void setupFeatures() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ default void sendBiomeUpdates(World world, Iterable<BlockVector2> chunks) {
* @param pt The location
* @return If it succeeded
*
* @since TODO
* @since 2.14.1
*/
default boolean generateFeature(ConfiguredFeatureType feature, World world, EditSession session, BlockVector3 pt) {
throw new UnsupportedOperationException("This adapter does not support generating features.");
Expand All @@ -354,7 +354,7 @@ default boolean generateFeature(ConfiguredFeatureType feature, World world, Edit
* @param pt The location
* @return If it succeeded
*
* @since TODO
* @since 2.14.1
*/
default boolean generateStructure(StructureType feature, World world, EditSession session, BlockVector3 pt) {
throw new UnsupportedOperationException("This adapter does not support generating features.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Places a feature
*
* @since TODO
* @since 2.14.1
*/
public class FeaturePlacer implements BlockTool {

Expand All @@ -29,7 +29,7 @@ public class FeaturePlacer implements BlockTool {
/**
* New instance
*
* @since TODO
* @since 2.14.1
*/
public FeaturePlacer(ConfiguredFeatureType feature) {
this.feature = feature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Places a structure
*
* @since TODO
* @since 2.14.1
*/
public class StructurePlacer implements BlockTool {

Expand All @@ -29,7 +29,7 @@ public class StructurePlacer implements BlockTool {
/**
* New instance
*
* @since TODO
* @since 2.14.1
*/
public StructurePlacer(StructureType structure) {
this.structure = structure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Generate a structure at the given location
*
* @since TODO
* @since 2.14.1
*/
public class StructureGenerator implements RegionFunction {

Expand All @@ -22,7 +22,7 @@ public class StructureGenerator implements RegionFunction {
* @param editSession the edit session
* @param structureType the structure type
*
* @since TODO
* @since 2.14.1
*/
public StructureGenerator(EditSession editSession, StructureType structureType) {
this.editSession = editSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public static boolean isPowerOfTwo(int a) {
* @param bitsPerEntry the number of bits a single element occupies in the array
* @param numberOfEntries the number of elements to store in the array
* @return the size of the array needed to store the elements
* @since TODO
* @since 2.14.1
*/
public static int longArrayLength(int bitsPerEntry, int numberOfEntries) {
int entriesPerLong = Long.SIZE / bitsPerEntry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4270,7 +4270,7 @@ public int makeBlob(
* @param position position to generate at
* @return blocks affected
*
* @since TODO
* @since 2.14.1
*/
public int generateFeature(ConfiguredFeatureType feature, BlockVector3 position) {
feature.place(this, position);
Expand All @@ -4284,7 +4284,7 @@ public int generateFeature(ConfiguredFeatureType feature, BlockVector3 position)
* @param position position to generate at
* @return blocks affected
*
* @since TODO
* @since 2.14.1
*/
public int generateStructure(StructureType structure, BlockVector3 position) {
structure.place(this, position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public BaseEntity(CompoundTag tag) {
* Attempt to retrieve the entity's UUID from its NBT tag
*
* @return entity UUID if possible to retrieve
* @since TODO
* @since 2.14.1
*/
@Nullable
public UUID getUUID() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Generate a feature at the given location
*
* @since TODO
* @since 2.14.1
*/
public class FeatureGenerator implements RegionFunction {

Expand All @@ -41,7 +41,7 @@ public class FeatureGenerator implements RegionFunction {
* @param editSession the edit session
* @param featureType the feature type
*
* @since TODO
* @since 2.14.1
*/
public FeatureGenerator(EditSession editSession, ConfiguredFeatureType featureType) {
this.editSession = editSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Block
* @param position The position
* @return True if the generation was successful
*
* @since TODO
* @since 2.14.1
*/
default boolean generateStructure(StructureType type, EditSession editSession, BlockVector3 position) {
return false;
Expand All @@ -335,7 +335,7 @@ default boolean generateStructure(StructureType type, EditSession editSession, B
* @param position The position
* @return True if the generation was successful
*
* @since TODO
* @since 2.14.1
*/
default boolean generateFeature(ConfiguredFeatureType type, EditSession editSession, BlockVector3 position) {
return false;
Expand Down
Loading