Skip to content

Commit

Permalink
Update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
coehlrich committed Jan 8, 2025
1 parent 2f7379b commit 5d410c8
Show file tree
Hide file tree
Showing 34 changed files with 438 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -2205,6 +2205,7 @@
@@ -2213,6 +2213,7 @@
case EntityHitResult entityhitresult:
this.gameMode.handlePickItemFromEntity(entityhitresult.getEntity(), flag);
break;
+ default:
}
}
}
@@ -2299,7 +2300,7 @@
@@ -2307,7 +2308,7 @@
}

public CompletableFuture<Void> delayTextureReload() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
--- a/net/minecraft/client/gui/GuiGraphics.java
+++ b/net/minecraft/client/gui/GuiGraphics.java
@@ -1020,57 +1020,21 @@
Object object = hoverevent;
Throwable throwable4;
switch (object) {
- case HoverEvent.ShowItem hoverevent$showitem:
- HoverEvent.ShowItem hoverevent$showitem1 = hoverevent$showitem;
-
- try {
- itemstack1 = hoverevent$showitem1.item();
- } catch (Throwable throwable2) {
- throwable4 = throwable2;
- boolean flag1 = false;
- break;
- }
-
- ItemStack itemstack = itemstack1;
+ case HoverEvent.ShowItem(ItemStack itemstack):
this.renderTooltip(p_282584_, itemstack, p_283623_, p_282114_);
return;
- case HoverEvent.ShowEntity hoverevent$showentity:
- HoverEvent.ShowEntity hoverevent$showentity1 = hoverevent$showentity;
-
- try {
- hoverevent$entitytooltipinfo1 = hoverevent$showentity1.entity();
- } catch (Throwable throwable1) {
- throwable4 = throwable1;
- boolean flag = false;
- break;
- }
-
- HoverEvent.EntityTooltipInfo hoverevent$entitytooltipinfo = hoverevent$entitytooltipinfo1;
+ case HoverEvent.ShowEntity(HoverEvent.EntityTooltipInfo hoverevent$entitytooltipinfo):
if (this.minecraft.options.advancedItemTooltips) {
this.renderComponentTooltip(p_282584_, hoverevent$entitytooltipinfo.getTooltipLines(), p_283623_, p_282114_);
}

return;
- case HoverEvent.ShowText hoverevent$showtext:
- HoverEvent.ShowText hoverevent$showtext1 = hoverevent$showtext;
-
- try {
- component1 = hoverevent$showtext1.text();
- } catch (Throwable throwable) {
- throwable4 = throwable;
- boolean flag2 = false;
- break;
- }
-
- Component component = component1;
+ case HoverEvent.ShowText(Component component):
this.renderTooltip(p_282584_, p_282584_.split(component, Math.max(this.guiWidth() / 2, 200)), p_283623_, p_282114_);
return;
default:
return;
}
-
- Throwable throwable3 = throwable4;
- throw new MatchException(throwable3.toString(), throwable3);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
--- a/net/minecraft/client/gui/screens/Screen.java
+++ b/net/minecraft/client/gui/screens/Screen.java
@@ -257,18 +257,7 @@
Objects.requireNonNull(clickevent);
Throwable throwable5;
switch (clickevent) {
- case ClickEvent.OpenUrl clickevent$openurl:
- ClickEvent.OpenUrl clickevent$openurl1 = clickevent$openurl;
-
- try {
- uri1 = clickevent$openurl1.uri();
- } catch (Throwable throwable4) {
- throwable5 = throwable4;
- boolean flag2 = false;
- break;
- }
-
- URI uri = uri1;
+ case ClickEvent.OpenUrl(URI uri):
if (!this.minecraft.options.chatLinks().get()) {
return false;
}
@@ -289,32 +278,10 @@
case ClickEvent.OpenFile clickevent$openfile:
Util.getPlatform().openFile(clickevent$openfile.file());
return true;
- case ClickEvent.SuggestCommand clickevent$suggestcommand:
- ClickEvent.SuggestCommand clickevent$suggestcommand1 = clickevent$suggestcommand;
-
- try {
- s6 = clickevent$suggestcommand1.command();
- } catch (Throwable throwable3) {
- throwable5 = throwable3;
- boolean flag1 = false;
- break;
- }
-
- String s2 = s6;
+ case ClickEvent.SuggestCommand(String s2):
this.insertText(s2, true);
return true;
- case ClickEvent.RunCommand clickevent$runcommand:
- ClickEvent.RunCommand clickevent$runcommand1 = clickevent$runcommand;
-
- try {
- s5 = clickevent$runcommand1.command();
- } catch (Throwable throwable2) {
- throwable5 = throwable2;
- boolean flag = false;
- break;
- }
-
- String s3 = s5;
+ case ClickEvent.RunCommand(String s3):
String s = s3;
if (s3.startsWith("/")) {
s = s3.substring(1);
@@ -325,27 +292,13 @@
}

return true;
- case ClickEvent.CopyToClipboard clickevent$copytoclipboard:
- ClickEvent.CopyToClipboard clickevent$copytoclipboard1 = clickevent$copytoclipboard;
-
- try {
- s4 = clickevent$copytoclipboard1.value();
- } catch (Throwable throwable1) {
- throwable5 = throwable1;
- boolean flag3 = false;
- break;
- }
-
- String s1 = s4;
+ case ClickEvent.CopyToClipboard(String s1):
this.minecraft.keyboardHandler.setClipboard(s1);
return true;
default:
LOGGER.error("Don't know how to handle {}", clickevent);
return true;
}
-
- Throwable throwable = throwable5;
- throw new MatchException(throwable.toString(), throwable);
}

return false;
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
--- a/net/minecraft/client/gui/screens/inventory/BookViewScreen.java
+++ b/net/minecraft/client/gui/screens/inventory/BookViewScreen.java
@@ -257,7 +257,7 @@
@@ -191,16 +191,7 @@
ClickEvent clickevent = p_98293_.getClickEvent();
if (clickevent == null) {
return false;
- } else if (clickevent instanceof ClickEvent.ChangePage clickevent$changepage) {
- ClickEvent.ChangePage clickevent$changepage1 = clickevent$changepage;
-
- try {
- j = clickevent$changepage1.page();
- } catch (Throwable throwable) {
- throw new MatchException(throwable.toString(), throwable);
- }
-
- int i = j;
+ } else if (clickevent instanceof ClickEvent.ChangePage(int i)) {
return this.forcePage(i - 1);
} else {
boolean flag = super.handleComponentClicked(p_98293_);
@@ -259,7 +250,7 @@
return new BookViewScreen.BookAccess(writtenbookcontent.getPages(flag));
} else {
WritableBookContent writablebookcontent = p_98309_.get(DataComponents.WRITABLE_BOOK_CONTENT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/multiplayer/ClientLevel.java
+++ b/net/minecraft/client/multiplayer/ClientLevel.java
@@ -1092,6 +1092,7 @@
@@ -1106,6 +1106,7 @@
case EnderDragon enderdragon:
ClientLevel.this.dragonParts.addAll(Arrays.asList(enderdragon.getSubEntities()));
break;
+ default:
}
}

@@ -1105,6 +1106,7 @@
@@ -1119,6 +1120,7 @@
case EnderDragon enderdragon:
ClientLevel.this.dragonParts.removeAll(Arrays.asList(enderdragon.getSubEntities()));
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/renderer/PostChain.java
+++ b/net/minecraft/client/renderer/PostChain.java
@@ -70,121 +70,18 @@
@@ -67,121 +67,18 @@

for (PostChainConfig.Input postchainconfig$input : p_361826_.inputs()) {
Objects.requireNonNull(postchainconfig$input);
Expand Down Expand Up @@ -124,7 +124,7 @@
}

return postpass;
@@ -201,43 +98,8 @@
@@ -198,43 +95,8 @@

for (Entry<ResourceLocation, PostChainConfig.InternalTarget> entry : this.internalTargets.entrySet()) {
ResourceLocation resourcelocation1 = entry.getKey();
Expand Down Expand Up @@ -167,6 +167,6 @@
- int j = l;
+ RenderTargetDescriptor rendertargetdescriptor = switch (entry.getValue()) {
+ case PostChainConfig.FixedSizedTarget(int i, int j) -> {
yield new RenderTargetDescriptor(i, j, true);
yield new RenderTargetDescriptor(i, j, true, 0);
}
case PostChainConfig.FullScreenTarget postchainconfig$fullscreentarget -> new RenderTargetDescriptor(p_361423_, p_362735_, true);
case PostChainConfig.FullScreenTarget postchainconfig$fullscreentarget -> new RenderTargetDescriptor(p_361423_, p_362735_, true, 0);
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -2208,6 +2208,7 @@
@@ -2216,6 +2216,7 @@
case EntityHitResult entityhitresult:
this.gameMode.handlePickItemFromEntity(entityhitresult.getEntity(), flag);
break;
+ default:
}
}
}
@@ -2302,7 +2303,7 @@
@@ -2310,7 +2311,7 @@
}

public CompletableFuture<Void> delayTextureReload() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
--- a/net/minecraft/client/gui/GuiGraphics.java
+++ b/net/minecraft/client/gui/GuiGraphics.java
@@ -1023,57 +1023,21 @@
Object object = hoverevent;
Throwable throwable4;
switch (object) {
- case HoverEvent.ShowItem hoverevent$showitem:
- HoverEvent.ShowItem hoverevent$showitem1 = hoverevent$showitem;
-
- try {
- itemstack1 = hoverevent$showitem1.item();
- } catch (Throwable throwable2) {
- throwable4 = throwable2;
- boolean flag1 = false;
- break;
- }
-
- ItemStack itemstack = itemstack1;
+ case HoverEvent.ShowItem(ItemStack itemstack):
this.renderTooltip(p_282584_, itemstack, p_283623_, p_282114_);
return;
- case HoverEvent.ShowEntity hoverevent$showentity:
- HoverEvent.ShowEntity hoverevent$showentity1 = hoverevent$showentity;
-
- try {
- hoverevent$entitytooltipinfo1 = hoverevent$showentity1.entity();
- } catch (Throwable throwable1) {
- throwable4 = throwable1;
- boolean flag = false;
- break;
- }
-
- HoverEvent.EntityTooltipInfo hoverevent$entitytooltipinfo = hoverevent$entitytooltipinfo1;
+ case HoverEvent.ShowEntity(HoverEvent.EntityTooltipInfo hoverevent$entitytooltipinfo):
if (this.minecraft.options.advancedItemTooltips) {
this.renderComponentTooltip(p_282584_, hoverevent$entitytooltipinfo.getTooltipLines(), p_283623_, p_282114_);
}

return;
- case HoverEvent.ShowText hoverevent$showtext:
- HoverEvent.ShowText hoverevent$showtext1 = hoverevent$showtext;
-
- try {
- component1 = hoverevent$showtext1.text();
- } catch (Throwable throwable) {
- throwable4 = throwable;
- boolean flag2 = false;
- break;
- }
-
- Component component = component1;
+ case HoverEvent.ShowText(Component component):
this.renderTooltip(p_282584_, p_282584_.split(component, Math.max(this.guiWidth() / 2, 200)), p_283623_, p_282114_);
return;
default:
return;
}
-
- Throwable throwable3 = throwable4;
- throw new MatchException(throwable3.toString(), throwable3);
}
}

Loading

0 comments on commit 5d410c8

Please sign in to comment.