mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-24 05:54:41 +00:00
Minor code and documentation cleanup. (#4664)
This commit is contained in:
52 files changed
+227
-249
No files matched your search
@@ -46,6 +46,7 @@ import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door;
|
||||
import net.minecraftforge.classloading.FMLForgePlugin;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -376,10 +377,8 @@ public class EnumHelper
|
||||
try
|
||||
{
|
||||
T[] previousValues = (T[])valuesField.get(enumType);
|
||||
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
|
||||
T newValue = makeEnum(enumType, enumName, values.size(), paramTypes, paramValues);
|
||||
values.add(newValue);
|
||||
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
|
||||
T newValue = makeEnum(enumType, enumName, previousValues.length, paramTypes, paramValues);
|
||||
setFailsafeFieldValue(valuesField, null, ArrayUtils.add(previousValues, newValue));
|
||||
cleanEnumCache(enumType);
|
||||
|
||||
return newValue;
|
||||
|
||||
@@ -22,5 +22,5 @@ import net.minecraft.util.datafix.IDataFixer;
|
||||
|
||||
public interface IDataFixerData extends IDataFixer
|
||||
{
|
||||
public int getVersion(String mod);
|
||||
int getVersion(String mod);
|
||||
}
|
||||
Reference in new issue
Block a user