Skip to content

Commit

Permalink
Switch to using 4 spaces for indentation instead of 3
Browse files Browse the repository at this point in the history
Also fixes configuration cache being reused when a config json changes
  • Loading branch information
coehlrich committed Nov 6, 2023
1 parent 7c6c7c8 commit df0e3b8
Show file tree
Hide file tree
Showing 255 changed files with 2,536 additions and 2,536 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Utils {
}
File.metaClass.getSha1 = { !delegate.exists() ? null : MessageDigest.getInstance('SHA-1').digest(delegate.bytes).encodeHex().toString() }

File.metaClass.getJson = { return delegate.exists() ? new JsonSlurper().parse(delegate) : [:] }
File.metaClass.getJson = { return delegate.exists() ? new JsonSlurper().parseText(delegate.text) : [:] }
File.metaClass.setJson = { json -> delegate.text = new JsonBuilder(json).toPrettyString() }
}

Expand Down
2 changes: 1 addition & 1 deletion versions/snapshot/1.20/23w44a/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"fernflower": {
"version": "org.vineflower:vineflower:1.9.3",
"java_version": 17,
"args": ["-din=1", "-rbr=1", "-dgs=1", "-asc=1", "-rsy=1", "-iec=1", "-jvn=1", "-iib=1", "-bsm=1", "-dcl=1", "-nls=1", "-log=TRACE", "-cfg", "{libraries}", "{input}", "{output}"],
"args": ["-din=1", "-rbr=1", "-dgs=1", "-asc=1", "-rsy=1", "-iec=1", "-jvn=1", "-iib=1", "-bsm=1", "-dcl=1", "-nls=1", "-ind= ", "-log=TRACE", "-cfg", "{libraries}", "{input}", "{output}"],
"jvmargs": ["-Xmx4G"]
},
"merge": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/com/mojang/blaze3d/platform/MacosUtil.java
+++ b/com/mojang/blaze3d/platform/MacosUtil.java
@@ -35,7 +35,7 @@
}
}

private static long getStyleMask(NSObject p_304421_) {
- return p_304421_.sendRaw("styleMask", new Object[0]);
+ return (long)p_304421_.sendRaw("styleMask", new Object[0]);
}
private static long getStyleMask(NSObject p_304421_) {
- return p_304421_.sendRaw("styleMask", new Object[0]);
+ return (long)p_304421_.sendRaw("styleMask", new Object[0]);
}

private static void toggleNativeFullscreen(NSObject p_182524_) {
private static void toggleNativeFullscreen(NSObject p_182524_) {
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
+++ b/com/mojang/realmsclient/RealmsMainScreen.java
@@ -549,8 +549,7 @@

@Nullable
private RealmsServer getSelectedServer() {
- AbstractSelectionList.Entry abstractselectionlist$entry = this.realmSelectionList.getSelected();
- return abstractselectionlist$entry instanceof RealmsMainScreen.ServerEntry realmsmainscreen$serverentry ? realmsmainscreen$serverentry.getServer() : null;
+ return this.realmSelectionList.getSelected() instanceof RealmsMainScreen.ServerEntry realmsmainscreen$serverentry ? realmsmainscreen$serverentry.getServer() : null;
}

private void leaveServer(boolean p_193494_, final RealmsServer p_193495_) {
@Nullable
private RealmsServer getSelectedServer() {
- AbstractSelectionList.Entry abstractselectionlist$entry = this.realmSelectionList.getSelected();
- return abstractselectionlist$entry instanceof RealmsMainScreen.ServerEntry realmsmainscreen$serverentry
+ return this.realmSelectionList.getSelected() instanceof RealmsMainScreen.ServerEntry realmsmainscreen$serverentry
? realmsmainscreen$serverentry.getServer()
: null;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsBackupInfoScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsBackupInfoScreen.java
@@ -35,8 +35,7 @@
this.addRenderableWidget(this.backupInfoList);
this.layout.addToFooter(Button.builder(CommonComponents.GUI_BACK, p_299754_ -> this.onClose()).build());
this.layout.arrangeElements();
- this.layout.visitWidgets(p_299756_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
}
this.addRenderableWidget(this.backupInfoList);
this.layout.addToFooter(Button.builder(CommonComponents.GUI_BACK, p_299754_ -> this.onClose()).build());
this.layout.arrangeElements();
- this.layout.visitWidgets(p_299756_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
}

@Override
@Override
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsCreateRealmScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsCreateRealmScreen.java
@@ -56,8 +56,7 @@
LinearLayout linearlayout1 = this.layout.addToFooter(LinearLayout.horizontal().spacing(10));
linearlayout1.addChild(button);
linearlayout1.addChild(Button.builder(CommonComponents.GUI_BACK, p_293570_ -> this.onClose()).build());
- this.layout.visitWidgets(p_293566_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
this.setInitialFocus(this.nameBox);
}
LinearLayout linearlayout1 = this.layout.addToFooter(LinearLayout.horizontal().spacing(10));
linearlayout1.addChild(button);
linearlayout1.addChild(Button.builder(CommonComponents.GUI_BACK, p_293570_ -> this.onClose()).build());
- this.layout.visitWidgets(p_293566_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
this.setInitialFocus(this.nameBox);
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsLongRunningMcoTaskScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsLongRunningMcoTaskScreen.java
@@ -78,8 +78,7 @@
this.loadingDotsWidget = new LoadingDotsWidget(this.font, this.title);
this.layout.addChild(this.loadingDotsWidget, p_300631_ -> p_300631_.paddingBottom(30));
this.layout.addChild(Button.builder(CommonComponents.GUI_CANCEL, p_300632_ -> this.cancel()).build());
- this.layout.visitWidgets(p_300634_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}
this.loadingDotsWidget = new LoadingDotsWidget(this.font, this.title);
this.layout.addChild(this.loadingDotsWidget, p_300631_ -> p_300631_.paddingBottom(30));
this.layout.addChild(Button.builder(CommonComponents.GUI_CANCEL, p_300632_ -> this.cancel()).build());
- this.layout.visitWidgets(p_300634_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsParentalConsentScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsParentalConsentScreen.java
@@ -35,8 +35,7 @@
Component component = Component.translatable("mco.account.privacy.info.button");
linearlayout.addChild(Button.builder(component, ConfirmLinkScreen.confirmLink(this, "https://aka.ms/MinecraftGDPR")).build());
linearlayout.addChild(Button.builder(CommonComponents.GUI_BACK, p_307025_ -> this.onClose()).build());
- this.layout.visitWidgets(p_307027_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}
Component component = Component.translatable("mco.account.privacy.info.button");
linearlayout.addChild(Button.builder(component, ConfirmLinkScreen.confirmLink(this, "https://aka.ms/MinecraftGDPR")).build());
linearlayout.addChild(Button.builder(CommonComponents.GUI_BACK, p_307025_ -> this.onClose()).build());
- this.layout.visitWidgets(p_307027_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsResetNormalWorldScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsResetNormalWorldScreen.java
@@ -63,8 +63,7 @@
LinearLayout linearlayout1 = this.layout.addToFooter(LinearLayout.horizontal().spacing(10));
linearlayout1.addChild(Button.builder(this.buttonTitle, p_293585_ -> this.callback.accept(this.createWorldGenerationInfo())).build());
linearlayout1.addChild(Button.builder(CommonComponents.GUI_BACK, p_89288_ -> this.onClose()).build());
- this.layout.visitWidgets(p_293583_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}
LinearLayout linearlayout1 = this.layout.addToFooter(LinearLayout.horizontal().spacing(10));
linearlayout1.addChild(Button.builder(this.buttonTitle, p_293585_ -> this.callback.accept(this.createWorldGenerationInfo())).build());
linearlayout1.addChild(Button.builder(CommonComponents.GUI_BACK, p_89288_ -> this.onClose()).build());
- this.layout.visitWidgets(p_293583_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.repositionElements();
}

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsResetWorldScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsResetWorldScreen.java
@@ -213,8 +213,7 @@
)
);
this.layout.addToFooter(Button.builder(CommonComponents.GUI_BACK, p_300644_ -> this.onClose()).build());
- this.layout.visitWidgets(p_300642_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.layout.arrangeElements();
}
@@ -223,8 +223,7 @@
)
);
this.layout.addToFooter(Button.builder(CommonComponents.GUI_BACK, p_300644_ -> this.onClose()).build());
- this.layout.visitWidgets(p_300642_ -> {
- });
+ this.layout.visitWidgets(this::addRenderableWidget);
this.layout.arrangeElements();
}

Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsSelectWorldTemplateScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsSelectWorldTemplateScreen.java
@@ -154,9 +154,9 @@
public void run() {
WorldTemplatePaginatedList worldtemplatepaginatedlist = p_89654_;

- Either<WorldTemplatePaginatedList, Exception> either;
- for(RealmsClient realmsclient = RealmsClient.create();
- worldtemplatepaginatedlist != null;
+ RealmsClient realmsclient = RealmsClient.create();
+ while(worldtemplatepaginatedlist != null) {
+ Either<WorldTemplatePaginatedList, Exception> either = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldtemplatepaginatedlist, realmsclient);
worldtemplatepaginatedlist = RealmsSelectWorldTemplateScreen.this.minecraft
.submit(
() -> {
@@ -190,9 +190,7 @@
}
}
)
- .join()
- ) {
- either = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldtemplatepaginatedlist, realmsclient);
+ .join();
}
}
})
@@ -156,9 +156,9 @@
public void run() {
WorldTemplatePaginatedList worldtemplatepaginatedlist = p_89654_;
- Either<WorldTemplatePaginatedList, Exception> either;
- for(RealmsClient realmsclient = RealmsClient.create();
- worldtemplatepaginatedlist != null;
+ RealmsClient realmsclient = RealmsClient.create();
+ while(worldtemplatepaginatedlist != null) {
+ Either<WorldTemplatePaginatedList, Exception> either = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldtemplatepaginatedlist, realmsclient);
worldtemplatepaginatedlist = RealmsSelectWorldTemplateScreen.this.minecraft
.submit(
() -> {
@@ -196,9 +196,7 @@
}
}
)
- .join()
- ) {
- either = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldtemplatepaginatedlist, realmsclient);
+ .join();
}
}
})
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
--- a/com/mojang/realmsclient/gui/screens/RealmsUploadScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsUploadScreen.java
@@ -261,8 +261,8 @@
} else if (this.cancelled) {
this.uploadCancelled();
} else {
- j = (int)(new File(this.minecraft.gameDirectory.getAbsolutePath(), "saves"));
- file1 = this.tarGzipArchive(new File(j, this.selectedLevel.getLevelId()));
+ File file = (new File(this.minecraft.gameDirectory.getAbsolutePath(), "saves"));
+ file1 = this.tarGzipArchive(new File(file, this.selectedLevel.getLevelId()));
if (this.cancelled) {
this.uploadCancelled();
} else if (this.verify(file1)) {
} else if (this.cancelled) {
this.uploadCancelled();
} else {
- j = (int)(new File(this.minecraft.gameDirectory.getAbsolutePath(), "saves"));
- file1 = this.tarGzipArchive(new File(j, this.selectedLevel.getLevelId()));
+ File file = (new File(this.minecraft.gameDirectory.getAbsolutePath(), "saves"));
+ file1 = this.tarGzipArchive(new File(file, this.selectedLevel.getLevelId()));
if (this.cancelled) {
this.uploadCancelled();
} else if (this.verify(file1)) {
@@ -327,13 +327,10 @@
}
}
} catch (IOException ioexception) {
- uploadinfo = ioexception;
this.setErrorMessage(Component.translatable("mco.upload.failed", ioexception.getMessage()));
} catch (RealmsServiceException realmsserviceexception) {
- uploadinfo = realmsserviceexception;
this.setErrorMessage(Component.translatable("mco.upload.failed", realmsserviceexception.realmsError.errorMessage()));
} catch (InterruptedException interruptedexception1) {
- uploadinfo = interruptedexception1;
LOGGER.error("Could not acquire upload lock");
}
}
} catch (IOException ioexception) {
- uploadinfo = ioexception;
this.setErrorMessage(Component.translatable("mco.upload.failed", ioexception.getMessage()));
} catch (RealmsServiceException realmsserviceexception) {
- uploadinfo = realmsserviceexception;
this.setErrorMessage(Component.translatable("mco.upload.failed", realmsserviceexception.realmsError.errorMessage()));
} catch (InterruptedException interruptedexception1) {
- uploadinfo = interruptedexception1;
LOGGER.error("Could not acquire upload lock");
}
} finally {
} finally {
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -2475,7 +2475,7 @@
}
@@ -2483,7 +2483,7 @@
}

public CompletableFuture<Void> delayTextureReload() {
- return this.<CompletableFuture<Void>>submit(this::reloadResourcePacks).thenCompose(p_231391_ -> p_231391_);
+ return this.<CompletableFuture<Void>>submit((Supplier<CompletableFuture<Void>>)this::reloadResourcePacks).thenCompose(p_231391_ -> p_231391_);
}
public CompletableFuture<Void> delayTextureReload() {
- return this.<CompletableFuture<Void>>submit(this::reloadResourcePacks).thenCompose(p_231391_ -> p_231391_);
+ return this.<CompletableFuture<Void>>submit((Supplier<CompletableFuture<Void>>)this::reloadResourcePacks).thenCompose(p_231391_ -> p_231391_);
}

public void updateReportEnvironment(ReportEnvironment p_239477_) {
public void updateReportEnvironment(ReportEnvironment p_239477_) {
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/net/minecraft/client/OptionInstance.java
+++ b/net/minecraft/client/OptionInstance.java
@@ -278,7 +278,7 @@
return new OptionInstance.SliderableValueSet<R>() {
@Override
public Optional<R> validateValue(R p_231674_) {
- return IntRangeBase.this.validateValue((T)Integer.valueOf(p_231659_.applyAsInt(p_231674_))).map(p_231658_::apply);
+ return IntRangeBase.this.validateValue(Integer.valueOf(p_231659_.applyAsInt(p_231674_))).map(p_231658_::apply);
}
return new OptionInstance.SliderableValueSet<R>() {
@Override
public Optional<R> validateValue(R p_231674_) {
- return IntRangeBase.this.validateValue((T)Integer.valueOf(p_231659_.applyAsInt(p_231674_))).map(p_231658_::apply);
+ return IntRangeBase.this.validateValue(Integer.valueOf(p_231659_.applyAsInt(p_231674_))).map(p_231658_::apply);
}

@Override
@Override
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/gui/Gui.java
+++ b/net/minecraft/client/gui/Gui.java
@@ -482,9 +482,10 @@
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(mobeffect);
int i1 = j;
float f1 = f;
+ int i_f = i;
list.add(() -> {
p_282812_.setColor(1.0F, 1.0F, 1.0F, f1);
- p_282812_.blit(i + 3, i1 + 3, 0, 18, 18, textureatlassprite);
+ p_282812_.blit(i_f + 3, i1 + 3, 0, 18, 18, textureatlassprite);
p_282812_.setColor(1.0F, 1.0F, 1.0F, 1.0F);
});
}
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.get(mobeffect);
int i1 = j;
float f1 = f;
+ int i_f = i;
list.add(() -> {
p_282812_.setColor(1.0F, 1.0F, 1.0F, f1);
- p_282812_.blit(i + 3, i1 + 3, 0, 18, 18, textureatlassprite);
+ p_282812_.blit(i_f + 3, i1 + 3, 0, 18, 18, textureatlassprite);
p_282812_.setColor(1.0F, 1.0F, 1.0F, 1.0F);
});
}
Loading

0 comments on commit df0e3b8

Please sign in to comment.