This commit is contained in:
Electroblob
2018-02-26 18:37:52 +00:00
parent 13444f1de3
commit 6f776fbae6
8 changed files with 15 additions and 17 deletions
@@ -20,8 +20,10 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@Mod.EventBusSubscriber
public interface IElementalDamage {
/** Returns the type of this damage, which determines how it interacts with different entities. */
DamageType getType();
/** Returns true is this damage is from a retaliatory effect (i.e. in response to other damage). Used to avoid
* infinite loops with retaliatory effects. */
boolean isRetaliatory();
@SubscribeEvent
@@ -33,8 +33,8 @@ import net.minecraft.util.EntityDamageSource;
// A note on the use of the vanilla damagesources:
// When using indirect damage sources, the SECOND argument is the original entity (i.e. the caster), and the
// FIRST argument is the actual projectile or whatever that does the damage. getEntity() will return
// the original entity, and getSourceOfDamage() will return the projectile.
// FIRST argument is the actual projectile or whatever that does the damage. getTrueSource() will return
// the original entity, and getImmediateSource() will return the projectile.
// The vanilla approach to damage types is inconsistent, to say the least. Poison is simply 'magic', and relies on
// EntityLivingBase.isPotionApplicable to determine whether an entity is affected or not. Wither, on the other hand, is
@@ -344,8 +344,7 @@ public final class WizardryUtilities {
* defaults to {@link SoundCategory#PLAYERS}.
*/
public static void playSoundAtPlayer(EntityPlayer player, SoundEvent sound, float volume, float pitch){
player.world.playSound(null, player.posX, player.posY, player.posZ, sound, SoundCategory.PLAYERS, volume,
pitch);
player.world.playSound(null, player.posX, player.posY, player.posZ, sound, SoundCategory.PLAYERS, volume, pitch);
}
/**