Lava will not replaced with lava anymore unless it's flowing lava. (#1599)
* Lava will not replaced with lava anymore unless it's flowing lava. * Fixed Flowing Liquid detection * Removed unnecessary function arguments
This commit is contained in:
parent
21f3b9047c
commit
0090ec0a56
|
@ -1,12 +1,12 @@
|
||||||
package WayofTime.bloodmagic.ritual.types;
|
package WayofTime.bloodmagic.ritual.types;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.ritual.*;
|
|
||||||
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
|
|
||||||
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
|
||||||
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
|
||||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||||
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
|
||||||
|
import WayofTime.bloodmagic.ritual.*;
|
||||||
|
import WayofTime.bloodmagic.soul.DemonWillHolder;
|
||||||
|
import WayofTime.bloodmagic.soul.EnumDemonWillType;
|
||||||
|
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
|
||||||
import WayofTime.bloodmagic.util.Utils;
|
import WayofTime.bloodmagic.util.Utils;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -85,7 +85,7 @@ public class RitualLava extends Ritual {
|
||||||
|
|
||||||
for (BlockPos newPos : lavaRange.getContainedPositions(pos)) {
|
for (BlockPos newPos : lavaRange.getContainedPositions(pos)) {
|
||||||
IBlockState state = world.getBlockState(newPos);
|
IBlockState state = world.getBlockState(newPos);
|
||||||
if (world.isAirBlock(newPos) || Utils.isFlowingLiquid(world, newPos, state)) {
|
if (world.isAirBlock(newPos) || Utils.isFlowingLiquid(state)) {
|
||||||
int lpCost = getLPCostForRawWill(rawWill);
|
int lpCost = getLPCostForRawWill(rawWill);
|
||||||
if (currentEssence < lpCost) {
|
if (currentEssence < lpCost) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
package WayofTime.bloodmagic.util;
|
package WayofTime.bloodmagic.util;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.altar.ComponentType;
|
import WayofTime.bloodmagic.altar.ComponentType;
|
||||||
import WayofTime.bloodmagic.iface.IDemonWillViewer;
|
|
||||||
import WayofTime.bloodmagic.util.helper.NBTHelper;
|
|
||||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||||
|
import WayofTime.bloodmagic.iface.IDemonWillViewer;
|
||||||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||||
import WayofTime.bloodmagic.network.PlayerVelocityPacketProcessor;
|
import WayofTime.bloodmagic.network.PlayerVelocityPacketProcessor;
|
||||||
import WayofTime.bloodmagic.tile.TileInventory;
|
import WayofTime.bloodmagic.tile.TileInventory;
|
||||||
|
import WayofTime.bloodmagic.util.helper.NBTHelper;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockLiquid;
|
|
||||||
import net.minecraft.block.BlockPortal;
|
import net.minecraft.block.BlockPortal;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
|
@ -42,7 +41,6 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||||
import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
|
import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
|
||||||
import net.minecraftforge.fluids.IFluidBlock;
|
import net.minecraftforge.fluids.IFluidBlock;
|
||||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import net.minecraftforge.items.ItemHandlerHelper;
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
|
@ -799,9 +797,9 @@ public class Utils {
|
||||||
return (state instanceof IFluidBlock || state.getMaterial().isLiquid());
|
return (state instanceof IFluidBlock || state.getMaterial().isLiquid());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isFlowingLiquid(World world, BlockPos pos, IBlockState state) {
|
public static boolean isFlowingLiquid(IBlockState state) {
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
return ((block instanceof IFluidBlock && Math.abs(((IFluidBlock) block).getFilledPercentage(world, pos)) == 1) || (block instanceof BlockLiquid && block.getMetaFromState(state) != 0));
|
return isBlockLiquid(state) && !(state == block.getDefaultState());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean spawnStackAtBlock(World world, BlockPos pos, @Nullable EnumFacing pushDirection, ItemStack stack) {
|
public static boolean spawnStackAtBlock(World world, BlockPos pos, @Nullable EnumFacing pushDirection, ItemStack stack) {
|
||||||
|
|
Loading…
Reference in a new issue