Skip to content

Commit

Permalink
Add plugin source to API
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Dec 28, 2024
1 parent 54423b6 commit 0336f2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public sealed interface DatapackSource permits DatapackSourceImpl {
DatapackSource FEATURE = create("feature");
DatapackSource WORLD = create("world");
DatapackSource SERVER = create("server");
DatapackSource PLUGIN = create("plugin");

private static DatapackSource create(final String name) {
return new DatapackSourceImpl(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public boolean removeDiscoveredPack(final String name) {
resourcesSupplier,
PackType.SERVER_DATA,
new PackSelectionConfig(
configurerImpl.required,
configurerImpl.autoEnableOnServerStart,
configurerImpl.position,
configurerImpl.fixedPosition
));
Expand All @@ -134,7 +134,7 @@ public boolean removeDiscoveredPack(final String name) {
static final class ConfigurerImpl implements Configurer {

private Component title;
private boolean required = false;
private boolean autoEnableOnServerStart = false;
private boolean fixedPosition = false;
private Pack.Position position = Pack.Position.TOP;

Expand All @@ -150,7 +150,7 @@ public Configurer title(final Component title) {

@Override
public Configurer autoEnableOnServerStart(final boolean autoEnableOnServerStart) {
this.required = autoEnableOnServerStart;
this.autoEnableOnServerStart = autoEnableOnServerStart;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class PaperDiscoveredDatapack implements DiscoveredDatapack {
.put(PackSource.FEATURE, DatapackSource.FEATURE)
.put(PackSource.WORLD, DatapackSource.WORLD)
.put(PackSource.SERVER, DatapackSource.SERVER)
.put(PluginPackSource.INSTANCE, DatapackSource.PLUGIN)
.buildOrThrow();
}

Expand Down

0 comments on commit 0336f2a

Please sign in to comment.