Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Added EnumSetting
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke authored Mar 13, 2024
1 parent 21c7443 commit 6f14982
Showing 1 changed file with 24 additions and 0 deletions.
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();
}

}

0 comments on commit 6f14982

Please sign in to comment.