Untested Ritual Reader stuff, and removing some registry shenanigans.
This commit is contained in:
parent
db268b23a4
commit
30f233b81a
|
@ -27,6 +27,16 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
|
||||||
|
|
||||||
public abstract void resetIterator();
|
public abstract void resetIterator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method changes the area descriptor so that its range matches the two
|
||||||
|
* blocks that are selected. When implementing this method, assume that
|
||||||
|
* these positions are the blocks that are clicked by the player.
|
||||||
|
*
|
||||||
|
* @param pos1
|
||||||
|
* @param pos2
|
||||||
|
*/
|
||||||
|
public abstract void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2);
|
||||||
|
|
||||||
public static class Rectangle extends AreaDescriptor
|
public static class Rectangle extends AreaDescriptor
|
||||||
{
|
{
|
||||||
private BlockPos minimumOffset;
|
private BlockPos minimumOffset;
|
||||||
|
@ -170,6 +180,15 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
|
||||||
{
|
{
|
||||||
currentPosition = null;
|
currentPosition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2)
|
||||||
|
{
|
||||||
|
setOffsets(pos1, pos2);
|
||||||
|
maximumOffset = maximumOffset.add(1, 1, 1);
|
||||||
|
resetIterator();
|
||||||
|
resetCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HemiSphere extends AreaDescriptor
|
public static class HemiSphere extends AreaDescriptor
|
||||||
|
@ -293,6 +312,12 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Cross extends AreaDescriptor
|
public static class Cross extends AreaDescriptor
|
||||||
|
@ -379,5 +404,12 @@ public abstract class AreaDescriptor implements Iterator<BlockPos>
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void modifyAreaByBlockPositions(BlockPos pos1, BlockPos pos2)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package WayofTime.bloodmagic.api.ritual;
|
package WayofTime.bloodmagic.api.ritual;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface is for internal implementation only.
|
* This interface is for internal implementation only.
|
||||||
|
@ -36,4 +39,14 @@ public interface IMasterRitualStone
|
||||||
World getWorldObj();
|
World getWorldObj();
|
||||||
|
|
||||||
BlockPos getBlockPos();
|
BlockPos getBlockPos();
|
||||||
|
|
||||||
|
String getNextBlockRange(String range);
|
||||||
|
|
||||||
|
void provideInformationOfRitualToPlayer(EntityPlayer player);
|
||||||
|
|
||||||
|
void provideInformationOfRangeToPlayer(EntityPlayer player, String range);
|
||||||
|
|
||||||
|
void setActiveWillDrain(EntityPlayer player, List<EnumDemonWillType> typeList);
|
||||||
|
|
||||||
|
boolean setBlockRangeByBounds(EntityPlayer player, String range, BlockPos offset1, BlockPos offset2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
package WayofTime.bloodmagic.api.ritual;
|
package WayofTime.bloodmagic.api.ritual;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
@ -8,19 +13,17 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class for creating new rituals. Rituals need be registered with
|
* Abstract class for creating new rituals. Rituals need be registered with
|
||||||
* {@link WayofTime.bloodmagic.api.registry.RitualRegistry#registerRitual(Ritual, String)}
|
* {@link WayofTime.bloodmagic.api.registry.RitualRegistry#registerRitual(Ritual, String)}
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@EqualsAndHashCode(exclude = { "modableRangeMap" })
|
@EqualsAndHashCode(exclude = { "modableRangeMap", "ritualComponents", "renderer" })
|
||||||
@ToString
|
@ToString
|
||||||
public abstract class Ritual
|
public abstract class Ritual
|
||||||
{
|
{
|
||||||
|
@ -141,6 +144,79 @@ public abstract class Ritual
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getListOfRanges()
|
||||||
|
{
|
||||||
|
return new ArrayList<String>(modableRangeMap.keySet());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNextBlockRange(String range)
|
||||||
|
{
|
||||||
|
List<String> rangeList = getListOfRanges();
|
||||||
|
|
||||||
|
if (rangeList.isEmpty())
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rangeList.contains(range))
|
||||||
|
{
|
||||||
|
return rangeList.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean hasMatch = false;
|
||||||
|
|
||||||
|
for (String rangeCheck : rangeList)
|
||||||
|
{
|
||||||
|
if (hasMatch)
|
||||||
|
{
|
||||||
|
return rangeCheck;
|
||||||
|
} else if (rangeCheck.equals(range))
|
||||||
|
{
|
||||||
|
hasMatch = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rangeList.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setBlockRangeByBounds(String range, IMasterRitualStone master, BlockPos offset1, BlockPos offset2)
|
||||||
|
{
|
||||||
|
AreaDescriptor descriptor = this.getBlockRange(range);
|
||||||
|
if (canBlockRangeBeModified(descriptor, master, offset1, offset2))
|
||||||
|
{
|
||||||
|
descriptor.modifyAreaByBlockPositions(offset1, offset2);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean canBlockRangeBeModified(AreaDescriptor descriptor, IMasterRitualStone master, BlockPos offset1, BlockPos offset2)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ITextComponent getErrorForBlockRangeOnFail(EntityPlayer player, String range, IMasterRitualStone master, BlockPos offset1, BlockPos offset2)
|
||||||
|
{
|
||||||
|
return new TextComponentTranslation("ritual.BloodMagic.blockRange.tooBig");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ITextComponent provideInformationOfRitualToPlayer(EntityPlayer player)
|
||||||
|
{
|
||||||
|
return new TextComponentTranslation(this.getUnlocalizedName() + ".info");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ITextComponent provideInformationOfRangeToPlayer(EntityPlayer player, String range)
|
||||||
|
{
|
||||||
|
if (getListOfRanges().contains(range))
|
||||||
|
{
|
||||||
|
return new TextComponentTranslation(this.getUnlocalizedName() + "." + range + ".info");
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return new TextComponentTranslation("ritual.BloodMagic.blockRange.noRange");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a list of {@link RitualComponent} for checking the ritual.
|
* @return a list of {@link RitualComponent} for checking the ritual.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,7 +31,6 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName(Constants.Mod.MODID + ".daggerOfSacrifice");
|
setUnlocalizedName(Constants.Mod.MODID + ".daggerOfSacrifice");
|
||||||
setRegistryName(Constants.BloodMagicItem.DAGGER_OF_SACRIFICE.getRegName());
|
|
||||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
setFull3D();
|
setFull3D();
|
||||||
|
|
|
@ -8,9 +8,13 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.EnumActionResult;
|
import net.minecraft.util.EnumActionResult;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.util.text.TextComponentTranslation;
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
@ -20,12 +24,10 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.ritual.EnumRitualReaderState;
|
import WayofTime.bloodmagic.api.ritual.EnumRitualReaderState;
|
||||||
|
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
||||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
|
||||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||||
import WayofTime.bloodmagic.util.ChatUtil;
|
import WayofTime.bloodmagic.util.ChatUtil;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
@ -68,9 +70,18 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
@Override
|
@Override
|
||||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||||
{
|
{
|
||||||
if (player.isSneaking() && !world.isRemote)
|
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||||
|
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||||
{
|
{
|
||||||
cycleReader(stack, player);
|
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSneaking())
|
||||||
|
{
|
||||||
|
if (!world.isRemote)
|
||||||
|
{
|
||||||
|
cycleReader(stack, player);
|
||||||
|
}
|
||||||
|
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
|
@ -78,6 +89,122 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
|
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
if (!world.isRemote)
|
||||||
|
{
|
||||||
|
EnumRitualReaderState state = this.getState(stack);
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
if (tile instanceof IMasterRitualStone)
|
||||||
|
{
|
||||||
|
IMasterRitualStone master = (IMasterRitualStone) tile;
|
||||||
|
this.setBlockPos(stack, pos);
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case INFORMATION:
|
||||||
|
master.provideInformationOfRitualToPlayer(player);
|
||||||
|
break;
|
||||||
|
case SET_AREA:
|
||||||
|
String range = this.getCurrentBlockRange(stack);
|
||||||
|
if (player.isSneaking())
|
||||||
|
{
|
||||||
|
String newRange = master.getNextBlockRange(range);
|
||||||
|
range = newRange;
|
||||||
|
this.setCurrentBlockRange(stack, newRange);
|
||||||
|
}
|
||||||
|
|
||||||
|
master.provideInformationOfRangeToPlayer(player, range);
|
||||||
|
break;
|
||||||
|
case SET_WILL_TYPES:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EnumActionResult.FAIL;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (state == EnumRitualReaderState.SET_AREA)
|
||||||
|
{
|
||||||
|
BlockPos masterPos = this.getMasterBlockPos(stack);
|
||||||
|
if (!masterPos.equals(BlockPos.ORIGIN))
|
||||||
|
{
|
||||||
|
BlockPos containedPos = getBlockPos(stack);
|
||||||
|
if (containedPos.equals(BlockPos.ORIGIN))
|
||||||
|
{
|
||||||
|
System.out.println("Getting first block...");
|
||||||
|
this.setBlockPos(stack, pos.subtract(masterPos));
|
||||||
|
//TODO: Notify player.
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
tile = world.getTileEntity(masterPos);
|
||||||
|
if (tile instanceof IMasterRitualStone)
|
||||||
|
{
|
||||||
|
System.out.println("Setting custom bounds...");
|
||||||
|
IMasterRitualStone master = (IMasterRitualStone) tile;
|
||||||
|
master.setBlockRangeByBounds(player, this.getCurrentBlockRange(stack), containedPos, pos.subtract(masterPos));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setBlockPos(stack, BlockPos.ORIGIN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getBlockPos(ItemStack stack)
|
||||||
|
{
|
||||||
|
stack = NBTHelper.checkNBT(stack);
|
||||||
|
return new BlockPos(stack.getTagCompound().getInteger(Constants.NBT.X_COORD), stack.getTagCompound().getInteger(Constants.NBT.Y_COORD), stack.getTagCompound().getInteger(Constants.NBT.Z_COORD));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack setBlockPos(ItemStack stack, BlockPos pos)
|
||||||
|
{
|
||||||
|
stack = NBTHelper.checkNBT(stack);
|
||||||
|
NBTTagCompound itemTag = stack.getTagCompound();
|
||||||
|
itemTag.setInteger(Constants.NBT.X_COORD, pos.getX());
|
||||||
|
itemTag.setInteger(Constants.NBT.Y_COORD, pos.getY());
|
||||||
|
itemTag.setInteger(Constants.NBT.Z_COORD, pos.getZ());
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getMasterBlockPos(ItemStack stack)
|
||||||
|
{
|
||||||
|
stack = NBTHelper.checkNBT(stack);
|
||||||
|
return new BlockPos(stack.getTagCompound().getInteger(Constants.NBT.X_COORD + "master"), stack.getTagCompound().getInteger(Constants.NBT.Y_COORD + "master"), stack.getTagCompound().getInteger(Constants.NBT.Z_COORD + "master"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack setMasterBlockPos(ItemStack stack, BlockPos pos)
|
||||||
|
{
|
||||||
|
stack = NBTHelper.checkNBT(stack);
|
||||||
|
NBTTagCompound itemTag = stack.getTagCompound();
|
||||||
|
itemTag.setInteger(Constants.NBT.X_COORD + "master", pos.getX());
|
||||||
|
itemTag.setInteger(Constants.NBT.Y_COORD + "master", pos.getY());
|
||||||
|
itemTag.setInteger(Constants.NBT.Z_COORD + "master", pos.getZ());
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrentBlockRange(ItemStack stack)
|
||||||
|
{
|
||||||
|
NBTHelper.checkNBT(stack);
|
||||||
|
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
|
||||||
|
return tag.getString("range");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentBlockRange(ItemStack stack, String range)
|
||||||
|
{
|
||||||
|
NBTHelper.checkNBT(stack);
|
||||||
|
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
|
||||||
|
tag.setString("range", range);
|
||||||
|
}
|
||||||
|
|
||||||
public void cycleReader(ItemStack stack, EntityPlayer player)
|
public void cycleReader(ItemStack stack, EntityPlayer player)
|
||||||
{
|
{
|
||||||
EnumRitualReaderState prevState = getState(stack);
|
EnumRitualReaderState prevState = getState(stack);
|
||||||
|
@ -96,10 +223,7 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
|
|
||||||
public void setState(ItemStack stack, EnumRitualReaderState state)
|
public void setState(ItemStack stack, EnumRitualReaderState state)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
NBTHelper.checkNBT(stack);
|
||||||
{
|
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
NBTTagCompound tag = stack.getTagCompound();
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
package WayofTime.bloodmagic.tile;
|
package WayofTime.bloodmagic.tile;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import java.util.List;
|
||||||
import WayofTime.bloodmagic.api.event.RitualEvent;
|
|
||||||
import WayofTime.bloodmagic.api.network.SoulNetwork;
|
|
||||||
import WayofTime.bloodmagic.api.registry.RitualRegistry;
|
|
||||||
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
|
||||||
import WayofTime.bloodmagic.api.ritual.Ritual;
|
|
||||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
|
||||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
|
||||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
|
||||||
import WayofTime.bloodmagic.api.util.helper.RitualHelper;
|
|
||||||
import WayofTime.bloodmagic.item.ItemActivationCrystal;
|
|
||||||
import WayofTime.bloodmagic.registry.ModItems;
|
|
||||||
import WayofTime.bloodmagic.util.ChatUtil;
|
|
||||||
import com.google.common.base.Strings;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -27,9 +15,26 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ITickable;
|
import net.minecraft.util.ITickable;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import WayofTime.bloodmagic.api.event.RitualEvent;
|
||||||
|
import WayofTime.bloodmagic.api.network.SoulNetwork;
|
||||||
|
import WayofTime.bloodmagic.api.registry.RitualRegistry;
|
||||||
|
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
||||||
|
import WayofTime.bloodmagic.api.ritual.Ritual;
|
||||||
|
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.RitualHelper;
|
||||||
|
import WayofTime.bloodmagic.item.ItemActivationCrystal;
|
||||||
|
import WayofTime.bloodmagic.registry.ModItems;
|
||||||
|
import WayofTime.bloodmagic.util.ChatUtil;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -285,6 +290,7 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
@Override
|
@Override
|
||||||
public World getWorldObj()
|
public World getWorldObj()
|
||||||
{
|
{
|
||||||
|
|
||||||
return getWorld();
|
return getWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,4 +299,62 @@ public class TileMasterRitualStone extends TileEntity implements IMasterRitualSt
|
||||||
{
|
{
|
||||||
return getPos();
|
return getPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getNextBlockRange(String range)
|
||||||
|
{
|
||||||
|
if (this.currentRitual != null)
|
||||||
|
{
|
||||||
|
return this.currentRitual.getNextBlockRange(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void provideInformationOfRitualToPlayer(EntityPlayer player)
|
||||||
|
{
|
||||||
|
if (this.currentRitual != null)
|
||||||
|
{
|
||||||
|
ChatUtil.sendNoSpam(player, this.currentRitual.provideInformationOfRitualToPlayer(player));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void provideInformationOfRangeToPlayer(EntityPlayer player, String range)
|
||||||
|
{
|
||||||
|
if (this.currentRitual != null)
|
||||||
|
{
|
||||||
|
ChatUtil.sendNoSpam(player, this.currentRitual.provideInformationOfRangeToPlayer(player, range));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setActiveWillDrain(EntityPlayer player, List<EnumDemonWillType> typeList)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean setBlockRangeByBounds(EntityPlayer player, String range, BlockPos offset1, BlockPos offset2)
|
||||||
|
{
|
||||||
|
if (this.currentRitual != null)
|
||||||
|
{
|
||||||
|
boolean allowed = this.currentRitual.setBlockRangeByBounds(range, this, offset1, offset2);
|
||||||
|
if (player != null && !allowed)
|
||||||
|
{
|
||||||
|
ChatUtil.sendNoSpam(player, this.currentRitual.getErrorForBlockRangeOnFail(player, range, this, offset1, offset2));
|
||||||
|
}
|
||||||
|
|
||||||
|
return allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
ChatUtil.sendNoSpam(player, "ritual.BloodMagic.blockRange.inactive");
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,6 +369,10 @@ tooltip.BloodMagic.experienceTome.exp=Exp: %0.3f
|
||||||
tooltip.BloodMagic.experienceTome.expLevel=Level: %d
|
tooltip.BloodMagic.experienceTome.expLevel=Level: %d
|
||||||
|
|
||||||
# Ritual
|
# Ritual
|
||||||
|
ritual.BloodMagic.blockRange.tooBig=The block range given is either too big or too far away from the MRS!
|
||||||
|
ritual.BloodMagic.blockRange.inactive=The ritual stone is currently inactive, and cannot have its range modified.
|
||||||
|
ritual.BloodMagic.blockRange.noRange=The range was not properly chosen.
|
||||||
|
|
||||||
ritual.BloodMagic.testRitual=Test Ritual
|
ritual.BloodMagic.testRitual=Test Ritual
|
||||||
ritual.BloodMagic.waterRitual=Ritual of the Full Spring
|
ritual.BloodMagic.waterRitual=Ritual of the Full Spring
|
||||||
ritual.BloodMagic.lavaRitual=Serenade of the Nether
|
ritual.BloodMagic.lavaRitual=Serenade of the Nether
|
||||||
|
@ -399,6 +403,9 @@ ritual.BloodMagic.pumpRitual=Hymn of Siphoning
|
||||||
ritual.BloodMagic.altarBuilderRitual=The Assembly of the High Altar
|
ritual.BloodMagic.altarBuilderRitual=The Assembly of the High Altar
|
||||||
ritual.BloodMagic.portalRitual=The Gate of the Fold
|
ritual.BloodMagic.portalRitual=The Gate of the Fold
|
||||||
|
|
||||||
|
ritual.BloodMagic.wellOfSufferingRitual.info=Attacks mobs within its damage zone and puts the LP into a nearby blood altar.
|
||||||
|
ritual.BloodMagic.wellOfSufferingRitual.altar.info=(Altar) This range defines the area that the ritual searches for the blood altar. Changing this will either expand or limit the range to a certain region.
|
||||||
|
ritual.BloodMagic.wellOfSufferingRitual.damage.info=(Damage) This defines where the ritual will damage a mob. All mobs inside of this range (except for players) will receive damage over time.
|
||||||
# Chat
|
# Chat
|
||||||
chat.BloodMagic.altarMaker.setTier=Set Tier to: %d
|
chat.BloodMagic.altarMaker.setTier=Set Tier to: %d
|
||||||
chat.BloodMagic.altarMaker.building=Building a Tier %d Altar
|
chat.BloodMagic.altarMaker.building=Building a Tier %d Altar
|
||||||
|
|
Loading…
Reference in a new issue