mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Load Modded Datapacks in DatapackScreen, before world creation (#6913)
This commit is contained in:
1 parent
a3edfd3748
commit
24f3ef5ffe
10 files changed
+112
-39
No files matched your search
@@ -139,6 +139,7 @@ import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.event.world.NoteBlockEvent;
|
||||
import net.minecraftforge.eventbus.api.Event.Result;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fml.packs.ResourcePackLoader;
|
||||
import net.minecraftforge.registries.DataSerializerEntry;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.ForgeRegistry;
|
||||
@@ -1231,4 +1232,19 @@ public class ForgeHooks
|
||||
locations.stream().map(ResourceLocation::toString).forEach(array::add);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getModPacks()
|
||||
{
|
||||
List<String> modpacks = ResourcePackLoader.getPackNames();
|
||||
if(modpacks.isEmpty())
|
||||
throw new IllegalStateException("Attempted to retrieve mod packs before they were loaded in!");
|
||||
return modpacks;
|
||||
}
|
||||
|
||||
public static List<String> getModPacksWithVanilla()
|
||||
{
|
||||
List<String> modpacks = getModPacks();
|
||||
modpacks.add("vanilla");
|
||||
return modpacks;
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,16 @@ import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class Tags
|
||||
{
|
||||
public static void init ()
|
||||
{
|
||||
Blocks.init();
|
||||
Items.init();
|
||||
}
|
||||
|
||||
public static class Blocks
|
||||
{
|
||||
private static void init(){}
|
||||
|
||||
public static final ITag.INamedTag<Block> CHESTS = tag("chests");
|
||||
public static final ITag.INamedTag<Block> CHESTS_ENDER = tag("chests/ender");
|
||||
public static final ITag.INamedTag<Block> CHESTS_TRAPPED = tag("chests/trapped");
|
||||
@@ -132,6 +140,8 @@ public class Tags
|
||||
|
||||
public static class Items
|
||||
{
|
||||
private static void init(){}
|
||||
|
||||
public static final ITag.INamedTag<Item> ARROWS = tag("arrows");
|
||||
public static final ITag.INamedTag<Item> BONES = tag("bones");
|
||||
public static final ITag.INamedTag<Item> BOOKSHELVES = tag("bookshelves");
|
||||
|
||||
Reference in new issue
Block a user