Skip to content

Commit

Permalink
fixed visibility of hidden paintings
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke100000 committed Oct 9, 2023
1 parent 086796d commit 29d4af1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.6.7

* fixed visibility of hidden paintings

# 0.6.6

* Max and Low res limits are now synced to the client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ private void rebuildPaintings() {
tooltip.add(new TranslatableText("immersive_paintings.by_author", painting.author).formatted(Formatting.ITALIC));
tooltip.add(new TranslatableText("immersive_paintings.resolution", painting.width, painting.height, painting.resolution).formatted(Formatting.ITALIC));

if (page == Page.YOURS || painting.hidden) {
if (page == Page.YOURS && painting.hidden) {
tooltip.add(new TranslatableText("immersive_paintings.hidden").formatted(Formatting.ITALIC).formatted(Formatting.GRAY));
}

Expand Down Expand Up @@ -688,7 +688,7 @@ private void updateSearch() {
filteredPaintings.addAll(ClientPaintingManager.getPaintings().entrySet().stream()
.filter(v -> v.getValue().graffiti == entity.isGraffiti())
.filter(v -> page != Page.YOURS || Objects.equals(v.getValue().author, playerName) && !v.getValue().datapack)
.filter(v -> page != Page.PLAYERS || !Objects.equals(v.getValue().author, playerName) && !v.getValue().datapack && !v.getValue().hidden)
.filter(v -> page != Page.PLAYERS || !v.getValue().datapack && !v.getValue().hidden)
.filter(v -> page != Page.DATAPACKS || v.getValue().datapack)
.filter(v -> v.getKey().toString().contains(filteredString))
.filter(v -> filteredResolution == 0 || v.getValue().resolution == filteredResolution)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class Painting {
public final Texture eighth;
public final Texture thumbnail;

public final static Painting DEFAULT = new Painting(new ByteImage(16, 16), 16);
public static final Painting DEFAULT = new Painting(new ByteImage(16, 16), 16);

public Painting(@Nullable ByteImage image, int width, int height, int resolution, boolean hidden, boolean graffiti) {
this(image, width, height, resolution, "", "", false, hidden, graffiti, UUID.randomUUID().toString());
Expand Down

0 comments on commit 29d4af1

Please sign in to comment.