Skip to content

Commit

Permalink
name AbstractArchiveTask subclass tasks using its archive name compos…
Browse files Browse the repository at this point in the history
…ition methods

make the default ArtifactFileTask destination build/libs
eliminate MappingsProjectPlugin#getLibsDir (its already the default for all tasks it was used for)
add QuiltMappingsArtifactTask, implement it on all tasks that used ARCHIVE_FILE_NAME_PREFIX, and configure implementing tasks' baseName and version in QuiltMappingsBasePlugin
improve som javadocs
  • Loading branch information
supersaiyansubtlety committed Oct 26, 2024
1 parent 6f3bcc0 commit 7d4c13e
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 51 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ license {
include '**/*.java'
}

// TODO test if artifacts get correct metadata without explicit configuration
// and that compressTiny builds automatically
publishing {
publications {
maven(MavenPublication) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import quilt.internal.tasks.build.MergeIntermediaryTask;
import quilt.internal.tasks.build.MergeTinyV2Task;
import quilt.internal.tasks.build.RemoveIntermediaryTask;
import quilt.internal.tasks.jarmapping.MapJarTask;
import quilt.internal.tasks.setup.ExtractTinyIntermediaryMappingsTask;
import quilt.internal.tasks.setup.ExtractTinyMappingsTask;
import quilt.internal.tasks.setup.IntermediaryDependantTask;
Expand Down Expand Up @@ -123,9 +124,7 @@ public void apply(@NotNull Project project) {
intermediaryV2MappingsJar.configure(task -> {
task.getMappings().convention(removeIntermediary.flatMap(RemoveIntermediaryTask::getOutputMappings));

task.getArchiveFileName().convention(
QuiltMappingsBasePlugin.ARCHIVE_FILE_NAME_PREFIX + "-" + IntermediaryMappingsV2JarTask.CLASSIFIER + ".jar"
);
task.getArchiveClassifier().convention(IntermediaryMappingsV2JarTask.CLASSIFIER);
});

final var intermediaryV2MergedMappingsJar = tasks.register(
Expand All @@ -136,9 +135,7 @@ public void apply(@NotNull Project project) {
intermediaryV2MergedMappingsJar.configure(task -> {
task.getMappings().convention(mergeIntermediary.flatMap(MergeIntermediaryTask::getOutputMappings));

task.getArchiveFileName().convention(
QuiltMappingsBasePlugin.ARCHIVE_FILE_NAME_PREFIX + "-" + IntermediaryMappingsV2JarTask.MERGED_CLASSIFIER + ".jar"
);
task.getArchiveClassifier().convention(IntermediaryMappingsV2JarTask.MERGED_CLASSIFIER);
});

tasks.register(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import quilt.internal.tasks.setup.MergeJarsTask;
import quilt.internal.util.FileUtil;

import static quilt.internal.plugin.QuiltMappingsBasePlugin.ARCHIVE_FILE_NAME_PREFIX;

/**
* {@linkplain TaskContainer#register Registers} tasks that map Minecraft jars.
* <p>
Expand Down Expand Up @@ -197,10 +195,6 @@ protected Tasks applyImpl(@NotNull Project project) {
TinyJarTask.class,
task -> {
task.getMappings().convention(mergeTiny.flatMap(MergeTinyTask::getOutputMappings));

task.getArchiveFileName().convention(ARCHIVE_FILE_NAME_PREFIX + ".jar");

task.getDestinationDirectory().convention(this.getLibsDir());
}
);

Expand All @@ -220,10 +214,6 @@ protected Tasks applyImpl(@NotNull Project project) {
task.getArtifactVersion().convention(Constants.MAPPINGS_VERSION);

task.getArtifactClassifier().convention(CompressTinyTask.TINY_CLASSIFIER);

task.getArtifactExtension().convention("gz");

task.getDestinationDirectory().convention(this.getLibsDir());
}
);

Expand Down
14 changes: 3 additions & 11 deletions buildSrc/src/main/java/quilt/internal/plugin/MapV2Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import quilt.internal.tasks.unpick.gen.OpenGlConstantUnpickGenTask;
import quilt.internal.tasks.unpick.gen.UnpickGenTask;

import static quilt.internal.plugin.QuiltMappingsBasePlugin.ARCHIVE_FILE_NAME_PREFIX;

/**
* {@link TaskContainer#register Registers} tasks that output mappings in Quilt's v2 format.
* <p>
Expand All @@ -53,8 +51,6 @@
* {@link QuiltMappingsExtension#getUnpickMeta() unpickMeta}
* <li> {@link MappingsV2JarTask#getUnpickDefinition() unpickDefinition}:
* {@link CombineUnpickDefinitionsTask}'s {@link CombineUnpickDefinitionsTask#getOutput() output}
* <li> {@link MappingsV2JarTask#getDestinationDirectory() destinationDirectory}:
* {@link #getLibsDir() libsDir}
* </ul>
* </ul>
*
Expand Down Expand Up @@ -214,7 +210,7 @@ protected Tasks applyImpl(@NotNull Project project) {
combineUnpickDefinitions.flatMap(CombineUnpickDefinitionsTask::getOutput)
);

task.getDestinationDirectory().convention(this.getLibsDir());
// task.getDestinationDirectory().convention(this.getLibsDir());
});

{
Expand All @@ -228,9 +224,7 @@ protected Tasks applyImpl(@NotNull Project project) {
insertAutoGeneratedMappings.flatMap(AddProposedMappingsTask::getOutputMappings)
);

task.getArchiveFileName().convention(
ARCHIVE_FILE_NAME_PREFIX + "-" + MappingsV2JarTask.V_2_CLASSIFIER + ".jar"
);
task.getArchiveClassifier().convention(MappingsV2JarTask.V_2_CLASSIFIER);
});
}

Expand All @@ -242,9 +236,7 @@ protected Tasks applyImpl(@NotNull Project project) {
v2MergedMappingsJar.configure(task -> {
task.getMappings().convention(mergeTinyV2.flatMap(MergeTinyV2Task::getOutputMappings));

task.getArchiveFileName().convention(
ARCHIVE_FILE_NAME_PREFIX + "-" + MappingsV2JarTask.MERGED_V2_CLASSIFIER + ".jar"
);
task.getArchiveClassifier().convention(MappingsV2JarTask.MERGED_V2_CLASSIFIER);
});

return new Tasks(mergeTinyV2, unpickHashedJar, mapNamedJar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
import org.gradle.api.services.BuildServiceRegistry;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.quiltmc.enigma.api.service.JarIndexerService;
import quilt.internal.Constants;
import quilt.internal.QuiltMappingsExtension;
import quilt.internal.plugin.abstraction.MappingsProjectPlugin;
import quilt.internal.tasks.ArtifactFileTask;
import quilt.internal.tasks.EnigmaProfileConsumingTask;
import quilt.internal.tasks.MappingsDirConsumingTask;
import quilt.internal.tasks.QuiltMappingsArtifactTask;
import quilt.internal.tasks.mappings.MappingsDirOutputtingTask;
import quilt.internal.util.EnigmaProfileService;

Expand Down Expand Up @@ -57,11 +60,18 @@
* <li> passes the {@link Task#getOutputs() outputs} of each {@link MappingsDirOutputtingTask}
* to {@link Task#getInputs() inputs}
* </ul>
* <li> {@linkplain TaskCollection#configureEach configures} the following defaults for
* {@link QuiltMappingsArtifactTask}s that subclass {@link ArtifactFileTask}/{@link AbstractArchiveTask}:
* <ul>
* <li> {@link ArtifactFileTask#getArtifactBaseName() artifactBaseName}/{@link
* AbstractArchiveTask#getArchiveBaseName() archiveBaseName}: {@value Constants#MAPPINGS_NAME}
* <li> {@link ArtifactFileTask#getArtifactVersion() artifactVersion}/{@link
* AbstractArchiveTask#getArchiveVersion() archiveVersion}:
* {@link Constants#MAPPINGS_VERSION MAPPINGS_VERSION}
* </ul>
*/
public abstract class QuiltMappingsBasePlugin implements MappingsProjectPlugin {
static final String MAPPINGS_NAME_PREFIX = Constants.MAPPINGS_NAME + "-";
// TODO extract QuiltMappingsArchiveTask interface and apply these there
static final String ARCHIVE_FILE_NAME_PREFIX = MAPPINGS_NAME_PREFIX + Constants.MAPPINGS_VERSION;

@Nullable
private QuiltMappingsExtension ext;
Expand Down Expand Up @@ -130,6 +140,31 @@ public void apply(@NotNull Project project) {
"No mappings directory specified. " +
"A directory must be specified to use a " + MappingsDirConsumingTask.class.getSimpleName() + "."
);

tasks.withType(ArtifactFileTask.class).configureEach(task -> {
this.provideDefaultError(
task.getDestinationDirectory(),
"No destination directory specified"
);

task.getDestinationDirectory().set(this.getBuildDir().dir("libs"));
});

tasks.withType(ArtifactFileTask.class)
.matching(QuiltMappingsArtifactTask::isInstance)
.configureEach(task -> {
task.getArtifactBaseName().convention(Constants.MAPPINGS_NAME);

task.getArtifactVersion().convention(Constants.MAPPINGS_VERSION);
});

tasks.withType(AbstractArchiveTask.class)
.matching(QuiltMappingsArtifactTask::isInstance)
.configureEach(task -> {
task.getArchiveBaseName().convention(Constants.MAPPINGS_NAME);

task.getArchiveVersion().convention(Constants.MAPPINGS_VERSION);
});
}

public QuiltMappingsExtension getExt() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ default Provider<Directory> getMappingsDir() {
return this.getBuildDir().dir("mappings");
}

default Provider<Directory> getLibsDir() {
return this.getBuildDir().dir("libs");
}

default Provider<Directory> getMinecraftDir() {
return this.getBuildDir().dir("minecraft");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package quilt.internal.tasks;

import org.gradle.api.Task;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.RegularFile;
import org.gradle.api.model.ObjectFactory;
Expand All @@ -22,7 +23,7 @@
* The path to the {@link #getArtifactFile() artifactFile} is built from the task's name and destination properties,
* and {@link MavenPublication#artifact(Object)} can interpolate artifact metadata from the name's format.
*/
public interface ArtifactFileProducingTask extends MappingsTask {
public interface ArtifactFileTask extends Task {
@Inject
ObjectFactory getObjects();

Expand Down Expand Up @@ -63,9 +64,9 @@ public interface ArtifactFileProducingTask extends MappingsTask {
default Provider<RegularFile> getArtifactFile() {
// zzzzzip
return this.getArtifactBaseName()
.zip(this.getArtifactAppendix().orElse(""), ArtifactFileProducingTask::dashJoin)
.zip(this.getArtifactVersion().orElse(""), ArtifactFileProducingTask::dashJoin)
.zip(this.getArtifactClassifier().orElse(""), ArtifactFileProducingTask::dashJoin)
.zip(this.getArtifactAppendix().orElse(""), ArtifactFileTask::dashJoin)
.zip(this.getArtifactVersion().orElse(""), ArtifactFileTask::dashJoin)
.zip(this.getArtifactClassifier().orElse(""), ArtifactFileTask::dashJoin)
.zip(this.getArtifactExtension(), (name, ext) -> name + "." + ext)
.zip(this.getDestinationDirectory(), (name, dest) -> dest.file(name));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package quilt.internal.tasks;

import org.gradle.api.Action;
import org.gradle.api.Task;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import quilt.internal.plugin.QuiltMappingsBasePlugin;

/**
* A task that creates an artifact whose name uses Quilt Mappings' name and version.
* <p>
* Has no effect if the implementing task isn't a subclass of either
* {@link ArtifactFileTask} or {@link AbstractArchiveTask}.
* <p>
* {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach(Action) configures}
* the base name and the version.
*/
public interface QuiltMappingsArtifactTask extends MappingsTask {
static boolean isInstance(Task task) {
return task instanceof QuiltMappingsArtifactTask;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,40 @@
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.TaskContainer;
import quilt.internal.Constants.Groups;
import quilt.internal.plugin.MapMinecraftJarsPlugin;
import quilt.internal.tasks.ArtifactFileProducingTask;
import quilt.internal.plugin.QuiltMappingsBasePlugin;
import quilt.internal.tasks.ArtifactFileTask;
import quilt.internal.tasks.DefaultMappingsTask;
import quilt.internal.tasks.QuiltMappingsArtifactTask;

public abstract class CompressTinyTask extends DefaultMappingsTask implements ArtifactFileProducingTask {
/**
* Compresses the input {@link #getMappings() mappings} using GZip.
* <p>
* {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default
* {@link ArtifactFileTask#getArtifactBaseName() archiveBaseName} and
* {@link ArtifactFileTask#getArtifactVersion() archiveVersion}.
*/
public abstract class CompressTinyTask extends DefaultMappingsTask implements
ArtifactFileTask, QuiltMappingsArtifactTask {
/**
* {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}.
*/
public static final String COMPRESS_TINY_TASK_NAME = "compressTiny";

public static final String TINY_CLASSIFIER = "tiny";

public static final String DEFAULT_EXTENSION = "gz";

@InputFile
public abstract RegularFileProperty getMappings();

public CompressTinyTask() {
super(Groups.BUILD_MAPPINGS);

this.getArtifactExtension().convention(DEFAULT_EXTENSION);
}

@TaskAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
package quilt.internal.tasks.build;

import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import quilt.internal.Constants;
import quilt.internal.Constants.Namespaces;
import quilt.internal.plugin.MapIntermediaryPlugin;
import quilt.internal.plugin.QuiltMappingsBasePlugin;
import quilt.internal.tasks.setup.IntermediaryDependantTask;

import javax.inject.Inject;

/**
* Creates a jar file containing {@value Constants#INTERMEDIARY_MAPPINGS_NAME} mappings in Quilt's v2 mapping format.
* <p>
* {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default
* {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and
* {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}.
*/
public abstract class IntermediaryMappingsV2JarTask extends MappingsV2JarTask implements IntermediaryDependantTask {
/**
* {@linkplain TaskContainer#register Registered} by {@link MapIntermediaryPlugin}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import org.gradle.jvm.tasks.Jar;
import org.gradle.work.DisableCachingByDefault;
import quilt.internal.Constants.Groups;
import quilt.internal.plugin.MapV2Plugin;
import quilt.internal.plugin.QuiltMappingsPlugin;
import quilt.internal.tasks.MappingsTask;
import quilt.internal.plugin.QuiltMappingsBasePlugin;
import quilt.internal.tasks.QuiltMappingsArtifactTask;

import javax.inject.Inject;

/**
* A task that creates a jar file with Quilt's v2 mapping format.
* Creates a jar file with Quilt's v2 mapping format.
* <p>
* {@link MapV2Plugin} {@linkplain TaskCollection#configureEach configures} some defaults.
* {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default
* {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and
* {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}.<br>
* {@link MapV2Plugin} {@linkplain TaskCollection#configureEach configures} a default
* {@link MappingsV2JarTask#getUnpickMeta() unpickMeta} and
* {@link MappingsV2JarTask#getUnpickDefinition() unpickDefinition}.
*/

// TODO why?
@DisableCachingByDefault(because = "unknown")
public abstract class MappingsV2JarTask extends Jar implements MappingsTask {
public abstract class MappingsV2JarTask extends Jar implements QuiltMappingsArtifactTask {
/**
* {@linkplain TaskContainer#register Registered} by {@link MapV2Plugin}.
*/
Expand Down
14 changes: 12 additions & 2 deletions buildSrc/src/main/java/quilt/internal/tasks/build/TinyJarTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.TaskCollection;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import org.gradle.jvm.tasks.Jar;
import quilt.internal.Constants.Groups;
import quilt.internal.plugin.MapMinecraftJarsPlugin;
import quilt.internal.tasks.MappingsTask;
import quilt.internal.plugin.QuiltMappingsBasePlugin;
import quilt.internal.tasks.QuiltMappingsArtifactTask;

public abstract class TinyJarTask extends Jar implements MappingsTask {
/**
* Creates a jar file with the input {@link #getMappings() mappings} located at {@value JAR_MAPPINGS_PATH}.
* <p>
* {@link QuiltMappingsBasePlugin} {@linkplain TaskCollection#configureEach configures} a default
* {@link AbstractArchiveTask#getArchiveBaseName() archiveBaseName} and
* {@link AbstractArchiveTask#getArchiveVersion() archiveVersion}.
*/
public abstract class TinyJarTask extends Jar implements QuiltMappingsArtifactTask {
/**
* {@linkplain TaskContainer#register Registered} by {@link MapMinecraftJarsPlugin}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Provider;
import org.gradle.api.specs.Specs;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.Exec;
import org.gradle.api.tasks.Input;
Expand All @@ -17,7 +15,6 @@
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.options.Option;
import org.gradle.process.ExecResult;
import quilt.internal.Constants.Groups;
import quilt.internal.tasks.MappingsTask;

Expand Down
Loading

2 comments on commit 7d4c13e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No difference between head and target.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With commit 7d4c13e, 11 file(s) were updated with 24 line(s) added and 24 removed compared to the latest Quilt Mappings version.

View the diff here:
diff -bur namedTargetSrc/net/minecraft/client/gui/ParentElement.java namedSrc/net/minecraft/client/gui/ParentElement.java
--- namedTargetSrc/net/minecraft/client/gui/ParentElement.java	2024-10-26 11:13:15.673393753 +0000
+++ namedSrc/net/minecraft/client/gui/ParentElement.java	2024-10-26 11:12:06.733000205 +0000
@@ -153,7 +153,7 @@
     * Mapping not found
     */
    @Override
-   default void setFocused(boolean bl) {
+   default void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java namedSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java
--- namedTargetSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java	2024-10-26 11:13:15.801394487 +0000
+++ namedSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java	2024-10-26 11:12:06.873001033 +0000
@@ -1506,9 +1506,9 @@
        * Mapping not found
        */
       @Override
-      public void setFocused(boolean bl) {
-         super.setFocused(bl);
-         this.button.setFocused(bl);
+      public void setFocused(boolean focused) {
+         super.setFocused(focused);
+         this.button.setFocused(focused);
       }
 
       /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/ClickableWidget.java namedSrc/net/minecraft/client/gui/widget/ClickableWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/ClickableWidget.java	2024-10-26 11:13:15.829394647 +0000
+++ namedSrc/net/minecraft/client/gui/widget/ClickableWidget.java	2024-10-26 11:12:06.909001246 +0000
@@ -447,8 +447,8 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      this.focused = bl;
+   public void setFocused(boolean focused) {
+      this.focused = focused;
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/DraggingWidget.java namedSrc/net/minecraft/client/gui/widget/DraggingWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/DraggingWidget.java	2024-10-26 11:13:15.681393800 +0000
+++ namedSrc/net/minecraft/client/gui/widget/DraggingWidget.java	2024-10-26 11:12:06.737000230 +0000
@@ -121,7 +121,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      ParentElement.super.setFocused(bl);
+   public void setFocused(boolean focused) {
+      ParentElement.super.setFocused(focused);
    }
 }
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/EditBoxWidget.java namedSrc/net/minecraft/client/gui/widget/EditBoxWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/EditBoxWidget.java	2024-10-26 11:13:15.777394349 +0000
+++ namedSrc/net/minecraft/client/gui/widget/EditBoxWidget.java	2024-10-26 11:12:06.853000915 +0000
@@ -342,9 +342,9 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
-      if (bl) {
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
+      if (focused) {
          this.focusTime = Util.getMeasuringTimeMs();
       }
    }
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/HeaderBar.java namedSrc/net/minecraft/client/gui/widget/HeaderBar.java
--- namedTargetSrc/net/minecraft/client/gui/widget/HeaderBar.java	2024-10-26 11:13:15.889394992 +0000
+++ namedSrc/net/minecraft/client/gui/widget/HeaderBar.java	2024-10-26 11:12:06.977001648 +0000
@@ -122,10 +122,10 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
       if (this.getFocused() != null) {
-         this.getFocused().setFocused(bl);
+         this.getFocused().setFocused(focused);
       }
    }
 
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java namedSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java	2024-10-26 11:13:15.581393227 +0000
+++ namedSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java	2024-10-26 11:12:06.608999473 +0000
@@ -908,7 +908,7 @@
        * @mapping {@literal named setFocused Lnet/minecraft/client/gui/widget/list/EntryListWidget$Entry;setFocused(Z)V}
        */
       @Override
-      public void setFocused(boolean bl) {
+      public void setFocused(boolean focused) {
       }
 
       /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java	2024-10-26 11:13:15.681393800 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java	2024-10-26 11:12:06.741000253 +0000
@@ -249,7 +249,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
+   public void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java	2024-10-26 11:13:15.837394694 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java	2024-10-26 11:12:06.925001341 +0000
@@ -742,7 +742,7 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
+   public void setFocused(boolean focused) {
    }
 
    /**
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/SliderWidget.java namedSrc/net/minecraft/client/gui/widget/SliderWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/SliderWidget.java	2024-10-26 11:13:15.569393157 +0000
+++ namedSrc/net/minecraft/client/gui/widget/SliderWidget.java	2024-10-26 11:12:06.592999378 +0000
@@ -151,9 +151,9 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      super.setFocused(bl);
-      if (!bl) {
+   public void setFocused(boolean focused) {
+      super.setFocused(focused);
+      if (!focused) {
          this.mutable = false;
       } else {
          InputType lv = MinecraftClient.getInstance().getLastInputType();
diff -bur namedTargetSrc/net/minecraft/client/gui/widget/TextFieldWidget.java namedSrc/net/minecraft/client/gui/widget/TextFieldWidget.java
--- namedTargetSrc/net/minecraft/client/gui/widget/TextFieldWidget.java	2024-10-26 11:13:15.605393365 +0000
+++ namedSrc/net/minecraft/client/gui/widget/TextFieldWidget.java	2024-10-26 11:12:06.632999614 +0000
@@ -736,10 +736,10 @@
     * Mapping not found
     */
    @Override
-   public void setFocused(boolean bl) {
-      if (this.focusUnlocked || bl) {
-         super.setFocused(bl);
-         if (bl) {
+   public void setFocused(boolean focused) {
+      if (this.focusUnlocked || focused) {
+         super.setFocused(focused);
+         if (focused) {
             this.lastFocusTime = Util.getMeasuringTimeMs();
          }
       }

Please sign in to comment.