mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
parent
f5428adbc6
commit
5bf5b14fa8
2 changed files with 5 additions and 5 deletions
|
@ -43,11 +43,10 @@ public class InternalHooks implements NaturesAuraAPI.IInternalHooks {
|
||||||
if (!stack.isEmpty()) {
|
if (!stack.isEmpty()) {
|
||||||
var container = stack.getCapability(NaturesAuraAPI.capAuraContainer).orElse(null);
|
var container = stack.getCapability(NaturesAuraAPI.capAuraContainer).orElse(null);
|
||||||
if (extract) {
|
if (extract) {
|
||||||
amount -= container.drainAura(amount, simulate);
|
return container.drainAura(amount, simulate) > 0;
|
||||||
} else {
|
} else {
|
||||||
amount -= container.storeAura(amount, simulate);
|
return container.storeAura(amount, simulate) > 0;
|
||||||
}
|
}
|
||||||
return amount <= 0;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,11 +48,12 @@ public class BlockEntityNatureAltar extends BlockEntityImpl implements ITickable
|
||||||
@Override
|
@Override
|
||||||
protected boolean canExtract(ItemStack stack, int slot, int amount) {
|
protected boolean canExtract(ItemStack stack, int slot, int amount) {
|
||||||
var cap = stack.getCapability(NaturesAuraAPI.capAuraContainer, null).orElse(null);
|
var cap = stack.getCapability(NaturesAuraAPI.capAuraContainer, null).orElse(null);
|
||||||
if (cap != null)
|
if (cap != null) {
|
||||||
return cap.storeAura(1, true) <= 0;
|
return cap.storeAura(1, true) <= 0;
|
||||||
else
|
} else {
|
||||||
return BlockEntityNatureAltar.this.getRecipeForInput(stack) == null;
|
return BlockEntityNatureAltar.this.getRecipeForInput(stack) == null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public int bobTimer;
|
public int bobTimer;
|
||||||
|
|
Loading…
Reference in a new issue