mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-26 05:08:34 +01:00
use isSimilar over isPresentInWorld
This commit is contained in:
parent
b5777f715b
commit
0ef69b0560
1 changed files with 3 additions and 2 deletions
|
@ -100,7 +100,7 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickableTi
|
||||||
if (this.structureState != StructureState.INVALID) {
|
if (this.structureState != StructureState.INVALID) {
|
||||||
int space = this.container.storeAura(300, true);
|
int space = this.container.storeAura(300, true);
|
||||||
IAuraType expectedType = this.structureState == StructureState.NETHER ? NaturesAuraAPI.TYPE_NETHER : NaturesAuraAPI.TYPE_OVERWORLD;
|
IAuraType expectedType = this.structureState == StructureState.NETHER ? NaturesAuraAPI.TYPE_NETHER : NaturesAuraAPI.TYPE_OVERWORLD;
|
||||||
if (space > 0 && expectedType.isPresentInWorld(this.world)) {
|
if (space > 0 && IAuraType.forWorld(this.world).isSimilar(expectedType)) {
|
||||||
int toStore = Math.min(IAuraChunk.getAuraInArea(this.world, this.pos, 20), space);
|
int toStore = Math.min(IAuraChunk.getAuraInArea(this.world, this.pos, 20), space);
|
||||||
if (toStore > 0) {
|
if (toStore > 0) {
|
||||||
BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 20, this.pos);
|
BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 20, this.pos);
|
||||||
|
@ -202,8 +202,9 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickableTi
|
||||||
}
|
}
|
||||||
|
|
||||||
private AltarRecipe getRecipeForInput(ItemStack input) {
|
private AltarRecipe getRecipeForInput(ItemStack input) {
|
||||||
|
IAuraType type = IAuraType.forWorld(this.world);
|
||||||
for (AltarRecipe recipe : NaturesAuraAPI.ALTAR_RECIPES.values()) {
|
for (AltarRecipe recipe : NaturesAuraAPI.ALTAR_RECIPES.values()) {
|
||||||
if (recipe.input.test(input) && (recipe.requiredType == null || recipe.requiredType.isPresentInWorld(this.world))) {
|
if (recipe.input.test(input) && (recipe.requiredType == null || type.isSimilar(recipe.requiredType))) {
|
||||||
if (recipe.catalyst == Ingredient.EMPTY)
|
if (recipe.catalyst == Ingredient.EMPTY)
|
||||||
return recipe;
|
return recipe;
|
||||||
for (ItemStack stack : this.catalysts)
|
for (ItemStack stack : this.catalysts)
|
||||||
|
|
Loading…
Reference in a new issue