base mod created

This commit is contained in:
Mohammad-Ali Minaie
2018-10-08 09:07:47 -04:00
parent 0a7700c356
commit b86dedad2f
7848 changed files with 584664 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
package net.minecraft.util;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class IntegerCache
{
private static final Integer[] CACHE = new Integer[65535];
/**
* Get an Integer from the cache if it exists, otherwise return {@code Integer.valueOf()}
*/
public static Integer getInteger(int value)
{
return value > 0 && value < CACHE.length ? CACHE[value] : value;
}
static
{
int i = 0;
for (int j = CACHE.length; i < j; ++i)
{
CACHE[i] = i;
}
}
}