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";
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();
category = "Potions";

View file

@ -20,7 +20,7 @@ public class RitualContainment extends Ritual
{
super("ritualContainment", 0, 2000, "ritual." + Constants.Mod.MODID + ".containmentRitual");
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

View file

@ -8,24 +8,26 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.items.IItemHandler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.iface.IBindable;
import WayofTime.bloodmagic.api.saving.SoulNetwork;
import WayofTime.bloodmagic.api.ritual.AreaDescriptor;
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.saving.SoulNetwork;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
import WayofTime.bloodmagic.util.Utils;
import com.google.common.base.Strings;
@ -59,18 +61,23 @@ public class RitualExpulsion extends Ritual
AreaDescriptor expulsionRange = getBlockRange(EXPULSION_RANGE);
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());
for (int i = 0; i < inventory.getSizeInventory(); i++)
IItemHandler handler = Utils.getInventory(tile, null);
if (handler != null)
{
ItemStack itemStack = inventory.getStackInSlot(i);
if (itemStack != null && itemStack.getItem() instanceof IBindable)
for (int i = 0; i < handler.getSlots(); i++)
{
IBindable bindable = (IBindable) itemStack.getItem();
if (!Strings.isNullOrEmpty(bindable.getOwnerName(itemStack)) && !allowedNames.contains(bindable.getOwnerName(itemStack)))
allowedNames.add(bindable.getOwnerName(itemStack));
ItemStack itemStack = handler.getStackInSlot(i);
if (itemStack != null && itemStack.getItem() instanceof IBindable)
{
IBindable bindable = (IBindable) itemStack.getItem();
if (!Strings.isNullOrEmpty(bindable.getOwnerName(itemStack)) && !allowedNames.contains(bindable.getOwnerName(itemStack)))
allowedNames.add(bindable.getOwnerName(itemStack));
}
}
}
}

View file

@ -31,7 +31,7 @@ public class RitualHarvest extends Ritual
{
super("ritualHarvest", 0, 20000, "ritual." + Constants.Mod.MODID + ".harvestRitual");
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

View file

@ -20,7 +20,7 @@ public class RitualInterdiction extends Ritual
{
super("ritualInterdiction", 0, 1000, "ritual." + Constants.Mod.MODID + ".interdictionRitual");
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
@ -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())))
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 zDif = entity.posZ - masterRitualStone.getBlockPos().getZ();
double zDif = entity.posZ - (masterRitualStone.getBlockPos().getZ() + 0.5);
entity.motionX = 0.1 * xDif;
entity.motionY = 0.1 * yDif;
entity.motionZ = 0.1 * zDif;
entity.fallDistance = 0;
if (entity instanceof EntityPlayer)
{
entity.velocityChanged = true;
}
}
}

View file

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