Skip to content

Commit 19d0769

Browse files
committed
make isForceLoaded check if mod loaded
1 parent 3c14249 commit 19d0769

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*.bat text eol=crlf
33
*.patch text eol=lf
44
*.java text eol=lf
5-
*.gradle text eol=crlf
5+
*.gradle text eol=lf
66
*.png binary
77
*.gif binary
88
*.exe binary
@@ -12,4 +12,4 @@
1212
*.zip binary
1313
*.pyd binary
1414
*.cfg text eol=lf
15-
*.jks binary
15+
*.jks binary

common/src/main/java/com/github/litermc/vschunkloader/attachment/ForceLoadAttachment.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.github.litermc.vschunkloader.attachment;
22

3+
import com.github.litermc.vschunkloader.platform.PlatformHelper;
4+
35
import net.minecraft.resources.ResourceLocation;
46

57
import com.fasterxml.jackson.annotation.JsonAutoDetect;
@@ -44,7 +46,13 @@ private void setForceLoadTokens(final Collection<String> tokens) {
4446
}
4547

4648
public boolean isForceLoaded() {
47-
return !this.forceLoadTokens.isEmpty();
49+
final PlatformHelper platform = PlatformHelper.get();
50+
for (final ResourceLocation id : this.forceLoadTokens) {
51+
if (platform.isModLoaded(id.getNamespace())) {
52+
return true;
53+
}
54+
}
55+
return false;
4856
}
4957

5058
public boolean isForceLoadedBy(final ResourceLocation token) {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ vs_core_version=1.1.0+cf6990a85d
4444
jade_version=11.13.1
4545
cct_version=1.115.0
4646
create_version=0.5.1.j-55
47-
create_fabric_version = 0.5.1-j-build.1631+mc1.20.1
47+
create_fabric_version=0.5.1-j-build.1631+mc1.20.1
4848

4949
mod_artifact_suffix=

0 commit comments

Comments
 (0)