From 885d9e2f36924b44737b62c995accd3ad936124e Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Sat, 7 Sep 2024 15:54:20 -0700 Subject: [PATCH 1/5] Liquid NewChunks Y>0 setting --- .../xaeroplus/feature/render/DrawManager.java | 6 +++-- .../module/impl/LiquidNewChunks.java | 21 +++++++-------- .../settings/XaeroPlusSettingRegistry.java | 6 +++++ .../java/xaeroplus/util/MutableBlockPos.java | 27 ------------------- .../assets/xaeroplus/lang/en_us.json | 2 ++ .../assets/xaeroplus/lang/es_ar.json | 2 ++ .../assets/xaeroplus/lang/fr_ca.json | 2 ++ .../assets/xaeroplus/lang/fr_fr.json | 2 ++ .../assets/xaeroplus/lang/ja_jp.json | 2 ++ .../assets/xaeroplus/lang/pl_pl.json | 2 ++ .../assets/xaeroplus/lang/pt_pt.json | 2 ++ .../assets/xaeroplus/lang/ru_ru.json | 2 ++ .../assets/xaeroplus/lang/vi_vn.json | 2 ++ .../assets/xaeroplus/lang/zh_cn.json | 2 ++ .../assets/xaeroplus/lang/zh_tw.json | 2 ++ 15 files changed, 42 insertions(+), 40 deletions(-) delete mode 100644 common/src/main/java/xaeroplus/util/MutableBlockPos.java diff --git a/common/src/main/java/xaeroplus/feature/render/DrawManager.java b/common/src/main/java/xaeroplus/feature/render/DrawManager.java index 21ce859e..7f6940ef 100644 --- a/common/src/main/java/xaeroplus/feature/render/DrawManager.java +++ b/common/src/main/java/xaeroplus/feature/render/DrawManager.java @@ -70,6 +70,7 @@ public synchronized void drawMinimapFeatures( final VertexConsumer overlayBufferBuilder, MinimapRendererHelper helper ) { + var matrix = matrixStack.last().pose(); for (int i = 0; i < sortedKeySet.size(); i++) { var k = sortedKeySet.get(i); var feature = chunkHighlightDrawFeatures.get(k); @@ -97,7 +98,7 @@ public synchronized void drawMinimapFeatures( var left = drawX + 16 * (chunkPosX - cx * 4); var top = drawZ + 16 * (chunkPosZ - cz * 4); helper.addColoredRectToExistingBuffer( - matrixStack.last().pose(), overlayBufferBuilder, + matrix, overlayBufferBuilder, left, top, 16, 16, r, g, b, a ); @@ -115,6 +116,7 @@ public synchronized void drawWorldMapFeatures( final PoseStack matrixStack, final VertexConsumer overlayBuffer ) { + var matrix = matrixStack.last().pose(); for (int i = 0; i < sortedKeySet.size(); i++) { var k = sortedKeySet.get(i); var feature = chunkHighlightDrawFeatures.get(k); @@ -138,7 +140,7 @@ public synchronized void drawWorldMapFeatures( final float right = left + 16; final float bottom = top + 16; MinimapBackgroundDrawHelper.fillIntoExistingBuffer( - matrixStack.last().pose(), overlayBuffer, + matrix, overlayBuffer, left, top, right, bottom, r, g, b, a ); diff --git a/common/src/main/java/xaeroplus/module/impl/LiquidNewChunks.java b/common/src/main/java/xaeroplus/module/impl/LiquidNewChunks.java index 2407427c..504e26e5 100644 --- a/common/src/main/java/xaeroplus/module/impl/LiquidNewChunks.java +++ b/common/src/main/java/xaeroplus/module/impl/LiquidNewChunks.java @@ -7,6 +7,7 @@ import it.unimi.dsi.fastutil.objects.ReferenceSet; import net.lenni0451.lambdaevents.EventHandler; import net.minecraft.core.BlockPos; +import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.Level; @@ -24,11 +25,9 @@ import xaeroplus.util.ChunkScanner; import xaeroplus.util.ChunkUtils; import xaeroplus.util.ColorHelper; -import xaeroplus.util.MutableBlockPos; import java.time.Duration; -import static java.util.Arrays.asList; import static xaeroplus.util.ChunkUtils.getActualDimension; import static xaeroplus.util.ColorHelper.getColor; @@ -46,14 +45,11 @@ public class LiquidNewChunks extends Module { private int newChunksColor = getColor(255, 0, 0, 100); private int inverseColor = getColor(0, 255, 0, 100); private static final Direction[] searchDirs = new Direction[] { Direction.EAST, Direction.NORTH, Direction.WEST, Direction.SOUTH, Direction.UP }; - private static final ReferenceSet liquidBlockTypeFilter = new ReferenceOpenHashSet<>(2); + private static final ReferenceSet liquidBlockTypeFilter = ReferenceOpenHashSet.of( + Blocks.WATER, + Blocks.LAVA + ); private static final String inverseDrawFeatureId = "LiquidNewChunksInverse"; - static { - liquidBlockTypeFilter.addAll(asList( - Blocks.WATER, - Blocks.LAVA - )); - } public void setDiskCache(boolean disk) { newChunksCache.setDiskCache(disk, isEnabled()); @@ -84,11 +80,12 @@ private void handleBlockUpdate(Level level, BlockPos pos, BlockState state) { if (newChunksCache.get().isHighlighted(chunkX, chunkZ, getActualDimension())) return; final int srcX = pos.getX(); final int srcY = pos.getY(); + if (XaeroPlusSettingRegistry.liquidNewChunksOnlyAboveY0Setting.getValue() && srcY <= 0) return; final int srcZ = pos.getZ(); MutableBlockPos bp = new MutableBlockPos(srcX, srcY, srcZ); for (int i = 0; i < searchDirs.length; i++) { final Direction dir = searchDirs[i]; - bp.setPos(srcX + dir.getStepX(), srcY + dir.getStepY(), srcZ + dir.getStepZ()); + bp.set(srcX + dir.getStepX(), srcY + dir.getStepY(), srcZ + dir.getStepZ()); if (level.getBlockState(bp).getFluidState().isSource()) { newChunksCache.get().addHighlight(chunkX, chunkZ); return; @@ -137,7 +134,9 @@ public void onChunkData(final ChunkDataEvent event) { } } return false; - }, level.getMinBuildHeight()); + }, XaeroPlusSettingRegistry.liquidNewChunksOnlyAboveY0Setting.getValue() + ? Math.max(1, level.getMinBuildHeight()) + : level.getMinBuildHeight()); } @EventHandler diff --git a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java index cdf056d8..7f1508de 100644 --- a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java +++ b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java @@ -282,6 +282,12 @@ public String getTranslationKey() { ColorHelper.HighlightColor.GREEN, (b) -> ModuleManager.getModule(LiquidNewChunks.class).setInverseRgbColor(b.getColor()), SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusBooleanSetting liquidNewChunksOnlyAboveY0Setting = XaeroPlusBooleanSetting.create( + "Liquid NewChunks Only Y > 0", + "setting.world_map.new_chunks_only_above_y0", + "setting.world_map.new_chunks_only_above_y0.tooltip", + false, + SettingLocation.CHUNK_HIGHLIGHTS); public static final XaeroPlusBooleanSetting oldChunksEnabledSetting = XaeroPlusBooleanSetting.create( "OldChunks Highlighting", "setting.world_map.old_chunks_highlighting", diff --git a/common/src/main/java/xaeroplus/util/MutableBlockPos.java b/common/src/main/java/xaeroplus/util/MutableBlockPos.java deleted file mode 100644 index a7211416..00000000 --- a/common/src/main/java/xaeroplus/util/MutableBlockPos.java +++ /dev/null @@ -1,27 +0,0 @@ -package xaeroplus.util; - -import net.minecraft.core.BlockPos; - -public class MutableBlockPos extends BlockPos { - public MutableBlockPos(final int i, final int j, final int k) { - super(i, j, k); - } - - public void mutateX(final int x) { - this.setX(x); - } - - public void mutateY(final int y) { - this.setY(y); - } - - public void mutateZ(final int z) { - this.setZ(z); - } - - public void setPos(final int x, final int y, final int z) { - this.mutateX(x); - this.mutateY(y); - this.mutateZ(z); - } -} diff --git a/common/src/main/resources/assets/xaeroplus/lang/en_us.json b/common/src/main/resources/assets/xaeroplus/lang/en_us.json index 98222244..d7926e64 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/en_us.json +++ b/common/src/main/resources/assets/xaeroplus/lang/en_us.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Highlights chunks that have already been loaded by checking if any flowing liquid is present.\n\nKeep in mind there will be false positives. Multiple biomes and structures like bastions and basalt deltas can generate with flowing liquid.", "setting.world_map.new_chunks_inverse_color": "Liquid NewChunks Inverse Color", "setting.world_map.new_chunks_inverse_color.tooltip": "Changes the color of Liquid NewChunks inverse highlights", + "setting.world_map.new_chunks_only_above_y0": "Liquid NewChunks Only Y > 0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Limits Liquid NewChunks search to Y levels greater than 0", "setting.world_map.old_chunks_highlighting": "OldChunks", "setting.world_map.old_chunks_highlighting.tooltip": "Highlights OldChunks on the Minimap and WorldMap. An OldChunk is a chunk that was generated in 1.12.2 or lower based on the blocks present in the chunk. Intended for use on 2b2t.", "setting.world_map.old_chunks_inverse": "OldChunks Inverse", diff --git a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json index 7d6b7db8..446b4a03 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json +++ b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json @@ -51,6 +51,8 @@ "setting.world_map.palette_new_chunks_color.tooltip": "Establece el color de los destacados de Paleta NewChunks", "setting.world_map.palette_new_chunks_inverse": "Paleta NuevosChuncks Inversa", "setting.world_map.palette_new_chunks_inverse.tooltip": "Renderiza la inversa de Paleta NuevosChuncks, lo que significa que los fragmentos que cargues ya se habían generado", + "setting.world_map.new_chunks_only_above_y0": "NuevosFragmentos Líquidos Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Limita la búsqueda de NuevosFragmentos Líquidos a niveles Y superiores a 0", "setting.world_map.new_chunks_highlighting": "Líquido NewChunks", "setting.world_map.new_chunks_highlighting.tooltip": "Detecta NewChunks basado en los estados de flujo de líquido en chunks. No funciona en chunks sin flujo de líquido o en el End", "setting.world_map.new_chunks_save_load_to_disk": "Guardar/Cargar Líquido NewChunks en Disco", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json index ad2c8c1d..8c1a8f79 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Met en surbrillance les chunks qui ont déjà été chargés en vérifiant s'il y a un liquide en mouvement présent.\n\nGardez à l'esprit qu'il y aura des faux positifs. Plusieurs biomes et structures comme les bastions et les deltas de basalte peuvent se générer avec un liquide en mouvement.", "setting.world_map.new_chunks_inverse_color": "Couleur Inverse de Liquéfié NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Change la couleur des surbrillances inverses de Liquéfié NewChunks", + "setting.world_map.new_chunks_only_above_y0": "NouveauxMorceaux Liquides Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Limite la recherche de NouveauxMorceaux Liquides aux niveaux Y supérieurs à 0", "setting.world_map.old_chunks_highlighting": "Mise en évidence d'OldChunks", "setting.world_map.old_chunks_highlighting.tooltip": "Met en évidence OldChunks sur la mini-carte et la carte du monde. Un OldChunk est un morceau généré dans la version 1.12.2 ou inférieure en fonction des blocs présents dans le morceau. Destiné à être utilisé sur 2b2t.", "setting.world_map.old_chunks_inverse": "OldChunks inversé", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json index ad2c8c1d..8c1a8f79 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Met en surbrillance les chunks qui ont déjà été chargés en vérifiant s'il y a un liquide en mouvement présent.\n\nGardez à l'esprit qu'il y aura des faux positifs. Plusieurs biomes et structures comme les bastions et les deltas de basalte peuvent se générer avec un liquide en mouvement.", "setting.world_map.new_chunks_inverse_color": "Couleur Inverse de Liquéfié NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Change la couleur des surbrillances inverses de Liquéfié NewChunks", + "setting.world_map.new_chunks_only_above_y0": "NouveauxMorceaux Liquides Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Limite la recherche de NouveauxMorceaux Liquides aux niveaux Y supérieurs à 0", "setting.world_map.old_chunks_highlighting": "Mise en évidence d'OldChunks", "setting.world_map.old_chunks_highlighting.tooltip": "Met en évidence OldChunks sur la mini-carte et la carte du monde. Un OldChunk est un morceau généré dans la version 1.12.2 ou inférieure en fonction des blocs présents dans le morceau. Destiné à être utilisé sur 2b2t.", "setting.world_map.old_chunks_inverse": "OldChunks inversé", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json index 2df36506..1a1777a2 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json @@ -61,6 +61,8 @@ "setting.world_map.new_chunks_color.tooltip": "液体 NewChunksの色を変更します。", "setting.world_map.new_chunks_inverse_enabled": "液体 NewChunksの逆レンダリング", "setting.world_map.new_chunks_inverse_enabled.tooltip": "流れている液体が存在するかどうかを確認して、すでにロードされているチャンクをハイライトします。\n\n誤検知があることに注意してください。複数のバイオームやバスチオンやバサルトデルタのような構造は流れている液体と共に生成されることがあります。", + "setting.world_map.new_chunks_only_above_y0": "液体の新しいチャンク Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "液体の新しいチャンクの検索をYが0より大きいレベルに制限します", "setting.world_map.old_chunks_highlighting": "OldChunksをハイライトする", "setting.world_map.old_chunks_highlighting.tooltip": "ミニマップとワールドマップのOldChunkをハイライトします。OldChunkとは、1.12.2以前のチャンクで、チャンク内に存在するブロックに基づいて生成されたチャンクのことです。2b2tでの使用を意図しています。", "setting.world_map.old_chunks_inverse": "[古いチャンク]の逆", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json index 5766bb70..ca3c4de8 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Podświetla chunki, które zostały już załadowane, sprawdzając obecność przepływającej cieczy.\n\nPamiętaj, że mogą występować fałszywe pozytywy. Wiele biomów i struktur, takich jak bastiony i delty bazaltowe, może generować się z przepływającą cieczą.", "setting.world_map.new_chunks_inverse_color": "Kolor Odwrotny Ciecz NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Zmienia kolor odwrotnych podświetleń Ciecz NewChunks", + "setting.world_map.new_chunks_only_above_y0": "Płynne NoweFragmenty Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Ogranicza wyszukiwanie Płynnych NowychFragmentów do poziomów Y większych niż 0", "setting.world_map.old_chunks_highlighting": "Podświetlanie OldChunks", "setting.world_map.old_chunks_highlighting.tooltip": "Podświetla OldChunks na minimapie i mapie świata. OldChunk to fragment wygenerowany w wersji 1.12.2 lub starszej na podstawie bloków znajdujących się w fragmencie. Przeznaczony do użytku na 2b2t", "setting.world_map.old_chunks_inverse": "Odwrotność OldChunks", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json index 14dbbd36..ee5ca00c 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Destaca chunks que já foram carregados verificando se há algum líquido fluindo presente.\n\nTenha em mente que haverá falsos positivos. Múltiplos biomas e estruturas como bastiões e deltas de basalto podem gerar com líquido fluindo.", "setting.world_map.new_chunks_inverse_color": "Cor Inversa do Líquido NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Altera a cor dos destaques inversos do Líquido NewChunks", + "setting.world_map.new_chunks_only_above_y0": "NovosFragmentos Líquidos Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Limita a pesquisa de NovosFragmentos Líquidos a níveis Y maiores que 0", "setting.world_map.old_chunks_highlighting": "Destacar Partes Antigas", "setting.world_map.old_chunks_highlighting.tooltip": "Destaca no mini-mapa e mapa-mundo partes antigas do mundo (OldChunks). Uma parte antiga é uma parte que contém blocos que foram gerados na versão 1.12.2 ou inferior. Para ser usado no 2b2t.", "setting.world_map.old_chunks_inverse": "Partes Antigas Invertidas", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json index 2d844009..321da523 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Выделяет чанки, которые уже были загружены, проверяя наличие текущей жидкости.\n\nИмейте в виду, что могут быть ложные срабатывания. Несколько биомов и структур, таких как бастионы и дельты базальта, могут генерироваться с текущей жидкостью.", "setting.world_map.new_chunks_inverse_color": "Цвет Обратной Жидкости NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Изменяет цвет обратных выделений Жидкости NewChunks", + "setting.world_map.new_chunks_only_above_y0": "НовыеЖидкиеЧанки Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Ограничивает поиск НовыхЖидкихЧанков уровнями Y больше 0", "setting.world_map.old_chunks_highlighting": "Выделение старых фрагментов", "setting.world_map.old_chunks_highlighting.tooltip": "Выделяет OldChunks на мини-карте и карте мира. OldChunk — это чанк, созданный в версии 1.12.2 или ниже на основе блоков, присутствующих в чанк. Предназначен для использования на 2b2t.", "setting.world_map.old_chunks_inverse": "OldChunks Инверсия", diff --git a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json index 23790bda..a789112a 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "Làm nổi bật các chunk đã được tải bằng cách kiểm tra sự hiện diện của chất lỏng chảy.\n\nLưu ý rằng sẽ có những trường hợp dương tính giả. Nhiều quần xã sinh vật và cấu trúc như bastion và delta bazan có thể sinh ra với chất lỏng chảy.", "setting.world_map.new_chunks_inverse_color": "Màu Ngược Chất lỏng NewChunks", "setting.world_map.new_chunks_inverse_color.tooltip": "Thay đổi màu của các điểm nổi bật ngược Chất lỏng NewChunks", + "setting.world_map.new_chunks_only_above_y0": "MảnhMới Lỏng Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "Giới hạn tìm kiếm MảnhMới Lỏng cho các mức Y lớn hơn 0", "setting.world_map.old_chunks_highlighting": "Nổi Bật OldChunks", "setting.world_map.old_chunks_highlighting.tooltip": "Nổi bật OldChunks trên Minimap và WorldMap. Một OldChunk là chunk được tạo ra trong 1.12.2 hoặc thấp hơn dựa trên các khối có mặt trong chunk. Dành cho 2b2t", "setting.world_map.old_chunks_inverse": "Đảo Ngược OldChunks", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json index 05e8a248..d24999d8 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "通过检查是否存在流动的液体来突出显示已经加载的块。\n\n请注意会有误报。多个生物群落和像堡垒和玄武岩三角洲这样的结构可以伴随流动的液体生成。", "setting.world_map.new_chunks_inverse_color": "液体 NewChunks反向颜色", "setting.world_map.new_chunks_inverse_color.tooltip": "更改液体 NewChunks反向突显的颜色", + "setting.world_map.new_chunks_only_above_y0": "液体新区块 Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "将液体新区块的搜索限制为 Y 大于 0 的级别", "setting.world_map.old_chunks_highlighting": "OldChunks 突出显示", "setting.world_map.old_chunks_highlighting.tooltip": "在小地图和世界地图上突出显示 OldChunks。 OldChunk 是在 1.12.2 或更低版本中根据块中存在的块生成的块。 旨在用于 2b2t", "setting.world_map.old_chunks_inverse": "OldChunks 逆", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json index 589d584f..a104cdce 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json @@ -63,6 +63,8 @@ "setting.world_map.new_chunks_inverse_enabled.tooltip": "透過檢查是否存在任何流動的液體來高亮顯示已載入的區塊。\n\n請記住,會出現誤報。多個生態域和堡壘和玄武岩三角洲等結構可以在生成時帶有流動的液體。", "setting.world_map.new_chunks_inverse_color": "液體新區塊反轉顏色", "setting.world_map.new_chunks_inverse_color.tooltip": "更改液體新區塊反轉高亮的顏色", + "setting.world_map.new_chunks_only_above_y0": "液體新區塊 Y>0", + "setting.world_map.new_chunks_only_above_y0.tooltip": "將液體新區塊的搜索限制為 Y 大於 0 的級別", "setting.world_map.old_chunks_highlighting": "舊區塊高亮", "setting.world_map.old_chunks_highlighting.tooltip": "在小地圖和世界地圖上高亮顯示舊區塊。舊區塊是根據區塊中存在的方塊在 1.12.2 或更低版本中生成的區塊。旨在用於 2b2t。", "setting.world_map.old_chunks_inverse": "舊區塊反轉", From 1ce7d927539a2463626f1a914f952e310a6cb1ef Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:59:57 -0700 Subject: [PATCH 2/5] adjust highlights setting order --- .../settings/XaeroPlusSettingRegistry.java | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java index 7f1508de..c42fcc79 100644 --- a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java +++ b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java @@ -237,57 +237,6 @@ public String getTranslationKey() { false, (b) -> ModuleManager.getModule(PaletteNewChunks.class).setInverse(b), SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusBooleanSetting liquidNewChunksEnabledSetting = XaeroPlusBooleanSetting.create( - "NewChunks Highlighting", - "setting.world_map.new_chunks_highlighting", - "setting.world_map.new_chunks_highlighting.tooltip", - false, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setEnabled(b), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusBooleanSetting liquidNewChunksSaveLoadToDisk = XaeroPlusBooleanSetting.create( - "Save/Load NewChunks to Disk", - "setting.world_map.new_chunks_save_load_to_disk", - "setting.world_map.new_chunks_save_load_to_disk.tooltip", - true, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setDiskCache(b), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusFloatSetting liquidNewChunksAlphaSetting = XaeroPlusFloatSetting.create( - "New Chunks Opacity", - "setting.world_map.new_chunks_opacity", - "setting.world_map.new_chunks_opacity.tooltip", - 0f, 255f, 10f, - 100, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setAlpha(b), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusEnumSetting liquidNewChunksColorSetting = XaeroPlusEnumSetting.create( - "New Chunks Color", - "setting.world_map.new_chunks_color", - "setting.world_map.new_chunks_color.tooltip", - ColorHelper.HighlightColor.values(), - ColorHelper.HighlightColor.RED, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setRgbColor(b.getColor()), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusBooleanSetting liquidNewChunksInverseHighlightsSetting = XaeroPlusBooleanSetting.create( - "New Chunks Render Inverse", - "setting.world_map.new_chunks_inverse_enabled", - "setting.world_map.new_chunks_inverse_enabled.tooltip", - false, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setInverseRenderEnabled(b), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusEnumSetting liquidNewChunksInverseColorSetting = XaeroPlusEnumSetting.create( - "New Chunks Inverse Color", - "setting.world_map.new_chunks_inverse_color", - "setting.world_map.new_chunks_inverse_color.tooltip", - ColorHelper.HighlightColor.values(), - ColorHelper.HighlightColor.GREEN, - (b) -> ModuleManager.getModule(LiquidNewChunks.class).setInverseRgbColor(b.getColor()), - SettingLocation.CHUNK_HIGHLIGHTS); - public static final XaeroPlusBooleanSetting liquidNewChunksOnlyAboveY0Setting = XaeroPlusBooleanSetting.create( - "Liquid NewChunks Only Y > 0", - "setting.world_map.new_chunks_only_above_y0", - "setting.world_map.new_chunks_only_above_y0.tooltip", - false, - SettingLocation.CHUNK_HIGHLIGHTS); public static final XaeroPlusBooleanSetting oldChunksEnabledSetting = XaeroPlusBooleanSetting.create( "OldChunks Highlighting", "setting.world_map.old_chunks_highlighting", @@ -355,6 +304,57 @@ public String getTranslationKey() { ColorHelper.HighlightColor.MAGENTA, (b) -> ModuleManager.getModule(Portals.class).setRgbColor(b.getColor()), SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusBooleanSetting liquidNewChunksEnabledSetting = XaeroPlusBooleanSetting.create( + "NewChunks Highlighting", + "setting.world_map.new_chunks_highlighting", + "setting.world_map.new_chunks_highlighting.tooltip", + false, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setEnabled(b), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusBooleanSetting liquidNewChunksSaveLoadToDisk = XaeroPlusBooleanSetting.create( + "Save/Load NewChunks to Disk", + "setting.world_map.new_chunks_save_load_to_disk", + "setting.world_map.new_chunks_save_load_to_disk.tooltip", + true, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setDiskCache(b), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusFloatSetting liquidNewChunksAlphaSetting = XaeroPlusFloatSetting.create( + "New Chunks Opacity", + "setting.world_map.new_chunks_opacity", + "setting.world_map.new_chunks_opacity.tooltip", + 0f, 255f, 10f, + 100, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setAlpha(b), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusEnumSetting liquidNewChunksColorSetting = XaeroPlusEnumSetting.create( + "New Chunks Color", + "setting.world_map.new_chunks_color", + "setting.world_map.new_chunks_color.tooltip", + ColorHelper.HighlightColor.values(), + ColorHelper.HighlightColor.RED, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setRgbColor(b.getColor()), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusBooleanSetting liquidNewChunksInverseHighlightsSetting = XaeroPlusBooleanSetting.create( + "New Chunks Render Inverse", + "setting.world_map.new_chunks_inverse_enabled", + "setting.world_map.new_chunks_inverse_enabled.tooltip", + false, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setInverseRenderEnabled(b), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusEnumSetting liquidNewChunksInverseColorSetting = XaeroPlusEnumSetting.create( + "New Chunks Inverse Color", + "setting.world_map.new_chunks_inverse_color", + "setting.world_map.new_chunks_inverse_color.tooltip", + ColorHelper.HighlightColor.values(), + ColorHelper.HighlightColor.GREEN, + (b) -> ModuleManager.getModule(LiquidNewChunks.class).setInverseRgbColor(b.getColor()), + SettingLocation.CHUNK_HIGHLIGHTS); + public static final XaeroPlusBooleanSetting liquidNewChunksOnlyAboveY0Setting = XaeroPlusBooleanSetting.create( + "Liquid NewChunks Only Y > 0", + "setting.world_map.new_chunks_only_above_y0", + "setting.world_map.new_chunks_only_above_y0.tooltip", + false, + SettingLocation.CHUNK_HIGHLIGHTS); public static final XaeroPlusBooleanSetting worldToolsEnabledSetting = XaeroPlusBooleanSetting.create( "WorldTools Highlights", "setting.world_map.world_tools", From 62cf2a4ab8118f9cfa8a75f6b288b72f41b60d7e Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:32:11 -0700 Subject: [PATCH 3/5] setting to disable sodium/embeddium settings integration --- .../java/xaeroplus/settings/XaeroPlusSettingRegistry.java | 6 ++++++ common/src/main/resources/assets/xaeroplus/lang/en_us.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/es_ar.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/fr_ca.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/fr_fr.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/ja_jp.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/pl_pl.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/pt_pt.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/ru_ru.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/vi_vn.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/zh_cn.json | 2 ++ common/src/main/resources/assets/xaeroplus/lang/zh_tw.json | 2 ++ fabric/build.gradle.kts | 2 +- .../fabric/mixin/client/MixinSodium6OptionsGUI.java | 1 + .../fabric/mixin/client/MixinSodiumOptionsGUI.java | 1 + .../java/xaeroplus/forge/XaeroPlusEmbeddiumOptionsInit.java | 1 + .../forge/mixin/client/MixinSodium6OptionsGUI.java | 1 + 17 files changed, 33 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java index c42fcc79..3f8f52c5 100644 --- a/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java +++ b/common/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java @@ -655,4 +655,10 @@ public String getTranslationKey() { "setting.world_map.expanded_settings.tooltip", false, SettingLocation.WORLD_MAP_MAIN); + public static final XaeroPlusBooleanSetting sodiumSettingIntegration = XaeroPlusBooleanSetting.create( + "Sodium/Embeddium Setting Integration", + "setting.xaeroplus.sodium_embeddium_integration", + "setting.xaeroplus.sodium_embeddium_integration.tooltip", + true, + SettingLocation.WORLD_MAP_MAIN); } diff --git a/common/src/main/resources/assets/xaeroplus/lang/en_us.json b/common/src/main/resources/assets/xaeroplus/lang/en_us.json index d7926e64..505a81a0 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/en_us.json +++ b/common/src/main/resources/assets/xaeroplus/lang/en_us.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Disables WorldMap and Minimap mods from using the internet to check for updates and patreon subscriptions at launch.\n Xaero mods do not expose this setting in the GUI normally.\n XaeroPlus does not use the internet regardless of this setting.", "setting.world_map.expanded_settings": "Expanded Settings", "setting.world_map.expanded_settings.tooltip": "Increases the number of settings shown per page on larger screens", + "setting.xaeroplus.sodium_embeddium_integration": "Sodium/Embeddium Settings Integration", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Enables the XaeroPlus settings page in Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Toggle Follow Mode", "gui.xaeroplus.on": "On", "gui.xaeroplus.off": "Off", diff --git a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json index 446b4a03..2789cea4 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json +++ b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Desactiva el uso de Internet de las modificaciones de WorldMap y Minimap para buscar actualizaciones y suscripciones a Patreon en el momento del lanzamiento.\n Los mods de Xaero normalmente no exponen esta configuración en la GUI.\n XaeroPlus no utiliza Internet independientemente de esta configuración.", "setting.world_map.expanded_settings": "Configuración ampliada", "setting.world_map.expanded_settings.tooltip": "Aumenta la cantidad de configuraciones que se muestran por página en pantallas más grandes", + "setting.xaeroplus.sodium_embeddium_integration": "Integración de Configuración de Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Habilita la página de configuración de XaeroPlus en Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Alternar Modo Seguimiento", "gui.xaeroplus.on": "Encendido", "gui.xaeroplus.off": "Apagado", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json index 8c1a8f79..12000d68 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Empêche les mods WorldMap et Minimap d'utiliser Internet pour vérifier les mises à jour et les abonnements Patreon au lancement.\n Les mods Xaero n'exposent pas normalement ce paramètre dans l'interface graphique.\n XaeroPlus n'utilise pas Internet quel que soit ce paramètre.", "setting.world_map.expanded_settings": "Paramètres étendus", "setting.world_map.expanded_settings.tooltip": "Augmente le nombre de paramètres affichés par page sur des écrans plus grands", + "setting.xaeroplus.sodium_embeddium_integration": "Intégration des Paramètres Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Active la page de paramètres XaeroPlus dans Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Basculer le mode suivi", "gui.xaeroplus.on": "On", "gui.xaeroplus.off": "Off", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json index 8c1a8f79..12000d68 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Empêche les mods WorldMap et Minimap d'utiliser Internet pour vérifier les mises à jour et les abonnements Patreon au lancement.\n Les mods Xaero n'exposent pas normalement ce paramètre dans l'interface graphique.\n XaeroPlus n'utilise pas Internet quel que soit ce paramètre.", "setting.world_map.expanded_settings": "Paramètres étendus", "setting.world_map.expanded_settings.tooltip": "Augmente le nombre de paramètres affichés par page sur des écrans plus grands", + "setting.xaeroplus.sodium_embeddium_integration": "Intégration des Paramètres Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Active la page de paramètres XaeroPlus dans Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Basculer le mode suivi", "gui.xaeroplus.on": "On", "gui.xaeroplus.off": "Off", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json index 1a1777a2..08892591 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json @@ -168,6 +168,8 @@ "setting.world_map.disable_internet.tooltip": "WorldMapとMinimapのMODが起動時にインターネットを使用してアップデートとパトロン購読をチェックするのを無効にします。\nXaeroのMODは通常GUIでこの設定を公開しません。\nXaeroPlusはこの設定に関係なくインターネットを使用しません。", "setting.world_map.expanded_settings": "拡張設定", "setting.world_map.expanded_settings.tooltip": "大きな画面では、ページごとに表示される設定の数が増加します", + "setting.xaeroplus.sodium_embeddium_integration": "Sodium/Embeddium 設定の統合", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Sodium/Embeddium で XaeroPlus の設定ページを有効にする", "gui.world_map.toggle_follow_mode": "フォローモードの切り替え", "gui.xaeroplus.on": "On", "gui.xaeroplus.off": "Off", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json index ca3c4de8..853a3c99 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Wyłącza modom WorldMap i Minimap korzystanie z Internetu w celu sprawdzania dostępności aktualizacji i subskrypcji Patreona przy uruchomieniu.\n Mody Xaero normalnie nie udostępniają tego ustawienia w GUI.\n XaeroPlus nie korzysta z Internetu niezależnie od tego ustawienia.", "setting.world_map.expanded_settings": "Rozszerzone ustawienia", "setting.world_map.expanded_settings.tooltip": "Zwiększa liczbę ustawień wyświetlanych na stronie na większych ekranach", + "setting.xaeroplus.sodium_embeddium_integration": "Integracja Ustawień Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Włącza stronę ustawień XaeroPlus w Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Przełącz Tryb Podążąnia", "gui.xaeroplus.on": "Włączony", "gui.xaeroplus.off": "Wyłączony", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json index ee5ca00c..4168de77 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Desativa o acesso à Internet para verificação de atualizações ou subscrição do Patreon dos mods do mapa-mundo e mini-mapa. \n Normalmente os mods Xaero não mostram esta configuração no GUI. \n O XaeroPlus não usa a Internet independentemente desta definição.", "setting.world_map.expanded_settings": "Configurações expandidas", "setting.world_map.expanded_settings.tooltip": "Aumenta o número de configurações mostradas por página em telas maiores", + "setting.xaeroplus.sodium_embeddium_integration": "Integração de Configurações Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Ativa a página de configurações XaeroPlus no Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Alternar Modo Seguir", "gui.xaeroplus.on": "Lig.", "gui.xaeroplus.off": "Deslig.", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json index 321da523..da6ba5b4 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Отключает модам WorldMap и Minimap использование Интернета для проверки обновлений и подписок на Patreon при запуске.\n Моды Xaero обычно не отображают этот параметр в графическом интерфейсе.\n XaeroPlus не использует Интернет независимо от этой настройки.", "setting.world_map.expanded_settings": "Расширенные настройки", "setting.world_map.expanded_settings.tooltip": "Увеличивает количество настроек, отображаемых на странице на больших экранах.", + "setting.xaeroplus.sodium_embeddium_integration": "Интеграция Настроек Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Включает страницу настроек XaeroPlus в Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Переключить Режим Следования", "gui.xaeroplus.on": "Вкл", "gui.xaeroplus.off": "Выкл", diff --git a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json index a789112a..048d24ee 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "Vô hiệu hóa các mod WorldMap và Minimap từ việc sử dụng internet để kiểm tra cập nhật và đăng ký patreon khi khởi động.\n Các mod Xaero không hiển thị cài đặt này trong giao diện người dùng bình thường.\n XaeroPlus không sử dụng internet bất kể cài đặt này.", "setting.world_map.expanded_settings": "Cài đặt mở rộng", "setting.world_map.expanded_settings.tooltip": "Tăng số lượng cài đặt hiển thị trên mỗi trang trên màn hình lớn hơn", + "setting.xaeroplus.sodium_embeddium_integration": "Tích hợp Cài đặt Sodium/Embeddium", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "Kích hoạt trang cài đặt XaeroPlus trong Sodium/Embeddium", "gui.world_map.toggle_follow_mode": "Chuyển Chế Độ Theo Dõi", "gui.xaeroplus.on": "Bật", "gui.xaeroplus.off": "Tắt", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json index d24999d8..8789d7fc 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "禁止 WorldMap 和 Minimap mods 在启动时使用互联网检查更新和 patreon 订阅。\n Xaero mods 通常不会在 GUI 中公开此设置。\n 无论此设置如何,XaeroPlus 都不会使用互联网。", "setting.world_map.expanded_settings": "扩展设置", "setting.world_map.expanded_settings.tooltip": "增加大屏幕上每页显示的设置数量", + "setting.xaeroplus.sodium_embeddium_integration": "Sodium/Embeddium 设置集成", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "启用 Sodium/Embeddium 中的 XaeroPlus 设置页面", "gui.world_map.toggle_follow_mode": "切换跟随模式", "gui.xaeroplus.on": "开启", "gui.xaeroplus.off": "关闭", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json index a104cdce..fa5ed430 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json @@ -170,6 +170,8 @@ "setting.world_map.disable_internet.tooltip": "停用世界地圖和小地圖模組在啟動時使用網際網路檢查更新和 Patreon 訂閱。\n Xaero 模組通常不會在介面中公開此設定。\n 無論此設定如何,XaeroPlus 都不会使用網際網路。", "setting.world_map.expanded_settings": "擴展設定", "setting.world_map.expanded_settings.tooltip": "在較大的螢幕上增加每頁顯示的設定數量", + "setting.xaeroplus.sodium_embeddium_integration": "Sodium/Embeddium 設定集成", + "setting.xaeroplus.sodium_embeddium_integration.tooltip": "啟用 Sodium/Embeddium 中的 XaeroPlus 設定頁面", "gui.world_map.toggle_follow_mode": "切換追蹤模式", "gui.xaeroplus.on": "開啟", "gui.xaeroplus.off": "關閉", diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index 0402f9e3..2ceb7ebb 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -47,7 +47,7 @@ dependencies { modCompileOnly(libs.fabric.waystones) modRuntimeOnly(libs.immediatelyfast) modImplementation(libs.modmenu) - modCompileOnly(libs.sodium) + modImplementation(libs.sodium) modRuntimeOnly(libs.fpsdisplay) modRuntimeOnly(libs.cloth.config.fabric) { exclude(group = "net.fabricmc.fabric-api") diff --git a/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodium6OptionsGUI.java b/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodium6OptionsGUI.java index 42226dfe..0adfbdf8 100644 --- a/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodium6OptionsGUI.java +++ b/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodium6OptionsGUI.java @@ -35,6 +35,7 @@ public class MixinSodium6OptionsGUI { value = "RETURN" )) public void injectXPSettings(final Screen prevScreen, final CallbackInfo ci) { + if (!XaeroPlusSettingRegistry.sodiumSettingIntegration.getValue()) return; pages.add(new OptionPage(Component.literal("XaeroPlus"), ImmutableList.of( OptionGroup.createBuilder() .add(OptionImpl.createBuilder(Boolean.TYPE, XaeroPlusSodium6OptionStorage.INSTANCE) diff --git a/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodiumOptionsGUI.java b/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodiumOptionsGUI.java index 6cae7f98..464d4453 100644 --- a/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodiumOptionsGUI.java +++ b/fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinSodiumOptionsGUI.java @@ -35,6 +35,7 @@ public class MixinSodiumOptionsGUI { value = "RETURN" )) public void injectXPSettings(final Screen prevScreen, final CallbackInfo ci) { + if (!XaeroPlusSettingRegistry.sodiumSettingIntegration.getValue()) return; pages.add(new OptionPage(Component.literal("XaeroPlus"), ImmutableList.of( OptionGroup.createBuilder() .add(OptionImpl.createBuilder(Boolean.TYPE, XaeroPlusSodiumOptionStorage.INSTANCE) diff --git a/forge/src/main/java/xaeroplus/forge/XaeroPlusEmbeddiumOptionsInit.java b/forge/src/main/java/xaeroplus/forge/XaeroPlusEmbeddiumOptionsInit.java index 80afc7c5..023bf1af 100644 --- a/forge/src/main/java/xaeroplus/forge/XaeroPlusEmbeddiumOptionsInit.java +++ b/forge/src/main/java/xaeroplus/forge/XaeroPlusEmbeddiumOptionsInit.java @@ -15,6 +15,7 @@ public class XaeroPlusEmbeddiumOptionsInit { public static void onEmbeddiumOptionGUIConstructionEvent(OptionGUIConstructionEvent event) { + if (!XaeroPlusSettingRegistry.sodiumSettingIntegration.getValue()) return; event.addPage(new OptionPage(OptionIdentifier.create("xaeroplus", "options"), Component.literal("XaeroPlus"), ImmutableList.of( OptionGroup.createBuilder() .add(OptionImpl.createBuilder(Boolean.TYPE, XaeroPlusEmbeddiumOptionStorage.INSTANCE) diff --git a/forge/src/main/java/xaeroplus/forge/mixin/client/MixinSodium6OptionsGUI.java b/forge/src/main/java/xaeroplus/forge/mixin/client/MixinSodium6OptionsGUI.java index 3b5db31c..b5d3452d 100644 --- a/forge/src/main/java/xaeroplus/forge/mixin/client/MixinSodium6OptionsGUI.java +++ b/forge/src/main/java/xaeroplus/forge/mixin/client/MixinSodium6OptionsGUI.java @@ -35,6 +35,7 @@ public class MixinSodium6OptionsGUI { value = "RETURN" )) public void injectXPSettings(final Screen prevScreen, final CallbackInfo ci) { + if (!XaeroPlusSettingRegistry.sodiumSettingIntegration.getValue()) return; pages.add(new OptionPage(Component.literal("XaeroPlus"), ImmutableList.of( OptionGroup.createBuilder() .add(OptionImpl.createBuilder(Boolean.TYPE, XaeroPlusSodium6OptionStorage.INSTANCE) From 86c4c3915c4b8205223717bfb341cfbadf38f69b Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:52:35 -0700 Subject: [PATCH 4/5] minor opts --- .../event/ClientPlaySessionFinalizedEvent.java | 2 +- .../main/java/xaeroplus/event/ClientTickEvent.java | 4 ++-- .../mixin/client/MixinGuiWaypointsList.java | 13 +++++++------ common/src/main/resources/xaeroplus.mixins.json | 1 + .../src/main/resources/xaeroplus-fabric.mixins.json | 1 + .../src/main/resources/xaeroplus-forge.mixins.json | 1 + 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/xaeroplus/event/ClientPlaySessionFinalizedEvent.java b/common/src/main/java/xaeroplus/event/ClientPlaySessionFinalizedEvent.java index b30b982f..537c9751 100644 --- a/common/src/main/java/xaeroplus/event/ClientPlaySessionFinalizedEvent.java +++ b/common/src/main/java/xaeroplus/event/ClientPlaySessionFinalizedEvent.java @@ -1,5 +1,5 @@ package xaeroplus.event; public record ClientPlaySessionFinalizedEvent() { - public static ClientPlaySessionFinalizedEvent INSTANCE = new ClientPlaySessionFinalizedEvent(); + public static final ClientPlaySessionFinalizedEvent INSTANCE = new ClientPlaySessionFinalizedEvent(); } diff --git a/common/src/main/java/xaeroplus/event/ClientTickEvent.java b/common/src/main/java/xaeroplus/event/ClientTickEvent.java index 39f9667f..d2282b3c 100644 --- a/common/src/main/java/xaeroplus/event/ClientTickEvent.java +++ b/common/src/main/java/xaeroplus/event/ClientTickEvent.java @@ -2,10 +2,10 @@ public class ClientTickEvent { public static class Pre extends ClientTickEvent { - public static Pre INSTANCE = new Pre(); + public static final Pre INSTANCE = new Pre(); } public static class Post extends ClientTickEvent { - public static Post INSTANCE = new Post(); + public static final Post INSTANCE = new Post(); } } diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinGuiWaypointsList.java b/common/src/main/java/xaeroplus/mixin/client/MixinGuiWaypointsList.java index 6c837653..bc63afd9 100644 --- a/common/src/main/java/xaeroplus/mixin/client/MixinGuiWaypointsList.java +++ b/common/src/main/java/xaeroplus/mixin/client/MixinGuiWaypointsList.java @@ -7,6 +7,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.entity.Entity; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; @@ -22,7 +23,8 @@ @Mixin(targets = "xaero.common.gui.GuiWaypoints$List", remap = false) public abstract class MixinGuiWaypointsList { - private GuiWaypoints thisGuiWaypoints; + @Unique private final WaypointSet waypointsSortedSet = WaypointSet.Builder.begin().setName("xp-wp-sorted").build(); + @Unique private GuiWaypoints thisGuiWaypoints; @Inject(method = "", at = @At("RETURN")) public void init(final GuiWaypoints this$0, final CallbackInfo ci) throws NoSuchFieldException, IllegalAccessException { @@ -48,11 +50,10 @@ public void getWaypointCount(final CallbackInfoReturnable cir) { target = "Lxaero/hud/minimap/world/MinimapWorld;getCurrentWaypointSet()Lxaero/hud/minimap/waypoint/set/WaypointSet;" )) public WaypointSet getWaypointList(final MinimapWorld instance) { - // todo: could be optimized to reduce unnecessary list allocs - WaypointSet currentWaypointSet = instance.getCurrentWaypointSet(); - var wpSet = WaypointSet.Builder.begin().setName(currentWaypointSet.getName()).build(); - wpSet.addAll(((AccessorGuiWaypoints) thisGuiWaypoints).getWaypointsSorted()); - return wpSet; + // reusing waypoint set to avoid allocating an arraylist every call to this method + waypointsSortedSet.clear(); + waypointsSortedSet.addAll(((AccessorGuiWaypoints) thisGuiWaypoints).getWaypointsSorted()); + return waypointsSortedSet; } @Inject(method = "drawWaypointSlot", at = @At( diff --git a/common/src/main/resources/xaeroplus.mixins.json b/common/src/main/resources/xaeroplus.mixins.json index 80b0a222..33e69a21 100644 --- a/common/src/main/resources/xaeroplus.mixins.json +++ b/common/src/main/resources/xaeroplus.mixins.json @@ -2,6 +2,7 @@ "required": true, "package": "xaeroplus.mixin.client", "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", "injectors": { "defaultRequire": 1 }, diff --git a/fabric/src/main/resources/xaeroplus-fabric.mixins.json b/fabric/src/main/resources/xaeroplus-fabric.mixins.json index 01f25f4d..9b0ae5e4 100644 --- a/fabric/src/main/resources/xaeroplus-fabric.mixins.json +++ b/fabric/src/main/resources/xaeroplus-fabric.mixins.json @@ -2,6 +2,7 @@ "required": true, "package": "xaeroplus.fabric.mixin.client", "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", "injectors": { "defaultRequire": 1 }, diff --git a/forge/src/main/resources/xaeroplus-forge.mixins.json b/forge/src/main/resources/xaeroplus-forge.mixins.json index 9777c075..65d57093 100644 --- a/forge/src/main/resources/xaeroplus-forge.mixins.json +++ b/forge/src/main/resources/xaeroplus-forge.mixins.json @@ -2,6 +2,7 @@ "required": true, "package": "xaeroplus.forge.mixin.client", "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", "injectors": { "defaultRequire": 1 }, From 2dcd5191b5574b4d50b90861546b3771847532c4 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:15:47 -0700 Subject: [PATCH 5/5] gradle 8.10.1 --- .gitattributes | 16 ++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..2d58d5ca --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +# Auto detect text files and perform LF normalization +*.java text=auto eol=lf +*.xml text=auto eol=lf +*.json text=auto eol=lf +*.md text=auto eol=lf +*.yml text=auto eol=lf +*.template text=auto eol=lf +*.txt text=auto eol=lf +*.bat text=auto eol=lf +*.gradle text=auto eol=lf +*.sh text=auto eol=lf +*.html text=auto eol=lf +*.settings text=auto eol=lf +Jenkinsfile text=auto eol=lf +gradlew test=auto eol=lf +*.py text=auto eol=lf diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b415..0aaefbca 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME