Merge remote-tracking branch 'origin/1.18' into 1.19.2
This commit is contained in:
commit
d51de3fa55
|
|
@ -8,6 +8,7 @@ import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import org.embeddedt.modernfix.ModernFix;
|
||||
import org.embeddedt.modernfix.platform.ModernFixPlatformHooks;
|
||||
import org.embeddedt.modernfix.util.PackTypeHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -163,6 +164,8 @@ public class PackResourcesCacheEngine {
|
|||
}
|
||||
|
||||
public static void invalidate() {
|
||||
if(!ModernFixPlatformHooks.isDevEnv())
|
||||
return;
|
||||
synchronized (cachingPacks) {
|
||||
cachingPacks.keySet().forEach(pack -> {
|
||||
if(pack != null)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public abstract class ModFileResourcePackMixin implements ICachingResourcePack {
|
|||
@Inject(method = "getResources", at = @At("HEAD"), cancellable = true)
|
||||
private void fastGetResources(PackType type, String resourceNamespace, String pathIn, Predicate<ResourceLocation> filter, CallbackInfoReturnable<Collection<ResourceLocation>> cir)
|
||||
{
|
||||
if(!PackTypeHelper.isVanillaPackType(type) || this.cacheEngine == null)
|
||||
if(!PackTypeHelper.isVanillaPackType(type))
|
||||
return;
|
||||
cir.setReturnValue(this.generateResourceCache().getResources(type, resourceNamespace, pathIn, Integer.MAX_VALUE, filter));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,11 @@ import net.minecraftforge.fml.ModLoader;
|
|||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.FMLPaths;
|
||||
import net.minecraftforge.fml.loading.LoadingModList;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ExplodedDirectoryLocator;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
||||
import net.minecraftforge.network.PacketDistributor;
|
||||
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
||||
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
|
||||
import org.embeddedt.modernfix.api.constants.IntegrationConstants;
|
||||
import org.embeddedt.modernfix.core.ModernFixMixinPlugin;
|
||||
import org.embeddedt.modernfix.forge.classloading.FastAccessTransformerList;
|
||||
import org.embeddedt.modernfix.forge.packet.PacketHandler;
|
||||
import org.embeddedt.modernfix.util.DummyList;
|
||||
|
|
@ -63,7 +62,7 @@ public class ModernFixPlatformHooksImpl {
|
|||
}
|
||||
|
||||
public static boolean isDevEnv() {
|
||||
return !FMLLoader.isProduction() && FMLLoader.getLoadingModList().getModFileById("modernfix").getFile().getProvider() instanceof ExplodedDirectoryLocator;
|
||||
return !FMLLoader.isProduction();
|
||||
}
|
||||
|
||||
public static MinecraftServer getCurrentServer() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user