port: The Copper Age (1.21.9/10)

This commit is contained in:
Martin Prokoph
2025-10-08 21:49:08 +02:00
parent 7b4ecdc4e9
commit ff60cf4873
20 changed files with 50 additions and 87 deletions

View File

@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.11-SNAPSHOT" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
}

View File

@@ -10,9 +10,9 @@ public class CullLeavesConfig extends MidnightConfig {
public static boolean cullRoots = true;
@Override
public void writeChanges(String modid) {
public void writeChanges() {
var client = MinecraftClient.getInstance();
if (client.world != null) client.worldRenderer.reload();
super.writeChanges(modid);
if (client != null && client.world != null) client.worldRenderer.reload();
super.writeChanges();
}
}

View File

@@ -1,9 +1,7 @@
{
"cullleaves.midnightconfig.title":"Cull Leaves Konfiguration",
"cullleaves.midnightconfig.enabled.tooltip":"Aktiviert Culling bei Blättern, was zu besserer Performance führt.\n§cNach dem Ändern dieser Option müssen alle Chunks neugeladen werden (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"Aktiviert Culling bei Blättern, was zu besserer Performance führt.",
"cullleaves.midnightconfig.enabled.tooltip":"Aktiviert Culling bei Blättern, was zu besserer Performance führt",
"cullleaves.midnightconfig.enabled":"Aktiviere Culling von Blättern",
"cullleaves.midnightconfig.cullRoots.tooltip":"Aktiviert Culling von Mangrovenwurzeln.\n§cNach dem Ändern dieser Option müssen alle Chunks neugeladen werden (F3 + A)",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium":"Aktiviert Culling von Mangrovenwurzeln.",
"cullleaves.midnightconfig.cullRoots.tooltip":"Aktiviert Culling von Mangrovenwurzeln",
"cullleaves.midnightconfig.cullRoots":"Culling von Mangrovenwurzeln"
}

View File

@@ -1,9 +1,7 @@
{
"cullleaves.midnightconfig.title":"Cull Leaves Config",
"cullleaves.midnightconfig.enabled.tooltip":"Enables culling for leaves, providing a nice performance boost.\n§cAfter changing this setting you have to reload all chunks (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"Enables culling for leaves, providing a nice performance boost",
"cullleaves.midnightconfig.enabled.tooltip":"Enables culling for leaves, providing a nice performance boost",
"cullleaves.midnightconfig.enabled":"Enable Leaf Culling",
"cullleaves.midnightconfig.cullRoots.tooltip":"Enables culling for mangrove roots.\n§cAfter changing this setting you have to reload all chunks (F3 + A)",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium":"Enables culling for mangrove roots.",
"cullleaves.midnightconfig.cullRoots.tooltip":"Enables culling for mangrove roots",
"cullleaves.midnightconfig.cullRoots":"Enable Mangrove Root Culling"
}

View File

@@ -1,9 +1,7 @@
{
"cullleaves.midnightconfig.title": "Konfigurasi Cull Leaves",
"cullleaves.midnightconfig.enabled.tooltip": "Mendayakan penyorokan daun yang memberikan peningkatan prestasi yang bagus\n§cSelepas menukar tetapan ini, anda perlu memuat semula semua cebisan (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium": "Mendayakan penyorokan daun yang memberikan peningkatan prestasi yang bagus",
"cullleaves.midnightconfig.enabled.tooltip": "Mendayakan penyorokan daun yang memberikan peningkatan prestasi yang bagus",
"cullleaves.midnightconfig.enabled": "Dayakan Penyorokan Daun",
"cullleaves.midnightconfig.cullRoots.tooltip": "Mendayakan penyorokan akar bakau.\n§cSelepas menukar tetapan ini, anda perlu memuat semula semua cebisan (F3 + A)",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium": "Mendayakan penyorokan akar bakau.",
"cullleaves.midnightconfig.cullRoots.tooltip": "Mendayakan penyorokan akar bakau.",
"cullleaves.midnightconfig.cullRoots": "Dayakan Penyorokan Akar Bakau"
}

View File

@@ -1,10 +1,8 @@
{
"cullleaves.midnightconfig.title": "Настройки отбраковки листьев",
"cullleaves.midnightconfig.enabled.tooltip": "Включает отбраковку листьев, что значительно повышает производительность.\n§cПосле изменения этого параметра вам необходимо перезагрузить все чанки (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium": "Включает отбраковку листьев, что значительно повышает производительность",
"cullleaves.midnightconfig.enabled.tooltip": "Включает отбраковку листьев, что значительно повышает производительность",
"cullleaves.midnightconfig.enabled": "Включить отбраковку листьев",
"cullleaves.midnightconfig.cullRoots.tooltip": "Включает отбраковку мангровых корней.\n§cПосле изменения этого параметра вам необходимо перезагрузить все чанки (F3 + A)",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium": "Включает отбраковку мангровых корней.",
"cullleaves.midnightconfig.cullRoots.tooltip": "Включает отбраковку мангровых корней.",
"cullleaves.midnightconfig.cullRoots": "Включить отбраковку мангровых корней",
"cullleaves.resourcepack.name": "§2Делает листья идентичными 'умным листьям' в OptiFine"
"cullleaves.resourcepack.translation": "§2Делает листья идентичными 'умным листьям' в OptiFine"
}

View File

@@ -1,8 +1,5 @@
{
"cullleaves.midnightconfig.title":"Конфігурація Cull Leaves",
"cullleaves.midnightconfig.enabled.tooltip":"Вмикає вибраковування листя, забезпечуючи хороше підвищення продуктивності.\n§cПісля зміни цього параметра ви повинні перезавантажити всі чанки (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"Вмикає вибраковування листя, забезпечуючи хороше підвищення продуктивності",
"cullleaves.midnightconfig.enabled":"Увімкнути вибраковування листя",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix.tooltip": "Виправляє пакети ресурсів, які використовують мерехтіння вибраковування листя при використанні Sodium.\nЙмовірно, ви хочете, щоб це було ввімкнено.",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix": "Виправити для мода Sodium вибраковування сторін блоку для листя"
"cullleaves.midnightconfig.enabled.tooltip":"Вмикає вибраковування листя, забезпечуючи хороше підвищення продуктивності",
"cullleaves.midnightconfig.enabled":"Увімкнути вибраковування листя"
}

View File

@@ -1,8 +1,5 @@
{
"cullleaves.midnightconfig.title":"Cấu hình Cull Leaves",
"cullleaves.midnightconfig.enabled.tooltip":"Cho phép loại bỏ các lá, giúp tăng hiệu suất tốt.\n§cSau khi thay đổi cài đặt này, bạn phải tải lại tất cả các chunk (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"Cho phép loại bỏ lá, giúp tăng hiệu suất tốt",
"cullleaves.midnightconfig.enabled":"Kích hoạt loại bỏ lá",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix.tooltip": "Sửa các gói tài nguyên sử dụng loại bỏ lá nhấp nháy khi sử dụng Sodium.\nBạn có thể muốn kích hoạt tính năng này.",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix": "Khắc phục hiện tượng loại bỏ mặt khối của Sodium trên lá"
"cullleaves.midnightconfig.enabled.tooltip":"Cho phép loại bỏ lá, giúp tăng hiệu suất tốt",
"cullleaves.midnightconfig.enabled":"Kích hoạt loại bỏ lá"
}

View File

@@ -1,9 +1,7 @@
{
"cullleaves.midnightconfig.title":"Cull Leaves 选项",
"cullleaves.midnightconfig.enabled.tooltip":"剔除树叶,提升性能\n§c更改此选项后须要重新加载全部区块F3 + A",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"剔除树叶,提升性能",
"cullleaves.midnightconfig.enabled.tooltip":"剔除树叶,提升性能",
"cullleaves.midnightconfig.enabled":"启用树叶剔除",
"cullleaves.midnightconfig.cullRoots.tooltip":"启用红树根剔除\n§c更改此选项后须要重新加载全部区块F3 + A",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium":"启用红树根剔除",
"cullleaves.midnightconfig.cullRoots.tooltip":"启用红树根剔除",
"cullleaves.midnightconfig.cullRoots":"启用红树根剔除"
}

View File

@@ -1,8 +1,5 @@
{
"cullleaves.midnightconfig.title":"Cull Leaves 設定",
"cullleaves.midnightconfig.enabled.tooltip":"在樹葉上啟用剃除,獲得良好的效能提升。\n§c更改此設定後您需要重新載入所有區塊F3 + A",
"cullleaves.midnightconfig.enabled.tooltip.sodium":"啟用樹葉剔除,獲得良好的效能提升",
"cullleaves.midnightconfig.enabled":"啟用樹葉剔除",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix.tooltip": "修復使用 Sodium 的資源包在使用葉子剔除時閃爍的問題。\n您可能想要將此功能啟用。",
"cullleaves.midnightconfig.sodiumBlockFaceCullingFix": "修復 Sodium 在葉子上的啟用方塊表面剔除"
"cullleaves.midnightconfig.enabled.tooltip":"啟用樹葉剔除,獲得良好的效能提升",
"cullleaves.midnightconfig.enabled":"啟用樹葉剔除"
}

View File

@@ -1,9 +1,7 @@
{
"cullleaves.midnightconfig.title": "کونفيݢوراسي Cull Leaves",
"cullleaves.midnightconfig.enabled.tooltip": "منداياکن ڤڽوروقن داٴون يڠ ممبريکن ڤنيڠکتن ڤريستاسي يڠ باݢوس\n§cسلڤس منوکر تتڤن اين⹁ اندا ڤرلو مموات سمولا سموا چبيسن (F3 + A)",
"cullleaves.midnightconfig.enabled.tooltip.sodium": "منداياکن ڤڽوروقن داٴون يڠ ممبريکن ڤنيڠکتن ڤريستاسي يڠ باݢوس",
"cullleaves.midnightconfig.enabled.tooltip": "منداياکن ڤڽوروقن داٴون يڠ ممبريکن ڤنيڠکتن ڤريستاسي يڠ باݢوس",
"cullleaves.midnightconfig.enabled": "داياکن ڤڽوروقن داٴون",
"cullleaves.midnightconfig.cullRoots.tooltip": "منداياکن ڤڽوروقن اکر باکاو.\n§cسلڤس منوکر تتڤن اين⹁ اندا ڤرلو مموات سمولا سموا چبيسن (F3 + A)",
"cullleaves.midnightconfig.cullRoots.tooltip.sodium": "منداياکن ڤڽوروقن اکر باکاو.",
"cullleaves.midnightconfig.cullRoots.tooltip": "منداياکن ڤڽوروقن اکر باکاو.",
"cullleaves.midnightconfig.cullRoots": "داياکن ڤڽوروقن اکر باکاو"
}

View File

@@ -1,9 +1,11 @@
{
"pack": {
"pack_format": 15,
"supported_formats": [15, 99],
"supported_formats": [15, 255],
"min_format": 15,
"max_format": 255,
"description": {
"translate": "cullleaves.resourcepack.name",
"translate": "cullleaves.resourcepack.description",
"fallback": "§2Makes leaves look identical to OptiFine's smart leaves"
}
}

View File

@@ -28,7 +28,7 @@ dependencies {
// Remove the next line if you don't want to depend on the API
//modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
modImplementation include ("maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric")
modImplementation "maven.modrinth:sodium:${rootProject.sodium_version}-fabric"
modCompileOnlyApi "maven.modrinth:sodium:${rootProject.sodium_version}-fabric"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }

View File

@@ -7,6 +7,7 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.resource.ResourceManager;
import net.minecraft.resource.ResourceType;
@@ -19,15 +20,6 @@ public class CullLeavesClientFabric implements ClientModInitializer {
FabricLoader.getInstance().getModContainer("cullleaves").ifPresent(modContainer -> {
ResourceManagerHelper.registerBuiltinResourcePack(Identifier.of(CullLeavesClient.MOD_ID,"smartleaves"), modContainer, ResourcePackActivationType.NORMAL);
});
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() {
@Override
public Identifier getFabricId() {
return Identifier.of(CullLeavesClient.MOD_ID, "resourcepack_options");
}
@Override
public void reload(ResourceManager manager) {
CullLeavesClient.ReloadListener.INSTANCE.reload(manager);
}
});
ResourceLoader.get(ResourceType.CLIENT_RESOURCES).registerReloader(Identifier.of(CullLeavesClient.MOD_ID, "resourcepack_options"), CullLeavesClient.ReloadListener.INSTANCE);
}
}

View File

@@ -26,7 +26,7 @@ public class MixinSodiumGameOptionPages {
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
.setName(Text.translatable("cullleaves.midnightconfig.enabled"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.enabled.tooltip.sodium"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.enabled.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> {
CullLeavesConfig.enabled = value;
@@ -37,7 +37,7 @@ public class MixinSodiumGameOptionPages {
.build()
).add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
.setName(Text.translatable("cullleaves.midnightconfig.cullRoots"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.cullRoots.tooltip.sodium"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.cullRoots.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> {
CullLeavesConfig.cullRoots = value;

View File

@@ -1,23 +1,23 @@
org.gradle.jvmargs=-Xmx4096M
minecraft_version=1.21.6
yarn_mappings=1.21.6+build.1
minecraft_version=1.21.9
yarn_mappings=1.21.9+build.1
enabled_platforms=fabric,neoforge
archives_base_name=cullleaves
mod_version=4.0.5
mod_version=4.0.6
maven_group=eu.midnightdust
release_type=release
curseforge_id=423254
modrinth_id=GNxdLCoP
midnightlib_version=1.7.4+1.21.6
sodium_version=mc1.21.6-0.6.13
midnightlib_version=1.8.3+1.21.9
sodium_version=mc1.21.8-0.7.0
fabric_loader_version=0.16.14
fabric_api_version=0.127.0+1.21.6
fabric_loader_version=0.17.2
fabric_api_version=0.134.0+1.21.9
neoforge_version=21.6.0-beta
neoforge_version=21.9.11-beta
yarn_mappings_patch_neoforge_version = 1.21+build.4
quilt_loader_version=0.18.9

View File

@@ -37,7 +37,7 @@ dependencies {
// Remove the next line if you don't want to depend on the API
//modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}"
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-neoforge"
modImplementation "maven.modrinth:sodium:${rootProject.sodium_version}-neoforge"
modCompileOnlyApi "maven.modrinth:sodium:${rootProject.sodium_version}-neoforge"
//include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
common(project(path: ":common", configuration: "namedElements")) { transitive false }

View File

@@ -1,6 +1,7 @@
package eu.midnightdust.cullleaves.neoforge;
import eu.midnightdust.cullleaves.CullLeavesClient;
import net.minecraft.network.packet.PacketType;
import net.minecraft.resource.*;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@@ -10,31 +11,19 @@ import net.neoforged.fml.ModList;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.AddClientReloadListenersEvent;
import net.neoforged.neoforge.event.AddPackFindersEvent;
import net.neoforged.neoforge.resource.ResourcePackLoader;
import net.neoforged.neoforgespi.locating.IModFile;
import java.util.Optional;
@EventBusSubscriber(modid = CullLeavesClient.MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
@EventBusSubscriber(modid = CullLeavesClient.MOD_ID, value = Dist.CLIENT)
public class CullLeavesClientEvents {
@SubscribeEvent
public static void addPackFinders(AddPackFindersEvent event) {
if (event.getPackType() == ResourceType.CLIENT_RESOURCES) {
registerResourcePack(event, Identifier.of(CullLeavesClient.MOD_ID, "smartleaves"), false);
event.addPackFinders(Identifier.of(CullLeavesClient.MOD_ID, "resourcepacks/smartleaves"), ResourceType.CLIENT_RESOURCES, Text.of("cullleaves/smartleaves"), ResourcePackSource.BUILTIN, false, ResourcePackProfile.InsertionPosition.TOP);
}
}
private static void registerResourcePack(AddPackFindersEvent event, Identifier id, boolean alwaysEnabled) {
event.addRepositorySource(((profileAdder) -> {
IModFile file = ModList.get().getModFileById(id.getNamespace()).getFile();
try {
ResourcePackProfile.PackFactory pack = new DirectoryResourcePack.DirectoryBackedFactory(file.findResource("resourcepacks/" + id.getPath()));
ResourcePackInfo info = new ResourcePackInfo(id.toString(), Text.of(id.getNamespace()+"/"+id.getPath()), ResourcePackSource.BUILTIN, Optional.empty());
ResourcePackProfile packProfile = ResourcePackProfile.create(info, pack, ResourceType.CLIENT_RESOURCES, new ResourcePackPosition(alwaysEnabled, ResourcePackProfile.InsertionPosition.TOP, false));
if (packProfile != null) {
profileAdder.accept(packProfile);
}
} catch (NullPointerException e) {e.fillInStackTrace();}
}));
}
@SubscribeEvent
public static void onResourceReload(AddClientReloadListenersEvent event) {
event.addListener(Identifier.of(CullLeavesClient.MOD_ID, "resourcepack_options"), CullLeavesClient.ReloadListener.INSTANCE);

View File

@@ -1,12 +1,13 @@
package eu.midnightdust.cullleaves.neoforge;
import eu.midnightdust.cullleaves.CullLeavesClient;
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
import eu.midnightdust.lib.config.MidnightConfig;
import net.neoforged.fml.common.Mod;
@Mod("cullleaves")
@Mod(CullLeavesClient.MOD_ID)
public class CullLeavesClientForge {
public CullLeavesClientForge() {
MidnightConfig.init("cullleaves", CullLeavesConfig.class);
MidnightConfig.init(CullLeavesClient.MOD_ID, CullLeavesConfig.class);
}
}

View File

@@ -28,7 +28,7 @@ public class MixinSodiumGameOptionPages {
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
.setName(Text.translatable("cullleaves.midnightconfig.enabled"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.enabled.tooltip.sodium"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.enabled.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> {
CullLeavesConfig.enabled = value;
@@ -39,7 +39,7 @@ public class MixinSodiumGameOptionPages {
.build()
).add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
.setName(Text.translatable("cullleaves.midnightconfig.cullRoots"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.cullRoots.tooltip.sodium"))
.setTooltip(Text.translatable("cullleaves.midnightconfig.cullRoots.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> {
CullLeavesConfig.cullRoots = value;