Skip to content

Commit

Permalink
修复危险感知和矿透不显示的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
EDGtheXu committed Oct 3, 2024
1 parent 0b54c13 commit f33a52a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public static void renderLevel(RenderLevelStageEvent event){
SpelunkerHelper blockGen= SpelunkerHelper.getSingleton(minecraft.player);
//效果消失,清除缓存
if(!Minecraft.getInstance().player.hasEffect(ModEffects.SPELUNKER.get())
||!Minecraft.getInstance().player.hasEffect(ModEffects.DANGER_SENSE.get())
&&!Minecraft.getInstance().player.hasEffect(ModEffects.DANGER_SENSE.get())
){
if(blockGen!=null){
blockGen.centerCache.clear();;
Expand Down Expand Up @@ -298,6 +298,7 @@ public static void renderLevel(RenderLevelStageEvent event){
}

if(blockGen.targets.get(n.getKey()).showType==ShowType.SPELUNKER){//矿透方块
if(!minecraft.player.hasEffect(ModEffects.SPELUNKER.get()))continue;
//todo 可以优化
for(BlockPos centerPos : centers.get(n.getKey())){//否则查找所有的中心块
double distance = centerPos.distSqr(blockProps);
Expand All @@ -316,6 +317,7 @@ public static void renderLevel(RenderLevelStageEvent event){
shouldRenderCache.put(blockProps,n.getKey());//只渲染中心块文本
}
}else if(blockGen.targets.get(n.getKey()).showType==ShowType.DANGER){//危险方块
if(!minecraft.player.hasEffect(ModEffects.DANGER_SENSE.get()))continue;
shouldRenderCache.put(blockProps,n.getKey());//渲染所有危险方块
}

Expand Down

0 comments on commit f33a52a

Please sign in to comment.