diff --git a/src/main/java/WayofTime/bloodmagic/ConfigHandler.java b/src/main/java/WayofTime/bloodmagic/ConfigHandler.java index 4bed50be..85b20776 100644 --- a/src/main/java/WayofTime/bloodmagic/ConfigHandler.java +++ b/src/main/java/WayofTime/bloodmagic/ConfigHandler.java @@ -66,6 +66,8 @@ public class ConfigHandler public int sacrificialDaggerConversion = 100; @Config.Comment({ "Will rewrite any default meteor types with new versions.", "Disable this if you want any of your changes to stay, or do not want default meteor types regenerated." }) public boolean shouldResyncMeteors = true; + @Config.Comment({ "Should mobs that die through the Well of Suffering Ritual drop items?"}) + public boolean wellOfSufferingDrops = true; } public static class ConfigClient diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualManager.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualManager.java index e6e2287b..ff8aa0bc 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualManager.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualManager.java @@ -6,12 +6,17 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import net.minecraft.block.state.IBlockState; +import net.minecraft.util.DamageSource; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.discovery.ASMDataTable; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; public class RitualManager { + public static final DamageSource RITUAL_DAMAGE = new DamageSource("ritual_damage").setDamageBypassesArmor(); private final Map rituals; private final Map ritualsReverse; @@ -20,6 +25,7 @@ public class RitualManager { private final Map imperfectRitualsReverse; private final Configuration config; + public RitualManager(Configuration config) { this.rituals = Maps.newTreeMap(); this.ritualsReverse = Maps.newHashMap(); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java index 0e3207bc..7caf6c88 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java @@ -9,7 +9,6 @@ import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -110,7 +109,7 @@ public class RitualForsakenSoul extends Ritual { continue; if (entity.isEntityAlive() && !(entity instanceof EntityPlayer)) { - if (entity.attackEntityFrom(DamageSource.OUT_OF_WORLD, 1)) { + if (entity.attackEntityFrom(RitualManager.RITUAL_DAMAGE, 1)) { if (!entity.isEntityAlive()) { int uniqueness = calculateUniqueness(entity); double modifier = 1; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java index 8e20ebf6..7a27fce3 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java @@ -7,7 +7,6 @@ import WayofTime.bloodmagic.tile.TileAltar; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -89,7 +88,7 @@ public class RitualWellOfSuffering extends Ritual { continue; if (entity.isEntityAlive() && !(entity instanceof EntityPlayer)) { - if (entity.attackEntityFrom(DamageSource.OUT_OF_WORLD, 1)) { + if (entity.attackEntityFrom(RitualManager.RITUAL_DAMAGE, 1)) { if (entity.isChild()) lifeEssenceRatio *= 0.5F; diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java index 0dff68cc..9dbc6711 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java @@ -3,37 +3,40 @@ package WayofTime.bloodmagic.util.handler.event; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.ConfigHandler; import WayofTime.bloodmagic.api.impl.BloodMagicAPI; +import WayofTime.bloodmagic.block.BlockAltar; +import WayofTime.bloodmagic.core.RegistrarBloodMagic; +import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; import WayofTime.bloodmagic.core.data.Binding; -import WayofTime.bloodmagic.util.Constants; +import WayofTime.bloodmagic.core.data.SoulNetwork; +import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; +import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter; import WayofTime.bloodmagic.event.ItemBindEvent; import WayofTime.bloodmagic.event.SacrificeKnifeUsedEvent; import WayofTime.bloodmagic.event.TeleposeEvent; import WayofTime.bloodmagic.iface.IBindable; import WayofTime.bloodmagic.iface.ISentientTool; -import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; -import WayofTime.bloodmagic.orb.BloodOrb; -import WayofTime.bloodmagic.orb.IBloodOrb; -import WayofTime.bloodmagic.core.data.SoulNetwork; -import WayofTime.bloodmagic.soul.DemonWillHolder; -import WayofTime.bloodmagic.block.BlockAltar; -import WayofTime.bloodmagic.core.RegistrarBloodMagic; -import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; -import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.entity.mob.EntitySentientSpecter; import WayofTime.bloodmagic.item.ItemAltarMaker; import WayofTime.bloodmagic.item.ItemExperienceBook; import WayofTime.bloodmagic.item.armour.ItemLivingArmour; import WayofTime.bloodmagic.item.gear.ItemPackSacrifice; import WayofTime.bloodmagic.livingArmour.LivingArmour; +import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry; import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerSelfSacrifice; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice; import WayofTime.bloodmagic.network.BloodMagicPacketHandler; import WayofTime.bloodmagic.network.DemonAuraPacketProcessor; +import WayofTime.bloodmagic.orb.BloodOrb; +import WayofTime.bloodmagic.orb.IBloodOrb; import WayofTime.bloodmagic.potion.BMPotionUtils; -import WayofTime.bloodmagic.util.ChatUtil; +import WayofTime.bloodmagic.ritual.RitualManager; +import WayofTime.bloodmagic.soul.DemonWillHolder; +import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.util.Utils; -import WayofTime.bloodmagic.util.helper.*; +import WayofTime.bloodmagic.util.helper.BindableHelper; +import WayofTime.bloodmagic.util.helper.ItemHelper; +import WayofTime.bloodmagic.util.helper.NetworkHelper; +import WayofTime.bloodmagic.util.helper.PlayerHelper; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.EnchantmentHelper; @@ -79,7 +82,10 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.registry.EntityEntry; import net.minecraftforge.fml.common.registry.EntityRegistry; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; @Mod.EventBusSubscriber(modid = BloodMagic.MODID) public class GenericHandler { @@ -405,6 +411,15 @@ public class GenericHandler { } } + @SubscribeEvent + public static void onRitualDeath(LivingDropsEvent event){ + if(!ConfigHandler.values.wellOfSufferingDrops){ + if(event.getSource().equals(RitualManager.RITUAL_DAMAGE)) { + event.getDrops().clear(); + } + } + } + // Experience Tome @SubscribeEvent(priority = EventPriority.LOWEST) public static void onExperiencePickup(PlayerPickupXpEvent event) { diff --git a/src/main/resources/assets/bloodmagic/lang/de_DE.lang b/src/main/resources/assets/bloodmagic/lang/de_DE.lang index d4d8ce84..0cb12242 100644 --- a/src/main/resources/assets/bloodmagic/lang/de_DE.lang +++ b/src/main/resources/assets/bloodmagic/lang/de_DE.lang @@ -857,6 +857,9 @@ bloodmagic.keybind.open_holding=Öffne Siegel der Aufbewahrung bloodmagic.keybind.cycle_holding_pos=Siegelrotation (+) bloodmagic.keybind.cycle_holding_neg=Siegelrotation (-) +death.attack.ritual_damage=%1$s wurde für ein Ritual geopfert. +death.attack.ritual_damage.player=%2$s hat %1$s für ein Ritual geopfert. + # JustEnoughItems jei.bloodmagic.recipe.altar=Blutaltar jei.bloodmagic.recipe.binding=Alchemische Anordnung (Bindung) diff --git a/src/main/resources/assets/bloodmagic/lang/en_US.lang b/src/main/resources/assets/bloodmagic/lang/en_US.lang index 5545c19c..4e51e06b 100644 --- a/src/main/resources/assets/bloodmagic/lang/en_US.lang +++ b/src/main/resources/assets/bloodmagic/lang/en_US.lang @@ -789,6 +789,9 @@ chat.bloodmagic.mimic.detectRadius.down=Player detection radius has been decreas chat.bloodmagic.mimic.potionSpawnRadius.up=Potion spawning radius has been increased to: %d blocks. chat.bloodmagic.mimic.potionSpawnRadius.down=Potion spawning radius has been decreased to: %d blocks. +death.attack.ritual_damage=%1$s has been sacrificed for a ritual. +death.attack.ritual_damage.player=%2$s has sacrificed %1$s for a ritual. + # entity entity.bloodmagic.SentientSpecter.name=Sentient Specter entity.bloodmagic.Mimic.name=Mimic @@ -849,6 +852,8 @@ commands.bloodmagic.soulnetwork.notACommand=That is not a valid command commands.bloodmagic.soulnetwork.fillMax.success=Successfully filled %s's Soul Network to their orb max! commands.bloodmagic.soulnetwork.create.success=Successfully created %s's Soul Network (Orb tier: %d) + + # GUI tile.bloodmagic.inputNode.name=Input Node tile.bloodmagic.outputNode.name=Output Node