diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30312905db..b33babd796 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,4 +12,4 @@ jobs: steps: - uses: actions/checkout@v1 - uses: gradle/wrapper-validation-action@v1 - - run: ./gradlew build javadocJar checkMappings mapNamedJar --stacktrace + - run: ./gradlew build javadocJar checkMappings --stacktrace diff --git a/HEADER b/HEADER new file mode 100644 index 0000000000..73af7424af --- /dev/null +++ b/HEADER @@ -0,0 +1 @@ +This file is free for everyone to use under the Creative Commons Zero license. diff --git a/build.gradle b/build.gradle index 45dbae7006..1fdfda9d99 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ plugins { id 'base' id 'maven-publish' id 'java' // for jd gen + id 'org.cadixdev.licenser' version '0.5.1' } def minecraft_version = "21w11a" @@ -745,6 +746,12 @@ sourceSets { constants } +license { + header file("HEADER") + sourceSets = [sourceSets.constants] + include '**/*.java' +} + task constantsJar(type: Jar) { from sourceSets.constants.output archiveClassifier = "constants" @@ -933,7 +940,7 @@ javadoc { addBooleanOption 'Xdoclint:reference', true addBooleanOption 'Xdoclint:accessibility', true } - source fakeSourceDir + source fileTree(fakeSourceDir) + sourceSets.constants.allJava classpath = configurations.javadocClasspath.plus downloadMcLibs.outputs.files.asFileTree finalizedBy { diff --git a/mappings/net/minecraft/block/entity/AbstractFurnaceBlockEntity.mapping b/mappings/net/minecraft/block/entity/AbstractFurnaceBlockEntity.mapping index b96312d626..de82e2c74c 100644 --- a/mappings/net/minecraft/block/entity/AbstractFurnaceBlockEntity.mapping +++ b/mappings/net/minecraft/block/entity/AbstractFurnaceBlockEntity.mapping @@ -50,7 +50,8 @@ CLASS net/minecraft/class_2609 net/minecraft/block/entity/AbstractFurnaceBlockEn METHOD method_17763 dropExperienceForRecipesUsed (Lnet/minecraft/class_3222;)V ARG 1 player METHOD method_26395 isNonFlammableWood (Lnet/minecraft/class_1792;)Z - COMMENT Returns whether the provided {@code item} is in the {@linkplain ItemTags#NON_FLAMMABLE_WOOD} tag. + COMMENT Returns whether the provided {@code item} is in the {@link + COMMENT net.minecraft.tag.ItemTags#NON_FLAMMABLE_WOOD non_flammable_wood} tag. ARG 0 item METHOD method_27354 getRecipesUsedAndDropExperience (Lnet/minecraft/class_3218;Lnet/minecraft/class_243;)Ljava/util/List; ARG 1 world diff --git a/mappings/net/minecraft/world/ModifiableWorld.mapping b/mappings/net/minecraft/world/ModifiableWorld.mapping index 70d6799571..ef17619f2d 100644 --- a/mappings/net/minecraft/world/ModifiableWorld.mapping +++ b/mappings/net/minecraft/world/ModifiableWorld.mapping @@ -11,16 +11,9 @@ CLASS net/minecraft/class_1945 net/minecraft/world/ModifiableWorld COMMENT change persisted across loads. It's recommended to check whether this world is client before COMMENT interacting with the world in this way.

COMMENT - COMMENT

Accepted values of the flags are a bitset combination of the following:

- COMMENT + COMMENT

For the accepted values of the flags, see {@link net.fabricmc.yarn.constants.SetBlockStateFlags}. + COMMENT + COMMENT @see net.fabricmc.yarn.constants.SetBlockStateFlags ARG 1 pos COMMENT the target position ARG 2 state @@ -51,16 +44,10 @@ CLASS net/minecraft/class_1945 net/minecraft/world/ModifiableWorld COMMENT change persisted across loads. It's recommended to check whether this world is client before COMMENT interacting with the world in this way.

COMMENT - COMMENT

Accepted values of the flags are a bitset combination of the following:

- COMMENT + COMMENT

For the accepted values of the flags, see {@link net.fabricmc.yarn.constants.SetBlockStateFlags}. + COMMENT + COMMENT @see #setBlockState(BlockPos, BlockState, int, int) + COMMENT @see net.fabricmc.yarn.constants.SetBlockStateFlags ARG 1 pos COMMENT the target position ARG 2 state diff --git a/src/constants/java/net/fabricmc/yarn/constants/SetBlockStateFlags.java b/src/constants/java/net/fabricmc/yarn/constants/SetBlockStateFlags.java index b0445c73e0..72bc9ff8eb 100644 --- a/src/constants/java/net/fabricmc/yarn/constants/SetBlockStateFlags.java +++ b/src/constants/java/net/fabricmc/yarn/constants/SetBlockStateFlags.java @@ -1,5 +1,19 @@ +/* + * This file is free for everyone to use under the Creative Commons Zero license. + */ + package net.fabricmc.yarn.constants; +/** + * A few flag bits for the {@code flag} argument of {@code world.setBlockState(pos, state, flag)} + * and other related block state setting methods. + * + *

The accepted values of the {@code flag} argument is usually a bitset combination of the + * fields in this class. + * + * @see net.minecraft.world.ModifiableWorld#setBlockState(net.minecraft.util.math.BlockPos, + * net.minecraft.block.BlockState, int) + */ public final class SetBlockStateFlags { /** * Propagates a change event to surrounding blocks. @@ -17,7 +31,7 @@ public final class SetBlockStateFlags { public static final int DEFAULT = PROPAGATE_CHANGE | NOTIFY_LISTENERS; /** - * Used in conjunction with {@link NOTIFY_LISTENERS} to suppress the render pass on clients. + * Used in conjunction with {@link #NOTIFY_LISTENERS} to suppress the render pass on clients. */ public static final int NO_REDRAW = 4; diff --git a/src/constants/java/net/fabricmc/yarn/constants/package-info.java b/src/constants/java/net/fabricmc/yarn/constants/package-info.java new file mode 100644 index 0000000000..5004448c50 --- /dev/null +++ b/src/constants/java/net/fabricmc/yarn/constants/package-info.java @@ -0,0 +1,13 @@ +/* + * This file is free for everyone to use under the Creative Commons Zero license. + */ + +/** + * Provides a few classes holding constants that possibly existed for better understanding + * of the Minecraft codebase. + * + *

Warning: These classes are absent at runtime. They are exclusively + * for use during compile time, in which the Java Compiler will replace the field references + * with constant values. + */ +package net.fabricmc.yarn.constants;