Fix some formatting in CraftEventFactory

This commit is contained in:
md_5 2017-11-22 17:05:59 +11:00
parent bdb8822625
commit f46ccd7637

View File

@ -349,14 +349,14 @@ public class CraftEventFactory {
return event;
}
public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) {
public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) {
ThrownPotion thrownPotion = (ThrownPotion) potion.getBukkitEntity();
AreaEffectCloud effectCloud = (AreaEffectCloud) cloud.getBukkitEntity();
LingeringPotionSplashEvent event = new LingeringPotionSplashEvent(thrownPotion, effectCloud);
Bukkit.getPluginManager().callEvent(event);
return event;
}
}
/**
* BlockFadeEvent
@ -589,7 +589,7 @@ public class CraftEventFactory {
private static final Function<? super Double, Double> ZERO = Functions.constant(-0.0);
public static EntityDamageEvent handleLivingEntityDamageEvent(Entity damagee, DamageSource source, double rawDamage, double hardHatModifier, double blockingModifier, double armorModifier, double resistanceModifier, double magicModifier, double absorptionModifier, Function<Double, Double> hardHat, Function<Double, Double> blocking, Function<Double, Double> armor, Function<Double, Double> resistance, Function<Double, Double> magic, Function<Double, Double> absorption) {
Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
Map<DamageModifier, Double> modifiers = new EnumMap<DamageModifier, Double>(DamageModifier.class);
Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<DamageModifier, Function<? super Double, Double>>(DamageModifier.class);
modifiers.put(DamageModifier.BASE, rawDamage);
modifierFunctions.put(DamageModifier.BASE, ZERO);
@ -668,7 +668,7 @@ public class CraftEventFactory {
if (!event.isCancelled()) {
state.update(true);
}
return !event.isCancelled();
}
@ -856,18 +856,18 @@ public class CraftEventFactory {
org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity();
IgniteCause cause;
switch (bukkitIgniter.getType()) {
case ENDER_CRYSTAL:
cause = IgniteCause.ENDER_CRYSTAL;
break;
case LIGHTNING:
cause = IgniteCause.LIGHTNING;
break;
case SMALL_FIREBALL:
case FIREBALL:
cause = IgniteCause.FIREBALL;
break;
default:
cause = IgniteCause.FLINT_AND_STEEL;
case ENDER_CRYSTAL:
cause = IgniteCause.ENDER_CRYSTAL;
break;
case LIGHTNING:
cause = IgniteCause.LIGHTNING;
break;
case SMALL_FIREBALL:
case FIREBALL:
cause = IgniteCause.FIREBALL;
break;
default:
cause = IgniteCause.FLINT_AND_STEEL;
}
BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter);
@ -1037,7 +1037,7 @@ public class CraftEventFactory {
}
public static EntityBreedEvent callEntityBreedEvent(EntityLiving child, EntityLiving mother, EntityLiving father, EntityLiving breeder, ItemStack bredWith, int experience) {
org.bukkit.entity.LivingEntity breederEntity = (LivingEntity)(breeder == null ? null : breeder.getBukkitEntity());
org.bukkit.entity.LivingEntity breederEntity = (LivingEntity) (breeder == null ? null : breeder.getBukkitEntity());
CraftItemStack bredWithStack = bredWith == null ? null : CraftItemStack.asCraftMirror(bredWith).clone();
EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience);