类 AddPackFindersEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.AddPackFindersEvent
- 所有已实现的接口:
net.neoforged.fml.event.IModBusEvent
public class AddPackFindersEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
Fired on
PackRepository
creation to allow mods to add new pack finders.-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
addPackFinders
(ResourceLocation packLocation, PackType packType, Component packNameDisplay, PackSource packSource, boolean alwaysActive, Pack.Position packPosition) Helper method to register a pack found under the `resources/` folder.void
addRepositorySource
(RepositorySource source) Adds a new source to the list of pack finders.boolean
返回 whether or not the pack repository being assembled is the one used to provide known packs to the client to avoid syncing from the server。
-
字段详细资料
-
packType
-
sources
-
trusted
private final boolean trusted
-
-
构造器详细资料
-
AddPackFindersEvent
-
-
方法详细资料
-
addRepositorySource
Adds a new source to the list of pack finders.Sources are processed in the order that they are added to the event. Use
Pack.Position.TOP
to add high priority packs, andPack.Position.BOTTOM
to add low priority packs.- 参数:
source
- the pack finder
-
getPackType
- 返回:
- the
PackType
of the pack repository being constructed.
-
addPackFinders
public void addPackFinders(ResourceLocation packLocation, PackType packType, Component packNameDisplay, PackSource packSource, boolean alwaysActive, Pack.Position packPosition) Helper method to register a pack found under the `resources/` folder.- 参数:
packLocation
- Location of the pack to load. Namespace should be the modid of the pack owner and path is the location under `resources/` folderpackType
- Whether pack is a resourcepack or datapackpackNameDisplay
- The text that shows for the pack on the pack selection screenpackSource
- Controls whether the datapack is enabled or disabled by default. Resourcepacks are always disabled by default unless you set alwaysActive to true.alwaysActive
- Whether the pack is forced active always. If false, players have to manually activate the pack themselvespackPosition
- Where the pack goes for determining pack applying order
-
isTrusted
public boolean isTrusted()返回 whether or not the pack repository being assembled is the one used to provide known packs to the client to avoid syncing from the server。- 返回:
- whether or not the pack repository being assembled is the one used to provide known packs to the client to avoid syncing from the server
-