Skip to content

Commit b6e053e

Browse files
committed
修复服务器无法使用的BUG
1 parent a5c6398 commit b6e053e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ loader_version=0.16.13
1010
fabric_kotlin_version=1.13.2+kotlin.2.1.20
1111

1212
# Mod Properties
13-
mod_version=1.1
13+
mod_version=1.12
1414
maven_group=cn.coostack.usefulmagic
1515
archives_base_name=usefulmagic
1616

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
package cn.coostack.usefulmagic.utils
22

3+
import net.fabricmc.api.EnvType
4+
import net.fabricmc.loader.api.FabricLoader
35
import net.minecraft.client.MinecraftClient
46

7+
58
object ParticleOption {
69
/**
710
* 粒子倍数
811
*/
9-
fun getParticleCounts(): Int =
10-
3 - (MinecraftClient.getInstance()?.options?.particles?.value?.id ?: 0)
11-
12-
13-
}
12+
fun getParticleCounts(): Int {
13+
// 判断环境
14+
if (FabricLoader.getInstance().environmentType == EnvType.SERVER) {
15+
return 3
16+
}
17+
return 3 - (MinecraftClient.getInstance()?.options?.particles?.value?.id ?: 0)
18+
}
19+
}

0 commit comments

Comments
 (0)