Fixed it so the Ritual will call stopRitual when a ritual stone is broken

This commit is contained in:
WayofTime 2016-06-20 09:31:16 -04:00
parent 2c70e6ebc1
commit 6da686aabe
2 changed files with 14 additions and 7 deletions

View file

@ -7,6 +7,7 @@ Version 2.0.2-45
- Made it so that the bound tools are (supposedly more so) unbreakable. This will probably come bite me on the ehem later, but we'll see.
- Added Fire Resistance Living Armour Upgrade, "Gift of Ignis."
- Updated The Architect section of the documentation.
- Fixed it so the Ritual will call stopRitual when a ritual stone is broken.
------------------------------------------------------
Version 2.0.2-44

View file

@ -10,7 +10,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@ -22,10 +21,10 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.Event;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.event.RitualEvent;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.registry.RitualRegistry;
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
import WayofTime.bloodmagic.api.ritual.Ritual;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
@ -189,14 +188,20 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
@Override
public void performRitual(World world, BlockPos pos)
{
if (!world.isRemote && getCurrentRitual() != null && RitualRegistry.ritualEnabled(getCurrentRitual()) && RitualHelper.checkValidRitual(getWorld(), getPos(), RitualRegistry.getIdForRitual(currentRitual), getDirection()))
if (!world.isRemote && getCurrentRitual() != null && RitualRegistry.ritualEnabled(getCurrentRitual()))
{
RitualEvent.RitualRunEvent event = new RitualEvent.RitualRunEvent(this, getOwner(), getCurrentRitual());
if (RitualHelper.checkValidRitual(getWorld(), getPos(), RitualRegistry.getIdForRitual(currentRitual), getDirection()))
{
RitualEvent.RitualRunEvent event = new RitualEvent.RitualRunEvent(this, getOwner(), getCurrentRitual());
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
return;
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
return;
getCurrentRitual().performRitual(this);
getCurrentRitual().performRitual(this);
} else
{
stopRitual(Ritual.BreakType.BREAK_STONE);
}
}
}
@ -205,6 +210,7 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
{
if (!getWorld().isRemote && getCurrentRitual() != null)
{
System.out.println("Hai! I stopped");
RitualEvent.RitualStopEvent event = new RitualEvent.RitualStopEvent(this, getOwner(), getCurrentRitual(), breakType);
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)