mirror of
https://github.com/TeamMidnightDust/CullLeaves.git
synced 2025-12-17 22:55:10 +01:00
Update everything to 1.19.3
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package eu.midnightdust.cullleaves.forge;
|
||||
|
||||
import net.minecraft.resource.*;
|
||||
import net.minecraft.resource.metadata.PackResourceMetadata;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -12,8 +11,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.resource.PathPackResources;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = "cullleaves", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||
public class CullLeavesClientEvents {
|
||||
@SubscribeEvent
|
||||
@@ -23,11 +20,11 @@ public class CullLeavesClientEvents {
|
||||
}
|
||||
}
|
||||
private static void registerResourcePack(AddPackFindersEvent event, Identifier id, boolean alwaysEnabled) {
|
||||
event.addRepositorySource(((profileAdder, factory) -> {
|
||||
event.addRepositorySource((profileAdder -> {
|
||||
IModFile file = ModList.get().getModFileById(id.getNamespace()).getFile();
|
||||
try (PathPackResources pack = new PathPackResources(id.toString(), file.findResource("resourcepacks/"+id.getPath()))) {
|
||||
profileAdder.accept(new ResourcePackProfile(id.toString(), alwaysEnabled, () -> pack, Text.of(id.getNamespace()+"/"+id.getPath()), pack.parseMetadata(PackResourceMetadata.READER).getDescription().copy().append(" §7(built-in)"), ResourcePackCompatibility.COMPATIBLE, ResourcePackProfile.InsertionPosition.TOP, false, ResourcePackSource.PACK_SOURCE_BUILTIN, false));
|
||||
} catch (IOException | NullPointerException e) {e.printStackTrace();}
|
||||
try (PathPackResources pack = new PathPackResources(id.toString(), true, file.findResource("resourcepacks/"+id.getPath()))) {
|
||||
profileAdder.accept(ResourcePackProfile.create(id.toString(), Text.of(id.getNamespace()+"/"+id.getPath()), alwaysEnabled, a -> pack, ResourceType.CLIENT_RESOURCES, ResourcePackProfile.InsertionPosition.TOP, ResourcePackSource.BUILTIN));
|
||||
} catch (NullPointerException e) {e.printStackTrace();}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user