Removed stream usage from RecipeHolder.

This commit is contained in:
MobiusDevelopment 2023-01-08 14:55:41 +00:00
parent 834387f340
commit 1d450d87d8
9 changed files with 54 additions and 27 deletions

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.

View File

@ -309,10 +309,13 @@ 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)
{
return null;
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.