This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21c7443
commit 6f14982
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
pb-api/src/main/java/me/earth/pingbypass/api/setting/impl/EnumSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package me.earth.pingbypass.api.setting.impl.types; | ||
|
||
import com.mojang.brigadier.arguments.ArgumentType; | ||
import me.earth.pingbypass.api.config.ConfigType; | ||
import me.earth.pingbypass.api.config.JsonParser; | ||
import me.earth.pingbypass.api.setting.Complexity; | ||
import me.earth.pingbypass.api.setting.impl.SettingImpl; | ||
import me.earth.pingbypass.api.traits.CanBeVisible; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.function.Function; | ||
|
||
public class EnumSetting<T extends Enum<T>> extends SettingImpl<T> { | ||
public EnumSetting(Function<T, Component> componentFactory, CanBeVisible visibility, ArgumentType<T> argumentType, Complexity complexity, JsonParser<T> parser, | ||
ConfigType configType, String description, T defaultValue, String name) { | ||
super(componentFactory, visibility, argumentType, complexity, parser, configType, description, defaultValue, name); | ||
} | ||
|
||
@Override | ||
public Class<T> getType() { | ||
return getDefaultValue().getDeclaringClass(); | ||
} | ||
|
||
} |