Skip to content

Commit

Permalink
use one regex instead of two (no functional changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
supersaiyansubtlety committed Jul 24, 2024
1 parent 51237c0 commit 3706aa7
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public abstract class FindDuplicateMappingFilesTask extends DefaultTask {
public static final String TASK_NAME = "findDuplicateMappingFiles";

private static final Logger LOGGER = Logging.getLogger(FindDuplicateMappingFilesTask.class);
private static final Pattern MINECRAFT_CLASS = Pattern.compile("^CLASS net/minecraft/(?:\\w+/)*\\w+(?= )");
private static final Pattern BLAZE_CLASS = Pattern.compile("^CLASS com/mojang/blaze3d/(?:\\w+/)*\\w+(?= )");
private static final Pattern EXPECTED_CLASS =
Pattern.compile("^CLASS (?:net/minecraft|com/mojang/blaze3d)/(?:\\w+/)*\\w+(?= )");

@InputDirectory
public abstract DirectoryProperty getMappingDirectory();
Expand Down Expand Up @@ -146,16 +146,9 @@ public void run() {
}

private static Optional<String> getClassMatch(String firstLine) {
final var minecraftClassMatcher = MINECRAFT_CLASS.matcher(firstLine);
if (minecraftClassMatcher.find()) {
return Optional.of(minecraftClassMatcher.group(0));
} else {
final var blazeClassMatcher = BLAZE_CLASS.matcher(firstLine);
if (blazeClassMatcher.find()) {
return Optional.of(blazeClassMatcher.group(0));
} else {
return Optional.empty();
}
}
final var expectedClassMatcher = EXPECTED_CLASS.matcher(firstLine);
return expectedClassMatcher.find() ?
Optional.of(expectedClassMatcher.group(0)) :
Optional.empty();
}
}

1 comment on commit 3706aa7

@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 3706aa7, 12 file(s) were updated with 28 line(s) added and 28 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-07-24 22:41:47.580900144 +0000
+++ namedSrc/net/minecraft/client/gui/ParentElement.java	2024-07-24 22:40:38.440150245 +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-07-24 22:41:47.676901191 +0000
+++ namedSrc/net/minecraft/client/gui/screen/realms/RealmsMainScreen.java	2024-07-24 22:40:38.552151495 +0000
@@ -1500,9 +1500,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-07-24 22:41:47.696901409 +0000
+++ namedSrc/net/minecraft/client/gui/widget/ClickableWidget.java	2024-07-24 22:40:38.572151717 +0000
@@ -440,8 +440,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-07-24 22:41:47.584900187 +0000
+++ namedSrc/net/minecraft/client/gui/widget/DraggingWidget.java	2024-07-24 22:40:38.448150334 +0000
@@ -120,7 +120,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-07-24 22:41:47.660901017 +0000
+++ namedSrc/net/minecraft/client/gui/widget/EditBoxWidget.java	2024-07-24 22:40:38.532151272 +0000
@@ -341,9 +341,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-07-24 22:41:47.740901890 +0000
+++ namedSrc/net/minecraft/client/gui/widget/HeaderBar.java	2024-07-24 22:40:38.616152208 +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-07-24 22:41:47.504899315 +0000
+++ namedSrc/net/minecraft/client/gui/widget/list/EntryListWidget.java	2024-07-24 22:40:38.344149175 +0000
@@ -883,7 +883,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-07-24 22:41:47.588900231 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeAlternativesWidget.java	2024-07-24 22:40:38.448150334 +0000
@@ -289,7 +289,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-07-24 22:41:47.704901497 +0000
+++ namedSrc/net/minecraft/client/gui/widget/recipe_book/RecipeBookWidget.java	2024-07-24 22:40:38.580151806 +0000
@@ -645,7 +645,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-07-24 22:41:47.496899227 +0000
+++ namedSrc/net/minecraft/client/gui/widget/SliderWidget.java	2024-07-24 22:40:38.336149086 +0000
@@ -145,9 +145,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-07-24 22:41:47.520899489 +0000
+++ namedSrc/net/minecraft/client/gui/widget/TextFieldWidget.java	2024-07-24 22:40:38.372149487 +0000
@@ -734,10 +734,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.f_ddgsctui = Util.getMeasuringTimeMs();
          }
       }
Only in namedSrc/net/minecraft/datafixer/fix: AttributeIdFix.java
Only in namedTargetSrc/net/minecraft/datafixer/fix: AttributeModifierIdFix.java
Only in namedTargetSrc/net/minecraft/datafixer/fix: RemoveEmptyItemInBrushableBlockFix.java
Only in namedSrc/net/minecraft/datafixer/fix: RemoveEmptyItemInSuspiciousBlockFix.java
diff -bur namedTargetSrc/net/minecraft/datafixer/Schemas.java namedSrc/net/minecraft/datafixer/Schemas.java
--- namedTargetSrc/net/minecraft/datafixer/Schemas.java	2024-07-24 22:41:47.672901148 +0000
+++ namedSrc/net/minecraft/datafixer/Schemas.java	2024-07-24 22:40:38.552151495 +0000
@@ -30,7 +30,7 @@
 import net.minecraft.datafixer.fix.AreaEffectCloudPotionFix;
 import net.minecraft.datafixer.fix.ArrowPickupFix;
 import net.minecraft.datafixer.fix.ArrowStoredWeaponFix;
-import net.minecraft.datafixer.fix.AttributeModifierIdFix;
+import net.minecraft.datafixer.fix.AttributeIdFix;
 import net.minecraft.datafixer.fix.BannerPatternFormatFix;
 import net.minecraft.datafixer.fix.BedBlockEntityFix;
 import net.minecraft.datafixer.fix.BedItemColorFix;
@@ -181,7 +181,7 @@
 import net.minecraft.datafixer.fix.RecipeRenamingFix;
 import net.minecraft.datafixer.fix.RedstoneConnectionsFix;
 import net.minecraft.datafixer.fix.RemapChunkStatusFix;
-import net.minecraft.datafixer.fix.RemoveEmptyItemInBrushableBlockFix;
+import net.minecraft.datafixer.fix.RemoveEmptyItemInSuspiciousBlockFix;
 import net.minecraft.datafixer.fix.RemoveFeatureFlagFix;
 import net.minecraft.datafixer.fix.RemoveGolemGossipFix;
 import net.minecraft.datafixer.fix.RemovePoiValidTagFix;
@@ -1365,7 +1365,7 @@
       Schema schema221 = builder.addSchema(3828, EMPTY_IDENTIFIER_NORMALIZE);
       builder.addFixer(new EmptyItemInVillagerTradeFix(schema221));
       Schema schema222 = builder.addSchema(3833, EMPTY_IDENTIFIER_NORMALIZE);
-      builder.addFixer(new RemoveEmptyItemInBrushableBlockFix(schema222));
+      builder.addFixer(new RemoveEmptyItemInSuspiciousBlockFix(schema222));
       Schema schema223 = builder.addSchema(3938, Schema3938::new);
       builder.addFixer(new ArrowStoredWeaponFix(schema223));
       Schema schema224 = builder.addSchema(3939, EMPTY_IDENTIFIER_NORMALIZE);
@@ -1373,7 +1373,7 @@
       Schema schema225 = builder.addSchema(3943, EMPTY_IDENTIFIER_NORMALIZE);
       builder.addFixer(new OptionsMenuBlurrinessFix(schema225));
       Schema schema226 = builder.addSchema(3945, EMPTY_IDENTIFIER_NORMALIZE);
-      builder.addFixer(new AttributeModifierIdFix(schema226));
+      builder.addFixer(new AttributeIdFix(schema226));
       builder.addFixer(new JukeboxTicksSinceSongStartedFix(schema226));
    }
 

Please sign in to comment.