Skip to content

Commit

Permalink
优化 ResourceLocation 验证去除的判断,使其仅对effek资源生效
Browse files Browse the repository at this point in the history
  • Loading branch information
ChloePrime committed Feb 26, 2024
1 parent 2867052 commit c81c726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ public class AAAParticles
{
public static final String MOD_ID = "aaa_particles";
public static final Logger LOGGER = LogUtils.getLogger();
public static volatile boolean INIT;

public static void init() {
ModNetwork.init();
INIT = true;
}

public static ResourceLocation loc(String path) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mod.chloeprime.aaaparticles.mixin;

import mod.chloeprime.aaaparticles.AAAParticles;
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -11,7 +10,10 @@
public class MixinResourceLocation {
@Inject(method = "isValidPath", at = @At("HEAD"), cancellable = true)
private static void isValidPath(String string, CallbackInfoReturnable<Boolean> cir) {
if (AAAParticles.INIT) {
if ("DUMMY".equals(string)) {
cir.setReturnValue(false);
}
if (string.startsWith("effeks/")) {
cir.setReturnValue(true);
}
}
Expand Down

0 comments on commit c81c726

Please sign in to comment.