Skip to content

Commit c5dd43f

Browse files
committed
Merge 1.20 into 1.20.4
2 parents 9bf4faa + dd45519 commit c5dd43f

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.embeddedt.modernfix.common.mixin.perf.remove_spawn_chunks;
2+
3+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
4+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
5+
import net.minecraft.util.SortedArraySet;
6+
import org.embeddedt.modernfix.ModernFix;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
10+
@Mixin(SortedArraySet.class)
11+
public class SortedArraySetMixin<T> {
12+
/**
13+
* @author embeddedt
14+
* @reason Make add() not crash with a null key, since some mods (Carpet) assume there will always be a spawn ticket,
15+
* and then assume the reference they have is non-null (it can be null with this option enabled).
16+
*/
17+
@WrapOperation(method = "add", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/SortedArraySet;findIndex(Ljava/lang/Object;)I"), require = 0)
18+
private int checkStatus(SortedArraySet<T> instance, T object, Operation<Integer> original) {
19+
if(object == null) {
20+
ModernFix.LOGGER.error("Attempted to insert a null key into SortedArraySet, ignoring");
21+
return 0;
22+
}
23+
return original.call(instance, object);
24+
}
25+
}

common/src/main/resources/assets/modernfix/lang/en_us.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,16 @@
121121
"modernfix.option.mixin.perf.dynamic_block_codecs": "Avoids storing a codec for every block(state) and instead generates and caches it on the fly when needed. Generally not worth enabling unless you have a million blocks/items.",
122122
"modernfix.option.mixin.perf.faster_command_suggestions": "Mitigate lag when there are hundreds of thousands of suggestions while typing a command",
123123
"modernfix.option.mixin.perf.mojang_registry_size": "Fixes an issue causing registration of blocks/items to slow down proportional to the number already registered. This improves startup time.",
124-
"modernfix.option.mixin.perf.cache_profile_texture_url": "Avoids pointlessly creating a URL object and speeds up skull block rendering."
124+
"modernfix.option.mixin.perf.cache_profile_texture_url": "Avoids pointlessly creating a URL object and speeds up skull block rendering.",
125+
"modernfix.option.mixin.bugfix.entity_pose_stack": "Fixes Forge issue #9118, where mods can cause undebuggable render crashes by pushing the matrix stack without popping it.",
126+
"modernfix.option.mixin.bugfix.file_dialog_title": "Fixes a security issue with the worldgen settings file dialog",
127+
"modernfix.option.mixin.bugfix.forge_vehicle_packets": "Fixes a bug introduced by a Forge patch that causes excessive amounts of chunk data packets to be sent to the player if they are riding a vehicle on a chunk border.",
128+
"modernfix.option.mixin.bugfix.mantle_model_cme": "Fixes a bug in Mantle that can cause random ConcurrentModificationException crashes when rendering Tinkers Construct content.",
129+
"modernfix.option.mixin.bugfix.model_data_manager_cme": "Works around design flaws in the Forge ModelDataManager system that can cause unexpected concurrency issues.",
130+
"modernfix.option.mixin.bugfix.recipe_book_type_desync": "Fixes Forge clients being disconnected when connecting to a vanilla server if mods add custom recipe book entry types.",
131+
"modernfix.option.mixin.bugfix.unsafe_modded_shape_caches": "Fixes various ConcurrentModificationExceptions that can occur in content mods when computing block shapes",
132+
"modernfix.option.mixin.feature.stalled_chunk_load_detection": "This option may help to detect the cause of chunkloading freezes. However, leaving it enabled may cause slightly worse performance.",
133+
"modernfix.option.mixin.perf.fix_loop_spin_waiting": "Fixes Minecraft's built-in wait function consuming excessive amounts of CPU resources.",
134+
"modernfix.option.mixin.perf.forge_cap_retrieval": "Small micro-optimization that makes retrieving custom entity data slightly more efficient on Forge.",
135+
"modernfix.option.mixin.perf.forge_registry_lambda": "Fixes oversights in Forge that lead to excessive allocation in hot registry methods."
125136
}

common/src/main/resources/assets/modernfix/lang/zh_cn.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,16 @@
121121
"modernfix.option.mixin.perf.dynamic_block_codecs": "不再给每个方块(状态)都存储一个编解码器,只在需要时动态生成、缓存它。通常不值得启用,除非你有一百万个方块/物品。",
122122
"modernfix.option.mixin.perf.faster_command_suggestions": "在输入命令时,若有数十万个建议,可以缓解卡顿。",
123123
"modernfix.option.mixin.perf.mojang_registry_size": "修复了一个问题,它会导致方块/物品的注册速度减慢,减慢的程度与已注册的数量成正比。这缩短了启动时间。",
124-
"modernfix.option.mixin.perf.cache_profile_texture_url": "避免毫无意义地创建一个URL对象,加速头颅方块的渲染。"
124+
"modernfix.option.mixin.perf.cache_profile_texture_url": "避免毫无意义地创建一个URL对象,加速头颅方块的渲染。",
125+
"modernfix.option.mixin.bugfix.entity_pose_stack": "修复了Forge的#9118号问题,这个问题会导致模组在不弹出已经推入的MatrixStack时有概率触发无法诊断的渲染崩溃。",
126+
"modernfix.option.mixin.bugfix.file_dialog_title": "修复了在世界生成设置的文件选择对话框中的一个安全问题。",
127+
"modernfix.option.mixin.bugfix.forge_vehicle_packets": "修复了一个由Forge补丁引入的问题,此问题会导致玩家在区块边界上乘坐交通工具时,服务器向该玩家发送非常大量的区块数据包。",
128+
"modernfix.option.mixin.bugfix.mantle_model_cme": "修复了地幔(Mantle)的一个问题,此问题会导致渲染匠魂相关内容时毫无规律地触发并发修改异常(ConcurrentModificationException)而崩溃。",
129+
"modernfix.option.mixin.bugfix.model_data_manager_cme": "规避Forge的ModelDataManager的一些设计缺陷,这些缺陷可能导致突发性的并发问题。",
130+
"modernfix.option.mixin.bugfix.recipe_book_type_desync": "修复具有模组额外添加的配方书条目类型的Forge客户端在连接到原版服务器时强制断连的问题。",
131+
"modernfix.option.mixin.bugfix.unsafe_modded_shape_caches": "修复内容型模组在计算方块形状时可能发生的并发修改异常(ConcurrentModificationException)",
132+
"modernfix.option.mixin.feature.stalled_chunk_load_detection": "此选项对检测区块加载冻结可能有所帮助。不过,开启此选项也可能导致轻微性能下降。",
133+
"modernfix.option.mixin.perf.fix_loop_spin_waiting": "修复Minecraft内置的wait函数(方法)消耗过量CPU资源的问题。",
134+
"modernfix.option.mixin.perf.forge_cap_retrieval": "微优化,让Forge在获取自定义实体数据上更有效率一点。",
135+
"modernfix.option.mixin.perf.forge_registry_lambda": "修复Forge注册系统的一些疏漏,其会使得其中的热点方法产生过量的内存分配需求。"
125136
}

0 commit comments

Comments
 (0)