-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.20.4] Change how resource pack grouping works and group mod data p…
…acks - take 2 (#367)
- Loading branch information
1 parent
f7049ed
commit 70cbb5b
Showing
25 changed files
with
364 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 9 additions & 21 deletions
30
patches/net/minecraft/client/gui/screens/packs/PackSelectionModel.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
--- a/net/minecraft/client/gui/screens/packs/PackSelectionModel.java | ||
+++ b/net/minecraft/client/gui/screens/packs/PackSelectionModel.java | ||
@@ -106,6 +_,8 @@ | ||
boolean canMoveUp(); | ||
|
||
boolean canMoveDown(); | ||
+ | ||
+ default boolean notHidden() { return true; } | ||
} | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
@@ -205,6 +_,11 @@ | ||
@Override | ||
public void moveDown() { | ||
this.move(1); | ||
+ } | ||
+ | ||
+ @Override | ||
+ public boolean notHidden() { | ||
+ return !pack.isHidden(); | ||
} | ||
} | ||
|
||
@@ -31,7 +_,7 @@ | ||
this.onListChanged = p_99909_; | ||
this.iconGetter = p_99910_; | ||
this.repository = p_99911_; | ||
- this.selected = Lists.newArrayList(p_99911_.getSelectedPacks()); | ||
+ this.selected = Lists.newArrayList(p_99911_.getSelectedPacks().stream().filter(p -> !p.isHidden()).toList()); | ||
Collections.reverse(this.selected); | ||
this.unselected = Lists.newArrayList(p_99911_.getAvailablePacks()); | ||
this.unselected.removeAll(this.selected); |
11 changes: 0 additions & 11 deletions
11
patches/net/minecraft/client/gui/screens/packs/PackSelectionScreen.java.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
patches/net/minecraft/server/commands/DataPackCommand.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/net/minecraft/server/commands/DataPackCommand.java | ||
+++ b/net/minecraft/server/commands/DataPackCommand.java | ||
@@ -183,7 +_,7 @@ | ||
private static int listEnabledPacks(CommandSourceStack p_136866_) { | ||
PackRepository packrepository = p_136866_.getServer().getPackRepository(); | ||
packrepository.reload(); | ||
- Collection<? extends Pack> collection = packrepository.getSelectedPacks(); | ||
+ Collection<? extends Pack> collection = packrepository.getSelectedPacks().stream().filter(p -> !p.isHidden()).toList(); | ||
if (collection.isEmpty()) { | ||
p_136866_.sendSuccess(() -> Component.translatable("commands.datapack.list.enabled.none"), false); | ||
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
patches/net/minecraft/server/packs/resources/FallbackResourceManager.java.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.