use of net.minecraft.item.EnumRarity in project ImmersiveEngineering by BluSunrize.
the class ShaderRegistry method getHigherRarities.
public static ArrayList<EnumRarity> getHigherRarities(EnumRarity rarity) {
ArrayList<EnumRarity> list = new ArrayList<EnumRarity>();
int idx = sortedRarityMap.indexOf(rarity);
if (idx <= 0)
return list;
int next = idx - 1;
int weight = rarityWeightMap.get(rarity);
int lowerWeight = -1;
for (; next >= 0; next--) {
EnumRarity r = sortedRarityMap.get(next);
int rWeight = rarityWeightMap.get(r);
if (rWeight < weight && (lowerWeight == -1 || rWeight >= lowerWeight)) {
list.add(r);
lowerWeight = rWeight;
}
}
return list;
}
use of net.minecraft.item.EnumRarity in project ImmersiveEngineering by BluSunrize.
the class RecipeShaderBags method getCraftingResult.
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
for (int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stackInSlot = inv.getStackInSlot(i);
if (stackInSlot != null) {
ItemStack output = new ItemStack(IEContent.itemShaderBag, IEContent.itemShaderBag.equals(stackInSlot.getItem()) ? 2 : 1);
EnumRarity next = ShaderRegistry.getLowerRarity(stackInSlot.getRarity());
if (next != null) {
ItemNBTHelper.setString(output, "rarity", next.toString());
return output;
}
}
}
return null;
}
Aggregations