Java 类net.minecraft.util.IntegerCache 实例源码
项目:DecompiledMinecraft
文件:VisGraph.java
private Set<EnumFacing> func_178604_a(int p_178604_1_)
{
Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class);
Queue<Integer> queue = Lists.<Integer>newLinkedList();
queue.add(IntegerCache.func_181756_a(p_178604_1_));
this.field_178612_d.set(p_178604_1_, true);
while (!((Queue)queue).isEmpty())
{
int i = ((Integer)queue.poll()).intValue();
this.func_178610_a(i, set);
for (EnumFacing enumfacing : EnumFacing.values())
{
int j = this.func_178603_a(i, enumfacing);
if (j >= 0 && !this.field_178612_d.get(j))
{
this.field_178612_d.set(j, true);
queue.add(IntegerCache.func_181756_a(j));
}
}
}
return set;
}
项目:DecompiledMinecraft
文件:PotionHelper.java
/**
* Given a potion data value, get the associated liquid color (optionally bypassing the cache)
*/
public static int getLiquidColor(int dataValue, boolean bypassCache)
{
Integer integer = IntegerCache.func_181756_a(dataValue);
if (!bypassCache)
{
if (DATAVALUE_COLORS.containsKey(integer))
{
return ((Integer)DATAVALUE_COLORS.get(integer)).intValue();
}
else
{
int i = calcPotionLiquidColor(getPotionEffects(integer.intValue(), false));
DATAVALUE_COLORS.put(integer, Integer.valueOf(i));
return i;
}
}
else
{
return calcPotionLiquidColor(getPotionEffects(integer.intValue(), true));
}
}
项目:BaseClient
文件:PotionHelper.java
/**
* Given a potion data value, get the associated liquid color (optionally bypassing the cache)
*/
public static int getLiquidColor(int dataValue, boolean bypassCache)
{
Integer integer = IntegerCache.func_181756_a(dataValue);
if (!bypassCache)
{
if (DATAVALUE_COLORS.containsKey(integer))
{
return ((Integer)DATAVALUE_COLORS.get(integer)).intValue();
}
else
{
int i = calcPotionLiquidColor(getPotionEffects(integer.intValue(), false));
DATAVALUE_COLORS.put(integer, Integer.valueOf(i));
return i;
}
}
else
{
return calcPotionLiquidColor(getPotionEffects(integer.intValue(), true));
}
}
项目:BaseClient
文件:PotionHelper.java
/**
* Given a potion data value, get the associated liquid color (optionally bypassing the cache)
*/
public static int getLiquidColor(int dataValue, boolean bypassCache)
{
Integer integer = IntegerCache.func_181756_a(dataValue);
if (!bypassCache)
{
if (DATAVALUE_COLORS.containsKey(integer))
{
return ((Integer)DATAVALUE_COLORS.get(integer)).intValue();
}
else
{
int i = calcPotionLiquidColor(getPotionEffects(integer.intValue(), false));
DATAVALUE_COLORS.put(integer, Integer.valueOf(i));
return i;
}
}
else
{
return calcPotionLiquidColor(getPotionEffects(integer.intValue(), true));
}
}
项目:Backmemed
文件:VisGraph.java
private Set<EnumFacing> floodFill(int p_178604_1_)
{
Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class);
ArrayDeque arraydeque = new ArrayDeque(384);
arraydeque.add(IntegerCache.getInteger(p_178604_1_));
this.bitSet.set(p_178604_1_, true);
while (!arraydeque.isEmpty())
{
int i = ((Integer)arraydeque.poll()).intValue();
this.addEdges(i, set);
for (EnumFacing enumfacing : EnumFacing.VALUES)
{
int j = this.getNeighborIndexAtFace(i, enumfacing);
if (j >= 0 && !this.bitSet.get(j))
{
this.bitSet.set(j, true);
arraydeque.add(IntegerCache.getInteger(j));
}
}
}
return set;
}
项目:CustomWorldGen
文件:VisGraph.java
private Set<EnumFacing> floodFill(int p_178604_1_)
{
Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class);
Queue<Integer> queue = Queues.<Integer>newArrayDeque();
queue.add(IntegerCache.getInteger(p_178604_1_));
this.bitSet.set(p_178604_1_, true);
while (!((Queue)queue).isEmpty())
{
int i = ((Integer)queue.poll()).intValue();
this.addEdges(i, set);
for (EnumFacing enumfacing : EnumFacing.values())
{
int j = this.getNeighborIndexAtFace(i, enumfacing);
if (j >= 0 && !this.bitSet.get(j))
{
this.bitSet.set(j, true);
queue.add(IntegerCache.getInteger(j));
}
}
}
return set;
}
项目:ExpandedRailsMod
文件:VisGraph.java
private Set<EnumFacing> floodFill(int p_178604_1_)
{
Set<EnumFacing> set = EnumSet.<EnumFacing>noneOf(EnumFacing.class);
Queue<Integer> queue = Queues.<Integer>newArrayDeque();
queue.add(IntegerCache.getInteger(p_178604_1_));
this.bitSet.set(p_178604_1_, true);
while (!((Queue)queue).isEmpty())
{
int i = ((Integer)queue.poll()).intValue();
this.addEdges(i, set);
for (EnumFacing enumfacing : EnumFacing.values())
{
int j = this.getNeighborIndexAtFace(i, enumfacing);
if (j >= 0 && !this.bitSet.get(j))
{
this.bitSet.set(j, true);
queue.add(IntegerCache.getInteger(j));
}
}
}
return set;
}