Added chest ranges to the rituals that have chests, allowing the location of the chest to be assigned by the player.
This commit is contained in:
parent
9fe525b74b
commit
51c79f15a9
|
@ -22,11 +22,16 @@ import java.util.List;
|
||||||
public class RitualCrushing extends Ritual
|
public class RitualCrushing extends Ritual
|
||||||
{
|
{
|
||||||
public static final String CRUSHING_RANGE = "crushingRange";
|
public static final String CRUSHING_RANGE = "crushingRange";
|
||||||
|
public static final String CHEST_RANGE = "chest";
|
||||||
|
|
||||||
public RitualCrushing()
|
public RitualCrushing()
|
||||||
{
|
{
|
||||||
super("ritualCrushing", 0, 5000, "ritual." + Constants.Mod.MODID + ".crushingRitual");
|
super("ritualCrushing", 0, 5000, "ritual." + Constants.Mod.MODID + ".crushingRitual");
|
||||||
addBlockRange(CRUSHING_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-1, -3, -1), 3));
|
addBlockRange(CRUSHING_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-1, -3, -1), 3));
|
||||||
|
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||||
|
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CRUSHING_RANGE, 50, 10, 10);
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,8 +19,8 @@ import java.util.Iterator;
|
||||||
|
|
||||||
public class RitualFelling extends Ritual
|
public class RitualFelling extends Ritual
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final String FELLING_RANGE = "fellingRange";
|
public static final String FELLING_RANGE = "fellingRange";
|
||||||
|
public static final String CHEST_RANGE = "chest";
|
||||||
|
|
||||||
private ArrayList<BlockPos> treePartsCache;
|
private ArrayList<BlockPos> treePartsCache;
|
||||||
private Iterator<BlockPos> blockPosIterator;
|
private Iterator<BlockPos> blockPosIterator;
|
||||||
|
@ -30,8 +30,12 @@ public class RitualFelling extends Ritual
|
||||||
|
|
||||||
public RitualFelling()
|
public RitualFelling()
|
||||||
{
|
{
|
||||||
super("ritualFelling", 0, 500, "ritual." + Constants.Mod.MODID + ".fellingRitual");
|
super("ritualFelling", 0, 20000, "ritual." + Constants.Mod.MODID + ".fellingRitual");
|
||||||
addBlockRange(FELLING_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-10, -3, -10), new BlockPos(11, 27, 11)));
|
addBlockRange(FELLING_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-10, -3, -10), new BlockPos(11, 27, 11)));
|
||||||
|
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||||
|
|
||||||
|
setMaximumVolumeAndDistanceOfRange(FELLING_RANGE, 14000, 15, 30);
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||||
|
|
||||||
treePartsCache = new ArrayList<BlockPos>();
|
treePartsCache = new ArrayList<BlockPos>();
|
||||||
}
|
}
|
||||||
|
@ -43,6 +47,10 @@ public class RitualFelling extends Ritual
|
||||||
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
||||||
int currentEssence = network.getCurrentEssence();
|
int currentEssence = network.getCurrentEssence();
|
||||||
|
|
||||||
|
BlockPos masterPos = masterRitualStone.getBlockPos();
|
||||||
|
AreaDescriptor chestRange = getBlockRange(CHEST_RANGE);
|
||||||
|
TileEntity tileInventory = world.getTileEntity(chestRange.getContainedPositions(masterPos).get(0));
|
||||||
|
|
||||||
if (currentEssence < getRefreshCost())
|
if (currentEssence < getRefreshCost())
|
||||||
{
|
{
|
||||||
network.causeNauseaToPlayer();
|
network.causeNauseaToPlayer();
|
||||||
|
@ -64,11 +72,11 @@ public class RitualFelling extends Ritual
|
||||||
blockPosIterator = treePartsCache.iterator();
|
blockPosIterator = treePartsCache.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockPosIterator.hasNext() && world.getTileEntity(masterRitualStone.getBlockPos().up()) != null && world.getTileEntity(masterRitualStone.getBlockPos().up()) instanceof IInventory)
|
if (blockPosIterator.hasNext() && tileInventory != null && tileInventory instanceof IInventory)
|
||||||
{
|
{
|
||||||
network.syphon(getRefreshCost());
|
network.syphon(getRefreshCost());
|
||||||
currentPos = blockPosIterator.next();
|
currentPos = blockPosIterator.next();
|
||||||
placeInInventory(world.getBlockState(currentPos), world, currentPos, masterRitualStone.getBlockPos().up());
|
placeInInventory(world.getBlockState(currentPos), world, currentPos, chestRange.getContainedPositions(masterPos).get(0));
|
||||||
world.setBlockToAir(currentPos);
|
world.setBlockToAir(currentPos);
|
||||||
blockPosIterator.remove();
|
blockPosIterator.remove();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,16 @@ import java.util.List;
|
||||||
public class RitualFullStomach extends Ritual
|
public class RitualFullStomach extends Ritual
|
||||||
{
|
{
|
||||||
public static final String FILL_RANGE = "fillRange";
|
public static final String FILL_RANGE = "fillRange";
|
||||||
|
public static final String CHEST_RANGE = "chest";
|
||||||
|
|
||||||
public RitualFullStomach()
|
public RitualFullStomach()
|
||||||
{
|
{
|
||||||
super("ritualFullStomach", 0, 100000, "ritual." + Constants.Mod.MODID + ".fullStomachRitual");
|
super("ritualFullStomach", 0, 100000, "ritual." + Constants.Mod.MODID + ".fullStomachRitual");
|
||||||
addBlockRange(FILL_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-25, -25, -25), 51));
|
addBlockRange(FILL_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-25, -25, -25), 51));
|
||||||
|
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||||
|
|
||||||
|
setMaximumVolumeAndDistanceOfRange(FILL_RANGE, 0, 25, 25);
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,7 +44,8 @@ public class RitualFullStomach extends Ritual
|
||||||
int maxEffects = currentEssence / getRefreshCost();
|
int maxEffects = currentEssence / getRefreshCost();
|
||||||
int totalEffects = 0;
|
int totalEffects = 0;
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(pos.up());
|
AreaDescriptor chestRange = getBlockRange(CHEST_RANGE);
|
||||||
|
TileEntity tile = world.getTileEntity(chestRange.getContainedPositions(pos).get(0));
|
||||||
if (!(tile instanceof IInventory))
|
if (!(tile instanceof IInventory))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -19,11 +19,16 @@ import java.util.ArrayList;
|
||||||
public class RitualPlacer extends Ritual
|
public class RitualPlacer extends Ritual
|
||||||
{
|
{
|
||||||
public static final String PLACER_RANGE = "placerRange";
|
public static final String PLACER_RANGE = "placerRange";
|
||||||
|
public static final String CHEST_RANGE = "chest";
|
||||||
|
|
||||||
public RitualPlacer()
|
public RitualPlacer()
|
||||||
{
|
{
|
||||||
super("ritualPlacer", 0, 5000, "ritual." + Constants.Mod.MODID + ".placerRitual");
|
super("ritualPlacer", 0, 5000, "ritual." + Constants.Mod.MODID + ".placerRitual");
|
||||||
addBlockRange(PLACER_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-2, 0, -2), 5, 1, 5));
|
addBlockRange(PLACER_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-2, 0, -2), 5, 1, 5));
|
||||||
|
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||||
|
|
||||||
|
setMaximumVolumeAndDistanceOfRange(PLACER_RANGE, 300, 7, 7);
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,7 +36,9 @@ public class RitualPlacer extends Ritual
|
||||||
{
|
{
|
||||||
World world = masterRitualStone.getWorldObj();
|
World world = masterRitualStone.getWorldObj();
|
||||||
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
||||||
TileEntity tileEntity = world.getTileEntity(masterRitualStone.getBlockPos().up());
|
BlockPos masterPos = masterRitualStone.getBlockPos();
|
||||||
|
AreaDescriptor chestRange = getBlockRange(CHEST_RANGE);
|
||||||
|
TileEntity tileEntity = world.getTileEntity(chestRange.getContainedPositions(masterPos).get(0));
|
||||||
|
|
||||||
int currentEssence = network.getCurrentEssence();
|
int currentEssence = network.getCurrentEssence();
|
||||||
|
|
||||||
|
@ -97,6 +104,7 @@ public class RitualPlacer extends Ritual
|
||||||
iInventory.decrStackSize(inv, 1);
|
iInventory.decrStackSize(inv, 1);
|
||||||
iInventory.markDirty();
|
iInventory.markDirty();
|
||||||
network.syphon(getRefreshCost());
|
network.syphon(getRefreshCost());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,16 @@ import java.util.List;
|
||||||
public class RitualZephyr extends Ritual
|
public class RitualZephyr extends Ritual
|
||||||
{
|
{
|
||||||
public static final String ZEPHYR_RANGE = "zephyrRange";
|
public static final String ZEPHYR_RANGE = "zephyrRange";
|
||||||
|
public static final String CHEST_RANGE = "chest";
|
||||||
|
|
||||||
public RitualZephyr()
|
public RitualZephyr()
|
||||||
{
|
{
|
||||||
super("ritualZephyr", 0, 1000, "ritual." + Constants.Mod.MODID + ".zephyrRitual");
|
super("ritualZephyr", 0, 1000, "ritual." + Constants.Mod.MODID + ".zephyrRitual");
|
||||||
addBlockRange(ZEPHYR_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11));
|
addBlockRange(ZEPHYR_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11));
|
||||||
|
addBlockRange(CHEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1));
|
||||||
|
|
||||||
|
setMaximumVolumeAndDistanceOfRange(ZEPHYR_RANGE, 0, 10, 10);
|
||||||
|
setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,7 +37,9 @@ public class RitualZephyr extends Ritual
|
||||||
World world = masterRitualStone.getWorldObj();
|
World world = masterRitualStone.getWorldObj();
|
||||||
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
SoulNetwork network = NetworkHelper.getSoulNetwork(masterRitualStone.getOwner());
|
||||||
int currentEssence = network.getCurrentEssence();
|
int currentEssence = network.getCurrentEssence();
|
||||||
TileEntity tileInventory = world.getTileEntity(masterRitualStone.getBlockPos().up());
|
BlockPos masterPos = masterRitualStone.getBlockPos();
|
||||||
|
AreaDescriptor chestRange = getBlockRange(CHEST_RANGE);
|
||||||
|
TileEntity tileInventory = world.getTileEntity(chestRange.getContainedPositions(masterPos).get(0));
|
||||||
|
|
||||||
if (!masterRitualStone.getWorldObj().isRemote && tileInventory != null && tileInventory instanceof IInventory)
|
if (!masterRitualStone.getWorldObj().isRemote && tileInventory != null && tileInventory instanceof IInventory)
|
||||||
{
|
{
|
||||||
|
|
|
@ -421,13 +421,13 @@ ritual.BloodMagic.fullStomachRitual.info=Takes food from the linked chest and fi
|
||||||
ritual.BloodMagic.interdictionRitual.info=Pushes all mobs within its area away from the master ritual stone.
|
ritual.BloodMagic.interdictionRitual.info=Pushes all mobs within its area away from the master ritual stone.
|
||||||
ritual.BloodMagic.containmentRitual.info=Pulls all mobs within its area towards the master ritual stone.
|
ritual.BloodMagic.containmentRitual.info=Pulls all mobs within its area towards the master ritual stone.
|
||||||
ritual.BloodMagic.speedRitual.info=Launches players within its range in the direction of the ritual.
|
ritual.BloodMagic.speedRitual.info=Launches players within its range in the direction of the ritual.
|
||||||
ritual.BloodMagic.suppressionRitual.info=
|
ritual.BloodMagic.suppressionRitual.info=Suppresses fluids within its range - deactivating the ritual returns the fluids back to the world.
|
||||||
ritual.BloodMagic.expulsionRitual.info=
|
ritual.BloodMagic.expulsionRitual.info=Expels players from its range that are neither the owner nor have a bound blood orb in the chest on top of the master ritual stone.
|
||||||
ritual.BloodMagic.zephyrRitual.info=
|
ritual.BloodMagic.zephyrRitual.info=Picks up items within its range and places them into the linked chest.
|
||||||
ritual.BloodMagic.upgradeRemoveRitual.info=
|
ritual.BloodMagic.upgradeRemoveRitual.info=Undocumented.
|
||||||
ritual.BloodMagic.armourEvolveRitual.info=
|
ritual.BloodMagic.armourEvolveRitual.info=Undocumented.
|
||||||
ritual.BloodMagic.animalGrowthRitual.info=
|
ritual.BloodMagic.animalGrowthRitual.info=Increases the maturity rate of baby animals within its range.
|
||||||
ritual.BloodMagic.forsakenSoulRitual.info=
|
ritual.BloodMagic.forsakenSoulRitual.info=Damages mobs within its damage range and when the mob dies a demon crystal within its crystal range will be grown.
|
||||||
|
|
||||||
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.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.
|
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.
|
||||||
|
|
Loading…
Reference in a new issue