Did some minor bug fixes and updates with some rituals.

This commit is contained in:
WayofTime 2016-11-19 17:06:11 -05:00
parent 841eb2a1df
commit a04c8af550
6 changed files with 30 additions and 18 deletions

View file

@ -202,7 +202,7 @@ public class ConfigHandler
category = "Blood Altar Sacrificial Values"; category = "Blood Altar Sacrificial Values";
config.addCustomCategoryComment(category, "Entity Sacrificial Value Settings"); config.addCustomCategoryComment(category, "Entity Sacrificial Value Settings");
entitySacrificeValuesList = config.getStringList("entitySacrificeLP:HPValues", category, new String[] { "EntityVillager;100", "EntitySlime;15", "EntityEnderman;10", "EntityCow;100", "EntityChicken;100", "EntityHorse;250", "EntitySheep;100", "EntityWolf;100", "EntityOcelot;100", "EntityPig;100", "EntityRabbit;100", "EntityArmorStand;0" }, "Used to edit the amount of LP gained per HP sacrificed for the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerHP"); entitySacrificeValuesList = config.getStringList("entitySacrificeLP:HPValues", category, new String[] { "EntityVillager;100", "EntitySlime;15", "EntityEnderman;10", "EntityCow;100", "EntityChicken;100", "EntityHorse;100", "EntitySheep;100", "EntityWolf;100", "EntityOcelot;100", "EntityPig;100", "EntityRabbit;100", "EntityArmorStand;0" }, "Used to edit the amount of LP gained per HP sacrificed for the given entity.\nSetting an entity to 0 effectively blacklists it.\nIf a mod modifies an entity via the API, it will take precedence over this config.\nSyntax: EntityClassName;LPPerHP");
buildEntitySacrificeValues(); buildEntitySacrificeValues();
category = "Potions"; category = "Potions";

View file

@ -20,7 +20,7 @@ public class RitualContainment extends Ritual
{ {
super("ritualContainment", 0, 2000, "ritual." + Constants.Mod.MODID + ".containmentRitual"); super("ritualContainment", 0, 2000, "ritual." + Constants.Mod.MODID + ".containmentRitual");
addBlockRange(CONTAINMENT_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-3, 0, -3), 7)); addBlockRange(CONTAINMENT_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-3, 0, -3), 7));
setMaximumVolumeAndDistanceOfRange(CONTAINMENT_RANGE, 0, 5, 10); setMaximumVolumeAndDistanceOfRange(CONTAINMENT_RANGE, 0, 10, 10);
} }
@Override @Override

View file

@ -8,24 +8,26 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.items.IItemHandler;
import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.iface.IBindable; import WayofTime.bloodmagic.api.iface.IBindable;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.AreaDescriptor; import WayofTime.bloodmagic.api.ritual.AreaDescriptor;
import WayofTime.bloodmagic.api.ritual.EnumRuneType; import WayofTime.bloodmagic.api.ritual.EnumRuneType;
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone; import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
import WayofTime.bloodmagic.api.ritual.Ritual; import WayofTime.bloodmagic.api.ritual.Ritual;
import WayofTime.bloodmagic.api.ritual.RitualComponent; import WayofTime.bloodmagic.api.ritual.RitualComponent;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper; import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper; import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import WayofTime.bloodmagic.util.Utils;
import com.google.common.base.Strings; import com.google.common.base.Strings;
@ -59,13 +61,17 @@ public class RitualExpulsion extends Ritual
AreaDescriptor expulsionRange = getBlockRange(EXPULSION_RANGE); AreaDescriptor expulsionRange = getBlockRange(EXPULSION_RANGE);
List<String> allowedNames = new ArrayList<String>(); List<String> allowedNames = new ArrayList<String>();
BlockPos masterPos = masterRitualStone.getBlockPos();
TileEntity tile = world.getTileEntity(masterPos.up());
if (world.getTileEntity(masterRitualStone.getBlockPos().up()) != null && world.getTileEntity(masterRitualStone.getBlockPos().up()) instanceof IInventory) if (tile != null)
{ {
IInventory inventory = (IInventory) world.getTileEntity(masterRitualStone.getBlockPos().up()); IItemHandler handler = Utils.getInventory(tile, null);
for (int i = 0; i < inventory.getSizeInventory(); i++) if (handler != null)
{ {
ItemStack itemStack = inventory.getStackInSlot(i); for (int i = 0; i < handler.getSlots(); i++)
{
ItemStack itemStack = handler.getStackInSlot(i);
if (itemStack != null && itemStack.getItem() instanceof IBindable) if (itemStack != null && itemStack.getItem() instanceof IBindable)
{ {
IBindable bindable = (IBindable) itemStack.getItem(); IBindable bindable = (IBindable) itemStack.getItem();
@ -74,6 +80,7 @@ public class RitualExpulsion extends Ritual
} }
} }
} }
}
final int teleportDistance = 100; final int teleportDistance = 100;

View file

@ -31,7 +31,7 @@ public class RitualHarvest extends Ritual
{ {
super("ritualHarvest", 0, 20000, "ritual." + Constants.Mod.MODID + ".harvestRitual"); super("ritualHarvest", 0, 20000, "ritual." + Constants.Mod.MODID + ".harvestRitual");
addBlockRange(HARVEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-4, 1, -4), 9, 5, 9)); addBlockRange(HARVEST_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-4, 1, -4), 9, 5, 9));
setMaximumVolumeAndDistanceOfRange(HARVEST_RANGE, 81, 15, 15); setMaximumVolumeAndDistanceOfRange(HARVEST_RANGE, 0, 15, 15);
} }
@Override @Override

View file

@ -20,7 +20,7 @@ public class RitualInterdiction extends Ritual
{ {
super("ritualInterdiction", 0, 1000, "ritual." + Constants.Mod.MODID + ".interdictionRitual"); super("ritualInterdiction", 0, 1000, "ritual." + Constants.Mod.MODID + ".interdictionRitual");
addBlockRange(INTERDICTION_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-2, 0, -2), 5)); addBlockRange(INTERDICTION_RANGE, new AreaDescriptor.Rectangle(new BlockPos(-2, 0, -2), 5));
setMaximumVolumeAndDistanceOfRange(INTERDICTION_RANGE, 0, 5, 5); setMaximumVolumeAndDistanceOfRange(INTERDICTION_RANGE, 0, 10, 10);
} }
@Override @Override
@ -43,14 +43,19 @@ public class RitualInterdiction extends Ritual
if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || PlayerHelper.getUUIDFromPlayer((EntityPlayer) entity).toString().equals(masterRitualStone.getOwner()))) if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || PlayerHelper.getUUIDFromPlayer((EntityPlayer) entity).toString().equals(masterRitualStone.getOwner())))
continue; continue;
double xDif = entity.posX - masterRitualStone.getBlockPos().getX(); double xDif = entity.posX - (masterRitualStone.getBlockPos().getX() + 0.5);
double yDif = entity.posY - masterRitualStone.getBlockPos().getY() + 1; double yDif = entity.posY - masterRitualStone.getBlockPos().getY() + 1;
double zDif = entity.posZ - masterRitualStone.getBlockPos().getZ(); double zDif = entity.posZ - (masterRitualStone.getBlockPos().getZ() + 0.5);
entity.motionX = 0.1 * xDif; entity.motionX = 0.1 * xDif;
entity.motionY = 0.1 * yDif; entity.motionY = 0.1 * yDif;
entity.motionZ = 0.1 * zDif; entity.motionZ = 0.1 * zDif;
entity.fallDistance = 0; entity.fallDistance = 0;
if (entity instanceof EntityPlayer)
{
entity.velocityChanged = true;
}
} }
} }

View file

@ -77,7 +77,7 @@ public class RitualRegeneration extends Ritual
double corrosiveDrain = 0; double corrosiveDrain = 0;
boolean syphonHealth = corrosiveWill >= corrosiveWillDrain; boolean syphonHealth = corrosiveWill >= corrosiveWillDrain;
boolean applyAbsorption = true; boolean applyAbsorption = false;
float absorptionRate = 1; float absorptionRate = 1;
int maxAbsorption = 20; int maxAbsorption = 20;
@ -177,7 +177,7 @@ public class RitualRegeneration extends Ritual
@Override @Override
public int getRefreshCost() public int getRefreshCost()
{ {
return 200; return SACRIFICE_AMOUNT;
} }
@Override @Override