Added the Ritual for Water and did some rudimentary tests. Issue: MRS does not load properly on world load.
This commit is contained in:
parent
0e1173ef5d
commit
16a6333c6f
4 changed files with 73 additions and 3 deletions
52
src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java
Normal file
52
src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package WayofTime.bloodmagic.ritual;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.network.SoulNetwork;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.api.ritual.Ritual;
|
||||
import WayofTime.bloodmagic.api.ritual.RitualComponent;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
|
||||
public class RitualWater extends Ritual{
|
||||
|
||||
public RitualWater() {
|
||||
super("ritualWater", 0, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performRitual(IMasterRitualStone masterRitualStone) {
|
||||
System.out.println("Performing Effect");
|
||||
World world = masterRitualStone.getWorld();
|
||||
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner(), world);
|
||||
int currentEssence = network.getCurrentEssence();
|
||||
|
||||
if(currentEssence < getRefreshCost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockPos pos = masterRitualStone.getPos().up();
|
||||
if(world.isAirBlock(pos)) {
|
||||
world.setBlockState(pos, Blocks.water.getDefaultState());
|
||||
network.syphon(getRefreshCost());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRefreshCost() {
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<RitualComponent> getComponents() {
|
||||
ArrayList<RitualComponent> components = new ArrayList<RitualComponent>();
|
||||
|
||||
this.addCornerRunes(components, 1, 0, EnumRuneType.WATER);
|
||||
|
||||
return components;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue