Removed stream usage from RecipeHolder.
This commit is contained in:
parent
834387f340
commit
1d450d87d8
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
@ -309,11 +309,14 @@ public class RecipeHolder implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to insicate that process didn't go well.
|
||||
if (_materials.stream().anyMatch(i -> !player.destroyItemByItemId("Recipe " + getId(), i.getId(), i.getCount(), manufacturer, sendMessage)))
|
||||
// Take necessary ingredients. If there was problem destroying item, return null to indicate that process didn't go well.
|
||||
for (ItemHolder material : _materials)
|
||||
{
|
||||
if (!player.destroyItemByItemId("Recipe " + getId(), material.getId(), material.getCount(), manufacturer, sendMessage))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if success. Luck triggers no matter the success rate - even with 100% craft. Luck chance is taken from your stat and not manufacturer's stat.
|
||||
final ItemHolder result = getRandomProduct();
|
||||
|
Loading…
Reference in New Issue
Block a user