mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Removal of Lombok
Lombok implementation removal. I have also gone through and replaced things with inline methods and variables, lambdas, and simplified loops down, removed unnecessary guard clauses, and overall cleaned up every single class. This took a long time, please do remember to follow proper naming conventions, don't include unnecessary guard clauses, follow exception rules and comment rules, and please PLEASE remember to use the DIAMOND OPERATOR rather than just inferring RAW TYPES!!! Thank you!!
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.config;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
|
||||
|
||||
@ -172,6 +173,19 @@ public enum ConfigEntry
|
||||
this.configName = configName;
|
||||
}
|
||||
|
||||
public static ConfigEntry findConfigEntry(String name)
|
||||
{
|
||||
name = name.toLowerCase().replace("_", "");
|
||||
for (ConfigEntry entry : values())
|
||||
{
|
||||
if (entry.toString().toLowerCase().replace("_", "").equals(name))
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Class<?> getType()
|
||||
{
|
||||
return type;
|
||||
@ -187,21 +201,14 @@ public enum ConfigEntry
|
||||
return getConfig().getString(this);
|
||||
}
|
||||
|
||||
public String setString(String value)
|
||||
{
|
||||
getConfig().setString(this, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public Double getDouble()
|
||||
{
|
||||
return getConfig().getDouble(this);
|
||||
}
|
||||
|
||||
public Double setDouble(Double value)
|
||||
public void setDouble(Double value)
|
||||
{
|
||||
getConfig().setDouble(this, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public Boolean getBoolean()
|
||||
@ -220,10 +227,9 @@ public enum ConfigEntry
|
||||
return getConfig().getInteger(this);
|
||||
}
|
||||
|
||||
public Integer setInteger(Integer value)
|
||||
public void setInteger(Integer value)
|
||||
{
|
||||
getConfig().setInteger(this, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public List<?> getList()
|
||||
@ -239,19 +245,6 @@ public enum ConfigEntry
|
||||
|
||||
private MainConfig getConfig()
|
||||
{
|
||||
return TotalFreedomMod.plugin().config;
|
||||
}
|
||||
|
||||
public static ConfigEntry findConfigEntry(String name)
|
||||
{
|
||||
name = name.toLowerCase().replace("_", "");
|
||||
for (ConfigEntry entry : values())
|
||||
{
|
||||
if (entry.toString().toLowerCase().replace("_", "").equals(name))
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return Objects.requireNonNull(TotalFreedomMod.plugin()).config;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user